iobroker.iot 1.8.24 → 1.8.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,537 +1,540 @@
1
- ![Logo](admin/iot.png)
2
- # ioBroker IoT Adapter
3
-
4
- ![Number of Installations](http://iobroker.live/badges/iot-installed.svg)
5
- ![Number of Installations](http://iobroker.live/badges/iot-stable.svg)
6
- [![NPM version](http://img.shields.io/npm/v/iobroker.iot.svg)](https://www.npmjs.com/package/iobroker.iot)
7
-
8
- ![Test and Release](https://github.com/ioBroker/ioBroker.iot/workflows/Test%20and%20Release/badge.svg)
9
- [![Translation status](https://weblate.iobroker.net/widgets/adapters/-/iot/svg-badge.svg)](https://weblate.iobroker.net/engage/adapters/?utm_source=widget)
10
- [![Downloads](https://img.shields.io/npm/dm/iobroker.iot.svg)](https://www.npmjs.com/package/iobroker.iot)
11
-
12
- This adapter is ONLY for communication with Amazon Alexa, Google Home and Nightscout.
13
- It is not for remote access to your ioBroker instance. Use ioBroker.cloud adapter for that.
14
-
15
- **This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
16
-
17
- ## Settings
18
- To use cloud adapter you should first to register on the ioBroker cloud [https://iobroker.pro](https://iobroker.pro).
19
-
20
- [Reference to google API type settings](https://developers.google.com/actions/smarthome/guides/)
21
-
22
- ![Intro](img/intro.png)
23
-
24
- ### Limits
25
- Everything has a limits, so the Amazon Alexa too. Alexa can support only up to 300 devices.
26
-
27
- Google Cloud and Alisa should be cleared
28
-
29
- ### Language
30
- If you select "default" language the smart names of devices and of enumerations will not be translated. If some language specified all known names will be translated into this language.
31
- It is done to switch fast between many languages for demonstration purposes.
32
-
33
- ### Place function in names first
34
- Change the order of function and roles in self generated names:
35
-
36
- - if false: "Room function", e.g. "Living room dimmer"
37
- - if true: "Function room", e.g. "Dimmer living room"
38
-
39
- ### Concatenate words with
40
- You can define the word which will be placed between function and room. E.g. "in" and from "Dimmer living room" will be "Dimmer in living room".
41
-
42
- But is not suggested doing so, because recognition engine must analyse one more word and it can lead to misunderstandings.
43
-
44
- ### OFF level for switches
45
- Some groups consist of mixed devices: dimmers and switches. It is allowed to control them with "ON" and "OFF" commands and with percents.
46
- If command is `Set to 30%` and the `OFF level is 30%` so the switches will be turned on. By command "Set to 25%" all switches will be turned OFF.
47
-
48
- Additionally, if the command is "OFF", so the adapter will remember the current dimmer level if the actual value is over or equal to the "30%".
49
- Later when the new "ON" command will come the adapter will switch the dimmer not to 100% but to the level in memory.
50
-
51
- Example:
52
-
53
- - Assume, that *OFF level* is 30%.
54
- - Virtual device "Light" has two physical devices: *switch* and *dimmer*.
55
- - Command: "set the light to 40%". The adapter will remember this value for *dimmer*, will set it for "dimmer" and will turn the *switch* ON.
56
- - Command: "turn the light off". The adapter will set the *dimmer* to 0% and will turn off the *switch*.
57
- - Command: "turn on the light". *dimmer* => 40%, *switch* => ON.
58
- - Command: "set the light to 20%". *dimmer* => 20%, *switch* => OFF. The value for dimmer will not be remembered, because it is bellow *OFF level*.
59
- - Command: "turn on the light". *dimmer* => 40%, *switch* => ON.
60
-
61
- ### by ON
62
- You can select the behaviour of ON command will come for the number state. The specific value can be selected or last non zero value will be used.
63
-
64
- ### Write response to
65
- For every command the text response will be generated. You can define here the Object ID , where this text must be written to. E.g. *sayit.0.tts.text*.
66
-
67
- ### Colors
68
- Just now only english alexa supports the color control.
69
- The channel must have 4 states with following roles:
70
-
71
- - level.color.saturation (required for detection of the channel),
72
- - level.color.hue,
73
- - level.dimmer,
74
- - switch (optional)
75
-
76
- ```
77
- Alexa, set the "device name" to "color"
78
- Alexa, turn the light fuchsia
79
- Alexa, set the bedroom light to red
80
- Alexa, change the kitchen to the color chocolate
81
- ```
82
-
83
- ### Lock
84
- To have the possibility to lock the locks, the state must have the role "switch.lock" and have "native.LOCK_VALUE" to determine the lock state. If you need a seperate Value to control the Lock you can use "native.CONTROL VALUE".
85
-
86
- ```
87
- Alexa, is "lock name" locked/unlocked
88
- Alexa, lock the "lock name"
89
- ```
90
-
91
- ## How names will be generated
92
- The adapter tries to generate virtual devices for smart home control (e.g. Amazon Alexa or Google Home).
93
-
94
- There are two important enumerations for that: rooms and functions.
95
-
96
- Rooms are like: living room, bathroom, sleeping room.
97
- Functions are like: light, blind, heating.
98
-
99
- Following conditions must be met to get the state in the automatically generated list:
100
-
101
- - the state must be in some "function" enumeration.
102
- - the state must have role ("state", "switch" or "level.*", e.g. level.dimmer) if not directly included into "functions".
103
- It can be that the channel is in the "functions", but state itself not.
104
- - the state must be writable: `common.write` = true
105
- - the state dimmer must have `common.type` as 'number'
106
- - the state heating must have `common.unit` as '°C', '°F' or '°K' and `common.type` as `number`
107
-
108
- If the state is only in "functions" and not in any "room", the name of state will be used.
109
-
110
- The state names will be generated from function and room. E.g. all *lights* in the *living room* will be collected in the virtual device *living room light*.
111
- The user cannot change this name, because it is generated automatically.
112
- But if the enumeration name changes, this name will be changed too. (e.g. function "light" changed to "lights", so the *living room light* will be changed to *living room lights*)
113
-
114
- All the rules will be ignored if the state has common.smartName. In this case just the smart name will be used.
115
-
116
- if *common.smartName* is **false**, the state or enumeration will not be included into the list generation.
117
-
118
- The configuration dialog lets the comfortable remove and add the single states to virtual groups or as single device.
119
- ![Configuration](img/configuration.png)
120
-
121
- If the group has only one state it can be renamed, as for this the state's smartName will be used.
122
- If the group has more than one state, the group must be renamed via the enumeration's names.
123
-
124
- To create own groups the user can install "scenes" adapter or create "script" in Javascript adapter.
125
-
126
- ### Replaces
127
- You can specify strings, that could be automatically replaced in the devices names. E.g. if you set replaces to:
128
- `.STATE,.LEVEL`, so all ".STATE" and ".LEVEL" will be deleted from names. Be careful with spaces.
129
- If you set `.STATE, .LEVEL`, so ".STATE" and " .LEVEL" will be replaced and not ".LEVEL".
130
-
131
- ## Helper states
132
- - **smart.lastObjectID**: This state will be set if only one device was controlled by home skill (alexa, google home).
133
- - **smart.lastFunction**: Function name (if exists) for which last command was executed.
134
- - **smart.lastRoom**: Room name (if exists) for which last command was executed.
135
- - **smart.lastCommand**: Last executed command. Command can be: true(ON), false(OFF), number(%), -X(decrease at x), +X(increase at X)
136
- - **smart.lastResponse**: Textual response on command. It can be sent to some text2speech (sayit) engine.
137
-
138
- ## IFTTT
139
- [instructions](doc/ifttt.md)
140
-
141
- ## Google Home
142
- If you see following error message in the log: `[GHOME] Invalid URL Pro key. Status auto-update is disabled you can set states but receive states only manually`.
143
- So you must generate the URL-Key anew:
144
-
145
- ![Url key](img/url_key.png)
146
-
147
- ## Services
148
- There is a possibility to send messages to cloud adapter.
149
- If you call `[POST]https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>` und value as payload.
150
-
151
- `curl --data "myString" https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>`
152
-
153
- or
154
-
155
- `[GET]https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>&data=myString`
156
-
157
- If you set in the settings the field "White list for services" the name *custom_test*, and call with "custom_test" as the service name, the state **cloud.0.services.custom_test** will be set to *myString*.
158
-
159
- You may write "*" in white list and all services will be allowed.
160
-
161
- Here you can find instructions how to use it with [tasker](doc/tasker.md).
162
-
163
- IFTTT service is allowed only if IFTTT key is set.
164
-
165
- Reserved names are `ifttt`, `text2command`, `simpleApi`, `swagger`. These must be used without the `custom_` prefix.
166
-
167
- ### `text2command`
168
- You may write "text2command" in white list, you can send POST request to `https://service.iobroker.in/v1/iotService?service=text2command&key=<user-app-key>&user=<USER_EMAIL>` to write data into *text2command.X.text* variable.
169
-
170
- You can use GET method too `https://service.iobroker.in/v1/iotService?service=text2command&key=<user-app-key>&user=<USER_EMAIL>&data=<MY COMMAND>`
171
-
172
- `X` can be defined in settings by the "Use text2command instance" option.
173
-
174
- ## Custom skill
175
- The answers for custom skill can be processed in two ways:
176
- - `text2command`
177
- - `javascript`
178
-
179
- ### `text2command`
180
- if `text2command` instance is defined in the configuration dialog, so the question will be sent to the instance.
181
-
182
- `text2command` must be configured that the expected phrase will be parsed and the answer will be given back.
183
-
184
- ### `Javascript`
185
- There is a possibility to process the question directly with script. It is activated by default if no *text2command* instance is selected.
186
-
187
- If `text2command` instance is defined, so this instance must provide the answer and the answer from *script* will be ignored.
188
-
189
- The adapter will provide the details in two states with different detail level
190
- * **smart.lastCommand** contains the received text including an info on type of query (intent). Example: "askDevice Status Rasenmäher"
191
- * **smart.lastCommandObj*** contains an JSON string that can be parsed to an object containing the following information
192
- * **words** contains the received words in an array
193
- * **intent** contains the type of query. Possible values currently are "askDevice", "controlDevice", "actionStart", "actionEnd", "askWhen", "askWhere", "askWho"
194
- * **deviceId** contains a deviceId identifying the device the request was sent to, delivered by Amazon, will be empty string if not provided
195
- * **sessionId** contains a sessionId of the Skill session, should be the same if multiple commands were spoken, delivered by Amazon, will be empty string if not provided
196
- * **userId** contains a userId from the device owner (or maybe later the user that was interacting with the skill), delivered by Amazon, will be empty string if not provided
197
-
198
- More details on how the words are detected and what type of queries the Alexa Custom Skill differentiates please check https://forum.iobroker.net/viewtopic.php?f=37&t=17452 .
199
-
200
- **Return result via smart.lastResponse state**
201
-
202
- The response needs to be sent within 200ms in the state "smart.lastResponse" and can be a simple text string or a JSON object.
203
- If it is a text string then this text will be sent as response to the skill.
204
- if the text is a JSON object then the following keys can be used:
205
- * **responseText** needs to contain the text to return to Amazon
206
- * **shouldEndSession** is a boolean and controls if the session will be closed after the response was spoken or stays open to accept another voice input.
207
-
208
- **Return result via the message to iot instance**
209
-
210
- The iot instance also accepts a message with the name "alexaCustomResponse" containing the key "response" with an object that can contain the keys **responseText** and **shouldEndSession** as described above.
211
- There will be no response from the iot instance to the message!
212
-
213
- **Example of a script that uses texts**
214
- ```
215
- // important, that ack=true
216
- on({id: 'iot.0.smart.lastCommand', ack: true, change: 'any'}, obj => {
217
- // you have 200ms to prepare the answer and to write it into iot.X.smart.lastResponse
218
- setState('iot.0.smart.lastResponse', 'Received phrase is: ' + obj.state.val); // important, that ack=false (default)
219
- });
220
- ```
221
-
222
- **Example of a script that uses JSON objects**
223
- ```
224
- // important, that ack=true
225
- on({id: 'iot.0.smart.lastCommandObj', ack: true, change: 'any'}, obj => {
226
- // you have 200ms to prepare the answer and to write it into iot.X.smart.lastResponse
227
- const request = JSON.parse(obj.state.val);
228
- const response = {
229
- 'responseText': 'Received phrase is: ' + request.words.join(' ') + '. Bye',
230
- 'shouldEndSession': true
231
- };
232
-
233
- // Return response via state
234
- setState('iot.0.smart.lastResponse', JSON.stringify(response)); // important, that ack=false (default)
235
-
236
- // or alternatively return as message
237
- sendTo('iot.0', response);
238
- });
239
- ```
240
-
241
-
242
- ### Private cloud
243
- If you use private skill/action/навык for communication with `Alexa/Google Home/Алиса` so you have the possibility to use IoT instance to process the requests from it.
244
-
245
- E.g. for `yandex alice`:
246
-
247
- ```
248
- const OBJECT_FROM_ALISA_SERVICE = {}; // object from alisa service or empty object
249
- OBJECT_FROM_ALISA_SERVICE.alisa = '/path/v1.0/user/devices'; // called URL, 'path' could be any text, but it must be there
250
- sendTo('iot.0', 'private', {type: 'alisa', request: OBJECT_FROM_ALISA_SERVICE}, response => {
251
- // Send this response back to alisa service
252
- console.log(JSON.stringify(response));
253
- });
254
- ```
255
-
256
- Following types are supported:
257
- - `alexa` - acting with Amazon Alexa or Amazon Custom Skill
258
- - `ghome` - acting with Google Actions via Google Home
259
- - `alisa` - acting with Yandex Алиса
260
- - `ifttt` - acting like IFTTT (actually not required, but for tests purposes)
261
-
262
- ## Yandex Алиса
263
- [instructions](doc/alisa.md)
264
-
265
- <!--
266
- Placeholder for the next version (at the beginning of the line):
267
- ### __WORK IN PROGRESS__
268
- -->
269
-
1
+ ![Logo](admin/iot.png)
2
+ # ioBroker IoT Adapter
3
+
4
+ ![Number of Installations](http://iobroker.live/badges/iot-installed.svg)
5
+ ![Number of Installations](http://iobroker.live/badges/iot-stable.svg)
6
+ [![NPM version](http://img.shields.io/npm/v/iobroker.iot.svg)](https://www.npmjs.com/package/iobroker.iot)
7
+
8
+ ![Test and Release](https://github.com/ioBroker/ioBroker.iot/workflows/Test%20and%20Release/badge.svg)
9
+ [![Translation status](https://weblate.iobroker.net/widgets/adapters/-/iot/svg-badge.svg)](https://weblate.iobroker.net/engage/adapters/?utm_source=widget)
10
+ [![Downloads](https://img.shields.io/npm/dm/iobroker.iot.svg)](https://www.npmjs.com/package/iobroker.iot)
11
+
12
+ This adapter is ONLY for communication with Amazon Alexa, Google Home and Nightscout.
13
+ It is not for remote access to your ioBroker instance. Use ioBroker.cloud adapter for that.
14
+
15
+ **This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
16
+
17
+ ## Settings
18
+ To use cloud adapter you should first to register on the ioBroker cloud [https://iobroker.pro](https://iobroker.pro).
19
+
20
+ [Reference to google API type settings](https://developers.google.com/actions/smarthome/guides/)
21
+
22
+ ![Intro](img/intro.png)
23
+
24
+ ### Limits
25
+ Everything has a limits, so the Amazon Alexa too. Alexa can support only up to 300 devices.
26
+
27
+ Google Cloud and Alisa should be cleared
28
+
29
+ ### Language
30
+ If you select "default" language the smart names of devices and of enumerations will not be translated. If some language specified all known names will be translated into this language.
31
+ It is done to switch fast between many languages for demonstration purposes.
32
+
33
+ ### Place function in names first
34
+ Change the order of function and roles in self generated names:
35
+
36
+ - if false: "Room function", e.g. "Living room dimmer"
37
+ - if true: "Function room", e.g. "Dimmer living room"
38
+
39
+ ### Concatenate words with
40
+ You can define the word which will be placed between function and room. E.g. "in" and from "Dimmer living room" will be "Dimmer in living room".
41
+
42
+ But is not suggested doing so, because recognition engine must analyse one more word and it can lead to misunderstandings.
43
+
44
+ ### OFF level for switches
45
+ Some groups consist of mixed devices: dimmers and switches. It is allowed to control them with "ON" and "OFF" commands and with percents.
46
+ If command is `Set to 30%` and the `OFF level is 30%` so the switches will be turned on. By command "Set to 25%" all switches will be turned OFF.
47
+
48
+ Additionally, if the command is "OFF", so the adapter will remember the current dimmer level if the actual value is over or equal to the "30%".
49
+ Later when the new "ON" command will come the adapter will switch the dimmer not to 100% but to the level in memory.
50
+
51
+ Example:
52
+
53
+ - Assume, that *OFF level* is 30%.
54
+ - Virtual device "Light" has two physical devices: *switch* and *dimmer*.
55
+ - Command: "set the light to 40%". The adapter will remember this value for *dimmer*, will set it for "dimmer" and will turn the *switch* ON.
56
+ - Command: "turn the light off". The adapter will set the *dimmer* to 0% and will turn off the *switch*.
57
+ - Command: "turn on the light". *dimmer* => 40%, *switch* => ON.
58
+ - Command: "set the light to 20%". *dimmer* => 20%, *switch* => OFF. The value for dimmer will not be remembered, because it is bellow *OFF level*.
59
+ - Command: "turn on the light". *dimmer* => 40%, *switch* => ON.
60
+
61
+ ### by ON
62
+ You can select the behaviour of ON command will come for the number state. The specific value can be selected or last non zero value will be used.
63
+
64
+ ### Write response to
65
+ For every command the text response will be generated. You can define here the Object ID , where this text must be written to. E.g. *sayit.0.tts.text*.
66
+
67
+ ### Colors
68
+ Just now only english alexa supports the color control.
69
+ The channel must have 4 states with following roles:
70
+
71
+ - level.color.saturation (required for detection of the channel),
72
+ - level.color.hue,
73
+ - level.dimmer,
74
+ - switch (optional)
75
+
76
+ ```
77
+ Alexa, set the "device name" to "color"
78
+ Alexa, turn the light fuchsia
79
+ Alexa, set the bedroom light to red
80
+ Alexa, change the kitchen to the color chocolate
81
+ ```
82
+
83
+ ### Lock
84
+ To have the possibility to lock the locks, the state must have the role "switch.lock" and have "native.LOCK_VALUE" to determine the lock state. If you need a seperate Value to control the Lock you can use "native.CONTROL VALUE".
85
+
86
+ ```
87
+ Alexa, is "lock name" locked/unlocked
88
+ Alexa, lock the "lock name"
89
+ ```
90
+
91
+ ## How names will be generated
92
+ The adapter tries to generate virtual devices for smart home control (e.g. Amazon Alexa or Google Home).
93
+
94
+ There are two important enumerations for that: rooms and functions.
95
+
96
+ Rooms are like: living room, bathroom, sleeping room.
97
+ Functions are like: light, blind, heating.
98
+
99
+ Following conditions must be met to get the state in the automatically generated list:
100
+
101
+ - the state must be in some "function" enumeration.
102
+ - the state must have role ("state", "switch" or "level.*", e.g. level.dimmer) if not directly included into "functions".
103
+ It can be that the channel is in the "functions", but state itself not.
104
+ - the state must be writable: `common.write` = true
105
+ - the state dimmer must have `common.type` as 'number'
106
+ - the state heating must have `common.unit` as '°C', '°F' or '°K' and `common.type` as `number`
107
+
108
+ If the state is only in "functions" and not in any "room", the name of state will be used.
109
+
110
+ The state names will be generated from function and room. E.g. all *lights* in the *living room* will be collected in the virtual device *living room light*.
111
+ The user cannot change this name, because it is generated automatically.
112
+ But if the enumeration name changes, this name will be changed too. (e.g. function "light" changed to "lights", so the *living room light* will be changed to *living room lights*)
113
+
114
+ All the rules will be ignored if the state has common.smartName. In this case just the smart name will be used.
115
+
116
+ if *common.smartName* is **false**, the state or enumeration will not be included into the list generation.
117
+
118
+ The configuration dialog lets the comfortable remove and add the single states to virtual groups or as single device.
119
+ ![Configuration](img/configuration.png)
120
+
121
+ If the group has only one state it can be renamed, as for this the state's smartName will be used.
122
+ If the group has more than one state, the group must be renamed via the enumeration's names.
123
+
124
+ To create own groups the user can install "scenes" adapter or create "script" in Javascript adapter.
125
+
126
+ ### Replaces
127
+ You can specify strings, that could be automatically replaced in the devices names. E.g. if you set replaces to:
128
+ `.STATE,.LEVEL`, so all ".STATE" and ".LEVEL" will be deleted from names. Be careful with spaces.
129
+ If you set `.STATE, .LEVEL`, so ".STATE" and " .LEVEL" will be replaced and not ".LEVEL".
130
+
131
+ ## Helper states
132
+ - **smart.lastObjectID**: This state will be set if only one device was controlled by home skill (alexa, google home).
133
+ - **smart.lastFunction**: Function name (if exists) for which last command was executed.
134
+ - **smart.lastRoom**: Room name (if exists) for which last command was executed.
135
+ - **smart.lastCommand**: Last executed command. Command can be: true(ON), false(OFF), number(%), -X(decrease at x), +X(increase at X)
136
+ - **smart.lastResponse**: Textual response on command. It can be sent to some text2speech (sayit) engine.
137
+
138
+ ## IFTTT
139
+ [instructions](doc/ifttt.md)
140
+
141
+ ## Google Home
142
+ If you see following error message in the log: `[GHOME] Invalid URL Pro key. Status auto-update is disabled you can set states but receive states only manually`.
143
+ So you must generate the URL-Key anew:
144
+
145
+ ![Url key](img/url_key.png)
146
+
147
+ ## Services
148
+ There is a possibility to send messages to cloud adapter.
149
+ If you call `[POST]https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>` und value as payload.
150
+
151
+ `curl --data "myString" https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>`
152
+
153
+ or
154
+
155
+ `[GET]https://service.iobroker.in/v1/iotService?service=custom_<NAME>&key=<XXX>&user=<USER_EMAIL>&data=myString`
156
+
157
+ If you set in the settings the field "White list for services" the name *custom_test*, and call with "custom_test" as the service name, the state **cloud.0.services.custom_test** will be set to *myString*.
158
+
159
+ You may write "*" in white list and all services will be allowed.
160
+
161
+ Here you can find instructions how to use it with [tasker](doc/tasker.md).
162
+
163
+ IFTTT service is allowed only if IFTTT key is set.
164
+
165
+ Reserved names are `ifttt`, `text2command`, `simpleApi`, `swagger`. These must be used without the `custom_` prefix.
166
+
167
+ ### `text2command`
168
+ You may write "text2command" in white list, you can send POST request to `https://service.iobroker.in/v1/iotService?service=text2command&key=<user-app-key>&user=<USER_EMAIL>` to write data into *text2command.X.text* variable.
169
+
170
+ You can use GET method too `https://service.iobroker.in/v1/iotService?service=text2command&key=<user-app-key>&user=<USER_EMAIL>&data=<MY COMMAND>`
171
+
172
+ `X` can be defined in settings by the "Use text2command instance" option.
173
+
174
+ ## Custom skill
175
+ The answers for custom skill can be processed in two ways:
176
+ - `text2command`
177
+ - `javascript`
178
+
179
+ ### `text2command`
180
+ if `text2command` instance is defined in the configuration dialog, so the question will be sent to the instance.
181
+
182
+ `text2command` must be configured that the expected phrase will be parsed and the answer will be given back.
183
+
184
+ ### `Javascript`
185
+ There is a possibility to process the question directly with script. It is activated by default if no *text2command* instance is selected.
186
+
187
+ If `text2command` instance is defined, so this instance must provide the answer and the answer from *script* will be ignored.
188
+
189
+ The adapter will provide the details in two states with different detail level
190
+ * **smart.lastCommand** contains the received text including an info on type of query (intent). Example: "askDevice Status Rasenmäher"
191
+ * **smart.lastCommandObj*** contains an JSON string that can be parsed to an object containing the following information
192
+ * **words** contains the received words in an array
193
+ * **intent** contains the type of query. Possible values currently are "askDevice", "controlDevice", "actionStart", "actionEnd", "askWhen", "askWhere", "askWho"
194
+ * **deviceId** contains a deviceId identifying the device the request was sent to, delivered by Amazon, will be empty string if not provided
195
+ * **sessionId** contains a sessionId of the Skill session, should be the same if multiple commands were spoken, delivered by Amazon, will be empty string if not provided
196
+ * **userId** contains a userId from the device owner (or maybe later the user that was interacting with the skill), delivered by Amazon, will be empty string if not provided
197
+
198
+ More details on how the words are detected and what type of queries the Alexa Custom Skill differentiates please check https://forum.iobroker.net/viewtopic.php?f=37&t=17452 .
199
+
200
+ **Return result via smart.lastResponse state**
201
+
202
+ The response needs to be sent within 200ms in the state "smart.lastResponse" and can be a simple text string or a JSON object.
203
+ If it is a text string then this text will be sent as response to the skill.
204
+ if the text is a JSON object then the following keys can be used:
205
+ * **responseText** needs to contain the text to return to Amazon
206
+ * **shouldEndSession** is a boolean and controls if the session will be closed after the response was spoken or stays open to accept another voice input.
207
+
208
+ **Return result via the message to iot instance**
209
+
210
+ The iot instance also accepts a message with the name "alexaCustomResponse" containing the key "response" with an object that can contain the keys **responseText** and **shouldEndSession** as described above.
211
+ There will be no response from the iot instance to the message!
212
+
213
+ **Example of a script that uses texts**
214
+ ```
215
+ // important, that ack=true
216
+ on({id: 'iot.0.smart.lastCommand', ack: true, change: 'any'}, obj => {
217
+ // you have 200ms to prepare the answer and to write it into iot.X.smart.lastResponse
218
+ setState('iot.0.smart.lastResponse', 'Received phrase is: ' + obj.state.val); // important, that ack=false (default)
219
+ });
220
+ ```
221
+
222
+ **Example of a script that uses JSON objects**
223
+ ```
224
+ // important, that ack=true
225
+ on({id: 'iot.0.smart.lastCommandObj', ack: true, change: 'any'}, obj => {
226
+ // you have 200ms to prepare the answer and to write it into iot.X.smart.lastResponse
227
+ const request = JSON.parse(obj.state.val);
228
+ const response = {
229
+ 'responseText': 'Received phrase is: ' + request.words.join(' ') + '. Bye',
230
+ 'shouldEndSession': true
231
+ };
232
+
233
+ // Return response via state
234
+ setState('iot.0.smart.lastResponse', JSON.stringify(response)); // important, that ack=false (default)
235
+
236
+ // or alternatively return as message
237
+ sendTo('iot.0', response);
238
+ });
239
+ ```
240
+
241
+
242
+ ### Private cloud
243
+ If you use private skill/action/навык for communication with `Alexa/Google Home/Алиса` so you have the possibility to use IoT instance to process the requests from it.
244
+
245
+ E.g. for `yandex alice`:
246
+
247
+ ```
248
+ const OBJECT_FROM_ALISA_SERVICE = {}; // object from alisa service or empty object
249
+ OBJECT_FROM_ALISA_SERVICE.alisa = '/path/v1.0/user/devices'; // called URL, 'path' could be any text, but it must be there
250
+ sendTo('iot.0', 'private', {type: 'alisa', request: OBJECT_FROM_ALISA_SERVICE}, response => {
251
+ // Send this response back to alisa service
252
+ console.log(JSON.stringify(response));
253
+ });
254
+ ```
255
+
256
+ Following types are supported:
257
+ - `alexa` - acting with Amazon Alexa or Amazon Custom Skill
258
+ - `ghome` - acting with Google Actions via Google Home
259
+ - `alisa` - acting with Yandex Алиса
260
+ - `ifttt` - acting like IFTTT (actually not required, but for tests purposes)
261
+
262
+ ## Yandex Алиса
263
+ [instructions](doc/alisa.md)
264
+
265
+ <!--
266
+ Placeholder for the next version (at the beginning of the line):
267
+ ### __WORK IN PROGRESS__
268
+ -->
269
+
270
270
  ## Changelog
271
- ### 1.8.24 (2021-09-19)
271
+ ### 1.8.25 (2021-11-18)
272
+ * (bluefox) Corrected the enabling of the category
273
+
274
+ ### 1.8.24 (2021-09-19)
272
275
  * (bluefox) Respect the min/max limits by controlling
273
276
 
274
- ### 1.8.23 (2021-09-18)
277
+ ### 1.8.23 (2021-09-18)
275
278
  * (bluefox) Fixed the response for the heating control
276
279
 
277
- ### 1.8.22 (2021-05-16)
280
+ ### 1.8.22 (2021-05-16)
278
281
  * (bluefox) Make it admin4 compatible
279
282
 
280
- ### 1.8.21 (2021-05-16)
283
+ ### 1.8.21 (2021-05-16)
281
284
  * (bluefox) Fixed the encryption of the password. Warning: if you see the message in the log, that password is invalid, please enter the password in configuration dialog one more time and save.
282
285
 
283
- ### 1.8.20 (2021-05-16)
286
+ ### 1.8.20 (2021-05-16)
284
287
  * (foxriver76) we now write data received from custom services with acknowledge flag
285
288
 
286
- ### 1.8.19 (2021-05-14)
289
+ ### 1.8.19 (2021-05-14)
287
290
  * (bluefox) Only added one debug output
288
291
 
289
- ### 1.8.16 (2021-03-13)
292
+ ### 1.8.16 (2021-03-13)
290
293
  * (bluefox) fixed the blind functionality in alisa
291
294
 
292
- ### 1.8.15 (2021-03-12)
295
+ ### 1.8.15 (2021-03-12)
293
296
  * (bluefox) implemented the sensor functionality in alisa
294
297
 
295
- ### 1.8.14 (2021-03-12)
298
+ ### 1.8.14 (2021-03-12)
296
299
  * (bluefox) allowed the control of the blinds in alisa
297
300
 
298
- ### 1.8.13 (2021-02-04)
301
+ ### 1.8.13 (2021-02-04)
299
302
  * (Apollon77) add missing object smart.lastObjectID
300
303
 
301
- ### 1.8.12 (2021-02-02)
304
+ ### 1.8.12 (2021-02-02)
302
305
  * (bluefox) Fixed the dimmer issue with alisa.
303
306
 
304
- ### 1.8.11 (2021-01-20)
307
+ ### 1.8.11 (2021-01-20)
305
308
  * (Morluktom) Alexa - Corrected the request for percentage values
306
309
 
307
- ### 1.8.10 (2021-01-20)
310
+ ### 1.8.10 (2021-01-20)
308
311
  * (bluefox) Added the reconnection strategy if DNS address cannot be resolved
309
312
 
310
- ### 1.8.9 (2020-12-27)
313
+ ### 1.8.9 (2020-12-27)
311
314
  * (bluefox) Updated configuration GUI to the latest state
312
315
 
313
- ### 1.8.8 (2020-12-14)
316
+ ### 1.8.8 (2020-12-14)
314
317
  * (bluefox) Corrected the "google home" error
315
318
 
316
- ### 1.8.6 (2020-12-13)
319
+ ### 1.8.6 (2020-12-13)
317
320
  * (bluefox) Try to fix google home error
318
321
 
319
- ### 1.8.5 (2020-11-23)
322
+ ### 1.8.5 (2020-11-23)
320
323
  * (bluefox) Corrected the configuration table for google home
321
324
 
322
- ### 1.8.4 (2020-11-18)
325
+ ### 1.8.4 (2020-11-18)
323
326
  * (bluefox) Corrected the configuration table for google home
324
327
 
325
- ### 1.8.3 (2020-11-16)
328
+ ### 1.8.3 (2020-11-16)
326
329
  * (bluefox) Trying to fix the set to false at start for google home
327
330
 
328
- ### 1.8.2 (2020-11-15)
331
+ ### 1.8.2 (2020-11-15)
329
332
  * (bluefox) Added the debug outputs for google home
330
333
 
331
- ### 1.8.1 (2020-11-13)
334
+ ### 1.8.1 (2020-11-13)
332
335
  * (bluefox) The deletion of google home devices was corrected
333
336
 
334
- ### 1.8.0 (2020-11-12)
337
+ ### 1.8.0 (2020-11-12)
335
338
  * (bluefox) The google home table was rewritten
336
339
 
337
- ### 1.7.15 (2020-11-05)
340
+ ### 1.7.15 (2020-11-05)
338
341
  * (Morluktom) Corrected the request for temperature
339
342
 
340
- ### 1.7.14 (2020-11-05)
343
+ ### 1.7.14 (2020-11-05)
341
344
  * (bluefox) Updated the select ID dialog.
342
345
 
343
- ### 1.7.12 (2020-09-25)
346
+ ### 1.7.12 (2020-09-25)
344
347
  * (bluefox) Updated the select ID dialog.
345
348
 
346
- ### 1.7.9 (2020-09-17)
349
+ ### 1.7.9 (2020-09-17)
347
350
  * (bluefox) Updated GUI for config.
348
351
 
349
- ### 1.7.7 (2020-09-02)
352
+ ### 1.7.7 (2020-09-02)
350
353
  * (bluefox) Added information about changed linking process.
351
354
 
352
- ### 1.7.6 (2020-08-25)
355
+ ### 1.7.6 (2020-08-25)
353
356
  * (bluefox) Some colors were changed in the dark mode.
354
357
 
355
- ### 1.7.5 (2020-08-21)
356
- * (Apollon77) Crash prevented (Sentry IOBROKER-IOT-W)
358
+ ### 1.7.5 (2020-08-21)
359
+ * (Apollon77) Crash prevented (Sentry IOBROKER-IOT-W)
357
360
  * (bluefox) Values for modes will be converted to number in Alisa
358
361
 
359
- ### 1.7.3 (2020-08-16)
362
+ ### 1.7.3 (2020-08-16)
360
363
  * (bluefox) Added vacuum cleaner to Alisa
361
364
 
362
- ### 1.7.1 (2020-08-16)
365
+ ### 1.7.1 (2020-08-16)
363
366
  * (bluefox) Added blinds, lock and thermostat to Alisa
364
367
 
365
- ### 1.6.4 (2020-08-06)
368
+ ### 1.6.4 (2020-08-06)
366
369
  * (Apollon77) crash prevented (Sentry IOBROKER-IOT-V)
367
370
 
368
- ### 1.6.3 (2020-08-04)
371
+ ### 1.6.3 (2020-08-04)
369
372
  * (bluefox) Added french letters to allowed symbols
370
373
 
371
- ### 1.6.1 (2020-07-10)
374
+ ### 1.6.1 (2020-07-10)
372
375
  * (bluefox) Used new SelectID Dialog in GUI
373
376
 
374
- ### 1.5.3 (2020-05-28)
377
+ ### 1.5.3 (2020-05-28)
375
378
  * (bluefox) Small change for nightscout
376
379
 
377
- ### 1.5.2 (2020-05-21)
378
- * (bluefox) Changed requirements for password
380
+ ### 1.5.2 (2020-05-21)
381
+ * (bluefox) Changed requirements for password
379
382
  * (bluefox) Do not try load the "sharp" if blood sugar not enabled
380
383
 
381
- ### 1.4.18 (2020-05-11)
382
- * (Apollon77) Make sure that invalid configured states or values without a timestamp do not crash adapter (Sentry IOBROKER-IOT-8)
384
+ ### 1.4.18 (2020-05-11)
385
+ * (Apollon77) Make sure that invalid configured states or values without a timestamp do not crash adapter (Sentry IOBROKER-IOT-8)
383
386
  * (Apollon77) Make sure publishes after the disconnect to not break adapter (Sentry IOBROKER-IOT-A)
384
387
 
385
- ### 1.4.17 (2020-05-11)
388
+ ### 1.4.17 (2020-05-11)
386
389
  * (bluefox) Better error output is implemented
387
390
 
388
- ### 1.4.14 (2020-05-01)
391
+ ### 1.4.14 (2020-05-01)
389
392
  * (bluefox) Fixed the problem if admin is not on 8081 port
390
393
 
391
- ### 1.4.12 (2020-04-30)
394
+ ### 1.4.12 (2020-04-30)
392
395
  * (Apollon77) error case handled where system.config objects does not exist (Sentry IOBROKER-IOT-5)
393
396
 
394
- ### 1.4.11 (2020-04-26)
397
+ ### 1.4.11 (2020-04-26)
395
398
  * (bluefox) fixed IOBROKER-IOT-REACT-F
396
399
 
397
- ### 1.4.10 (2020-04-24)
400
+ ### 1.4.10 (2020-04-24)
398
401
  * (bluefox) Fixed crashes reported by sentry
399
402
 
400
- ### 1.4.7 (2020-04-23)
401
- * fix iot crash when timeouts in communications to Google happens (Sentry IOBROKER-IOT-2)
403
+ ### 1.4.7 (2020-04-23)
404
+ * fix iot crash when timeouts in communications to Google happens (Sentry IOBROKER-IOT-2)
402
405
  * fix iot crash when google answers without customData (Sentry IOBROKER-IOT-1)
403
406
 
404
- ### 1.4.6 (2020-04-18)
407
+ ### 1.4.6 (2020-04-18)
405
408
  * (Apollon77) Add the Sentry error reporting to `React Frontend`
406
409
 
407
- ### 1.4.4 (2020-04-14)
408
- * (Apollon77) remove js-controller 3.0 warnings and replace `adapter.objects` access
409
- * (Apollon77) add linux dependencies for canvas library
410
+ ### 1.4.4 (2020-04-14)
411
+ * (Apollon77) remove js-controller 3.0 warnings and replace `adapter.objects` access
412
+ * (Apollon77) add linux dependencies for canvas library
410
413
  * (Apollon77) add sentry configuration
411
414
 
412
- ### 1.4.2 (2020-04-08)
415
+ ### 1.4.2 (2020-04-08)
413
416
  * (TA2k) Fix updateState for Google Home
414
417
 
415
- ### 1.4.1 (2020-04-04)
418
+ ### 1.4.1 (2020-04-04)
416
419
  * (bluefox) The blood glucose request supported now
417
420
 
418
- ### 1.3.4 (2020-02-26)
421
+ ### 1.3.4 (2020-02-26)
419
422
  * (TA2k) Fixed deconz issues in Google Home
420
423
 
421
- ### 1.3.3 (2020-02-12)
424
+ ### 1.3.3 (2020-02-12)
422
425
  * (Apollon77) fix alisa error with invalid smartName attributes
423
426
 
424
- ### 1.3.2 (2020-02-10)
427
+ ### 1.3.2 (2020-02-10)
425
428
  * (Apollon77) usage with all kinds of admin ports and reverse proxies optimized
426
429
 
427
- ### 1.3.1 (2020-02-09)
428
- * (Apollon77) Dependency updates
430
+ ### 1.3.1 (2020-02-09)
431
+ * (Apollon77) Dependency updates
429
432
  * (Apollon77) Make compatible with Admin > 4.0 because of updated socket.io
430
433
 
431
- ### 1.2.1 (2020-01-18)
434
+ ### 1.2.1 (2020-01-18)
432
435
  * (bluefox) Fixed problem if the port of admin is not 8081
433
436
 
434
- ### 1.2.0 (2020-01-04)
437
+ ### 1.2.0 (2020-01-04)
435
438
  * (TA2k) Google Home handling and visualization improved.
436
439
 
437
- ### 1.1.10 (2020-01-03)
438
- * (bluefox) Now is allowed to select the temperature values as alexa states
440
+ ### 1.1.10 (2020-01-03)
441
+ * (bluefox) Now is allowed to select the temperature values as alexa states
439
442
  * (bluefox) Allowed the setting type immediately after insertion of new state
440
443
 
441
- ### 1.1.9 (2019-11-27)
444
+ ### 1.1.9 (2019-11-27)
442
445
  * (bluefox) Fixed: sometimes the configuration could not be loaded
443
446
 
444
- ### 1.1.8 (2019-09-12)
447
+ ### 1.1.8 (2019-09-12)
445
448
  * (bluefox) Optimization of google home communication was done
446
449
 
447
- ### 1.1.7 (2019-09-11)
450
+ ### 1.1.7 (2019-09-11)
448
451
  * (bluefox) The sending rate to google home is limited now
449
452
 
450
- ### 1.1.6 (2019-09-11)
453
+ ### 1.1.6 (2019-09-11)
451
454
  * (TA2k) Room fix for Google Home and LinkedDevices
452
455
 
453
- ### 1.1.4 (2019-09-10)
456
+ ### 1.1.4 (2019-09-10)
454
457
  * (bluefox) decreased keepalive value to fix issue with disconnect
455
458
 
456
- ### 1.1.3 (2019-09-09)
459
+ ### 1.1.3 (2019-09-09)
457
460
  * (TA2k) Google Home problem fixed with LinkedDevices
458
461
 
459
- ### 1.1.0 (2019-09-06)
462
+ ### 1.1.0 (2019-09-06)
460
463
  * (bluefox) Added support of aliases
461
464
 
462
- ### 1.0.8 (2019-09-03)
463
- * (TA2k) Improved support for Google Home
464
- * (TA2k) Added auto detection for RGB, RGBSingle, Hue, CT, MediaDevice, Switch, Info, Socket, Light, Dimmer, Thermostat, WindowTilt, Blinds, Slider
465
- * (TA2k) Added support for manually adding states as devices
466
- * (TA2k) Fix update state after Sync
467
- * (TA2k) Added typical Google Home devices and traits/actions
465
+ ### 1.0.8 (2019-09-03)
466
+ * (TA2k) Improved support for Google Home
467
+ * (TA2k) Added auto detection for RGB, RGBSingle, Hue, CT, MediaDevice, Switch, Info, Socket, Light, Dimmer, Thermostat, WindowTilt, Blinds, Slider
468
+ * (TA2k) Added support for manually adding states as devices
469
+ * (TA2k) Fix update state after Sync
470
+ * (TA2k) Added typical Google Home devices and traits/actions
468
471
  * (TA2k) Fix only process update message when Alexa is checked in the options
469
472
 
470
- ### 1.0.4 (2019-08-01)
473
+ ### 1.0.4 (2019-08-01)
471
474
  * (bluefox) Fixed password encoding. Please enter password anew!
472
475
 
473
- ### 1.0.3 (2019-07-30)
476
+ ### 1.0.3 (2019-07-30)
474
477
  * (bluefox) Fixed language issues for google home and yandex alice
475
478
 
476
- ### 1.0.1 (2019-07-26)
479
+ ### 1.0.1 (2019-07-26)
477
480
  * (bluefox) Support of private skills/actions was added.
478
481
 
479
- ### 1.0.0 (2019-07-14)
482
+ ### 1.0.0 (2019-07-14)
480
483
  * (TA2k) Google Home list was added
481
484
 
482
- ### 0.5.0 (2019-06-29)
485
+ ### 0.5.0 (2019-06-29)
483
486
  * (bluefox) tried to add yandex Alisa
484
487
 
485
- ### 0.4.3 (2019-04-14)
488
+ ### 0.4.3 (2019-04-14)
486
489
  * (Apollon77) Change enable/disable of Amazon Alexa and of Google Home from configuration to be really "active if selected".
487
490
 
488
- ### 0.4.2 (2019-03-10)
491
+ ### 0.4.2 (2019-03-10)
489
492
  * (bluefox) Allowed the enablement and disable of Amazon Alexa and of Google Home from configuration.
490
493
 
491
- ### 0.4.1 (2019-02-19)
494
+ ### 0.4.1 (2019-02-19)
492
495
  * (bluefox) Add version check to google home
493
496
 
494
- ### 0.3.1 (2019-01-13)
497
+ ### 0.3.1 (2019-01-13)
495
498
  * (bluefox) Blockly was fixed
496
499
 
497
- ### 0.3.0 (2018-12-30)
500
+ ### 0.3.0 (2018-12-30)
498
501
  * (bluefox) Detection of google devices was fixed
499
502
 
500
- ### 0.2.2 (2018-12-21)
503
+ ### 0.2.2 (2018-12-21)
501
504
  * (bluefox) Generation of new URL key was added
502
505
 
503
- ### 0.2.0 (2018-12-18)
506
+ ### 0.2.0 (2018-12-18)
504
507
  * (bluefox) Change the name of adapter
505
508
 
506
- ### 0.1.8 (2018-10-21)
509
+ ### 0.1.8 (2018-10-21)
507
510
  * (bluefox) Added extended diagnostics
508
511
 
509
- ### 0.1.7 (2018-10-14)
510
- * (bluefox) The configuration dialog was corrected
512
+ ### 0.1.7 (2018-10-14)
513
+ * (bluefox) The configuration dialog was corrected
511
514
  * (bluefox) The possibility to create the answer with script for the custom skill was implemented.
512
515
 
513
- ### 0.1.4 (2018-09-26)
516
+ ### 0.1.4 (2018-09-26)
514
517
  * (bluefox) Initial commit
515
518
 
516
- ## License
517
- The MIT License (MIT)
518
-
519
- Copyright (c) 2018-2021 bluefox <dogafox@gmail.com>
520
-
521
- Permission is hereby granted, free of charge, to any person obtaining a copy
522
- of this software and associated documentation files (the "Software"), to deal
523
- in the Software without restriction, including without limitation the rights
524
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
525
- copies of the Software, and to permit persons to whom the Software is
526
- furnished to do so, subject to the following conditions:
527
-
528
- The above copyright notice and this permission notice shall be included in all
529
- copies or substantial portions of the Software.
530
-
531
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
532
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
533
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
534
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
535
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
536
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
537
- SOFTWARE.
519
+ ## License
520
+ The MIT License (MIT)
521
+
522
+ Copyright (c) 2018-2021 bluefox <dogafox@gmail.com>
523
+
524
+ Permission is hereby granted, free of charge, to any person obtaining a copy
525
+ of this software and associated documentation files (the "Software"), to deal
526
+ in the Software without restriction, including without limitation the rights
527
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
528
+ copies of the Software, and to permit persons to whom the Software is
529
+ furnished to do so, subject to the following conditions:
530
+
531
+ The above copyright notice and this permission notice shall be included in all
532
+ copies or substantial portions of the Software.
533
+
534
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
535
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
536
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
537
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
538
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
539
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
540
+ SOFTWARE.