You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,28 @@
1
1
# Changelog
2
2
All notable changes to this project will be documented in this file.
3
3
4
+
## [2.0.0] - 2020-03-01
5
+
6
+
****
7
+
🚨 **This release is a major version and contains some breaking changes. Please read the list below.**
8
+
****
9
+
10
+
### Changed
11
+
12
+
- Implementation of Somfy Open API, replacing unofficial TahomaLink API
13
+
- Migration of the network layer from deprecated [request](https://www.npmjs.com/package/request) to [axios](https://www.npmjs.com/package/axios)
14
+
-`tahoma-read` node now returns the raw response from the [Somfy Open API](https://developer.somfy.com/somfy-open-api/apis/get/site/%7BsiteId%7D/device}) (a remapping of your flows might be needed)
15
+
16
+
### Added
17
+
18
+
- New code quality control using TSLint
19
+
20
+
## [1.0.1] - 2019-08-21
21
+
22
+
### Changed
23
+
24
+
- Added door handle state support, contributed by [@matthub](https://github.com/matthub)
25
+
4
26
## [1.0.0] - 2018-12-13
5
27
6
28
### Changed
@@ -16,7 +38,6 @@ All notable changes to this project will be documented in this file.
16
38
- New `stop` action to immediatly stop the current action on the devices (See [#5](https://github.com/nikkow/node-red-contrib-tahoma/pull/5), thanks to [@Genosse274](https://github.com/Genosse274))
17
39
- New CHANGELOG.md file to keep track of all updates.
18
40
19
-
20
41
### Changed
21
42
22
-
- Fix path in getSetup() (See [#7](https://github.com/nikkow/node-red-contrib-tahoma/pull/7), thanks to [@hobbyquaker](https://github.com/hobbyquaker))
43
+
- Fix path in getSetup() (See [#7](https://github.com/nikkow/node-red-contrib-tahoma/pull/7), thanks to [@hobbyquaker](https://github.com/hobbyquaker))
Due to a recent change in the API used in v1, most of you were encountering issues during the configuration of your node (e.g. empty device list...). **This API was unofficial and we had no control over it** :)
17
+
18
+
This new v2.0 version implements the Somfy Open API, which is officially available for third-party software as this one.
19
+
20
+
Even though your flows should not be modified, the [config-node](https://nodered.org/docs/user-guide/editor/workspace/nodes#configuration-nodes) must be reconfigured using this new API.
21
+
22
+
**However**, please note that even though this release was tested before being published, you might encounter unexpected issues. **Please backup your flow before proceeding with this major release**.
6
23
7
24
## Setup
8
25
9
26
You can read this [guide](https://nodered.org/docs/getting-started/adding-nodes) from Node-RED official portal. This will help you install this node. Typically, the command are as follows:
10
27
11
28
cd $HOME/.node-red
12
-
npm install node-red-contrib-tahoma
29
+
npm install node-red-contrib-tahoma
13
30
14
31
## Disclaimer
15
-
This software is provided as-is. Be careful: your devices can be totally controlled via API actions. I am not responsible of any mis-usage or corruption of the devices configuration.
32
+
This software is provided **as-is**. Be careful: your devices can be fully controlled via API actions. I am not responsible of any mis-usage or corruption of the devices configuration.
16
33
17
34
## Configuration
18
35
19
-
In order to use this node, you need to have a Tahoma Link account. If you already use the Tahoma Box and the mobile apps, you should have one.
36
+
In order to use this node, you need to have a Somfy account. If you already use the Tahoma Box and the mobile apps, you should have one.
37
+
38
+
You will also need to create an app on the developer portal in order to retrieve a set of required credentials. This [guide](https://github.com/nikkow/node-red-contrib-tahoma/wiki/How-to-create-an-Somfy-Open-API-app%3F) will walk you through this process.
20
39
21
-
When creating your first node, you will be asked to provide your e-mail and password used to login to your Tahoma Link account. These will be used to connect to the API (of course, they will only be used locally, they are not forwarded to me :)).
40
+
When creating your first node, you will be asked to provide your e-mail and password used to login to your Somfy account. These will be used to connect to the API (of course, they will only be used locally, they are not forwarded to me :)).
22
41
23
42
## Usage
24
43
44
+
### Node `tahoma`
45
+
25
46
This node accepts an object as input. The following properties will be parsed:
26
47
27
48
| Property | Type | Required? | Description |
@@ -30,7 +51,7 @@ This node accepts an object as input. The following properties will be parsed:
30
51
|`position`| int (0-100) |*No*| The position you want to set your blinds/door to |
31
52
|`lowspeed`| boolean |*No*| Should the action be triggered in low-speed mode? |
32
53
33
-
### Actions
54
+
####Actions
34
55
35
56
Currently, only a few commands are understood by this node. The possible values for the `action` property are:
36
57
@@ -39,17 +60,25 @@ Currently, only a few commands are understood by this node. The possible values
39
60
*`stop`: This will stop all running actions
40
61
*`customPosition`: This will set the device to a custom position. The position is passed using the `position` property, which is required in this mode.
41
62
42
-
### Output
63
+
####Output
43
64
44
65
The node will output its original `msg.payload` enriched with the result of the expected action. `msg.payload.output` will contain 2 properties:
45
66
46
67
*`open`: a boolean. Set to true if the device is open, or false otherwise
47
68
*`position`: an integer (0-100). Set to the position returned by the Tahoma box.
48
69
*`luminance`: in case of a Sun Sensor, returns the current value of core:LuminanceState (See issue [#6](https://github.com/nikkow/node-red-contrib-tahoma/issues/6))
49
70
71
+
### Node `tahoma-read`
72
+
73
+
This node does not accept any input. You can specify the desired device by editing the node properties.
74
+
75
+
#### Output
76
+
77
+
The node will output its original `msg.payload` enriched with the selected device information. A full example can be found on the Somfy Open API [documentation](https://developer.somfy.com/somfy-open-api/apis/get/site/%7BsiteId%7D/device).
78
+
50
79
## Example flow
51
80
52
-

81
+

53
82
54
83
An example flow can be found in the docs/ folder. Basically, all it does is close and open shutters based on manual triggers. Those can be replaced by some logic (e.g. a node calculating the sunset and sunrise times). The output is sent to a local MQTT broker.
55
84
@@ -63,9 +92,28 @@ This was tested with the following devices:
63
92
64
93
Feel free to send any feedback of any other compatible items or known limitations :)
65
94
66
-
## To-do
95
+
## FAQ / Troubleshooting
96
+
97
+
### I received a "Session expired" error, what happned?
During the login process, Somfy generates a set of credentials composed of two tokens: the first is called an **access token** and the second a **refresh token** (following the [OAuth2](https://oauth.net/2/) protocol).
102
+
103
+
Both these tokens expire at some point.
104
+
105
+
The **access token** (used to authenticate each request sent to Somfy API) has a very short lifetime (1 hour) and needs to be regenerated afterwards. To prevent you from entering your e-mail/password each hour, the **refresh token** handles this new authentication. Whenever the access token expires, a new authentication request is sent and Somfy generates a brand-new set of tokens.
106
+
107
+
However, the **refresh token** has not an infinite lifetime. It expires after **14 days**. Basically, it means that if node-red hasn't reached the Somfy API for 14 days + 1 hour, both your token have expired and you need to login again.
108
+
109
+
#### What should I do?
110
+
111
+
This error is also described in the "Debug" tab of your node:
0 commit comments