iobroker.iot 1.11.9 → 1.12.1
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 +17 -4
- package/admin/actions.js +49 -49
- package/admin/asset-manifest.json +6 -16
- package/admin/index_m.html +1 -1
- package/admin/static/css/main.96b3c861.css +2 -0
- package/admin/static/css/main.96b3c861.css.map +1 -0
- package/admin/static/js/main.30cb625a.js +3 -0
- package/admin/static/js/{2.e9a02d96.chunk.js.LICENSE.txt → main.30cb625a.js.LICENSE.txt} +31 -44
- package/admin/static/js/main.30cb625a.js.map +1 -0
- package/io-package.json +30 -26
- package/lib/alexaCustom.js +384 -135
- package/main.js +30 -0
- package/package.json +7 -7
- package/admin/static/css/2.6ab12a0e.chunk.css +0 -2
- package/admin/static/css/2.6ab12a0e.chunk.css.map +0 -1
- package/admin/static/css/main.e2d673ee.chunk.css +0 -2
- package/admin/static/css/main.e2d673ee.chunk.css.map +0 -1
- package/admin/static/js/2.e9a02d96.chunk.js +0 -3
- package/admin/static/js/2.e9a02d96.chunk.js.map +0 -1
- package/admin/static/js/main.67ccc2e8.chunk.js +0 -2
- package/admin/static/js/main.67ccc2e8.chunk.js.map +0 -1
- package/admin/static/js/runtime-main.0327cad0.js +0 -2
- package/admin/static/js/runtime-main.0327cad0.js.map +0 -1
package/README.md
CHANGED
|
@@ -185,10 +185,14 @@ The adapter will provide the details in two states with different detail level
|
|
|
185
185
|
* **smart.lastCommand** contains the received text including an info on type of query (intent). Example: "askDevice Status Rasenmäher"
|
|
186
186
|
* **smart.lastCommandObj*** contains an JSON string that can be parsed to an object containing the following information
|
|
187
187
|
* **words** contains the received words in an array
|
|
188
|
-
* **intent** contains the type of query. Possible values currently are
|
|
188
|
+
* **intent** contains the type of query. Possible values currently are:
|
|
189
|
+
* v1 Skill: "askDevice", "controlDevice", "actionStart", "actionEnd", "askWhen", "askWhere", "askWho"
|
|
190
|
+
* v2 Skill: "queryIntent" when full said text was captured, "controlDevice" for fallback with only partial text
|
|
189
191
|
* **deviceId** contains a deviceId identifying the device the request was sent to, delivered by Amazon, will be empty string if not provided
|
|
192
|
+
* **deviceRoom** contains a mapped room identifier you can configure in iot admin UI for collected deviceIds
|
|
190
193
|
* **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
|
|
191
194
|
* **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
|
|
195
|
+
* **userName** contains a mapped username you can configure in iot admin UI for collected userIds
|
|
192
196
|
|
|
193
197
|
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 .
|
|
194
198
|
|
|
@@ -199,10 +203,11 @@ If it is a text string then this text will be sent as response to the skill.
|
|
|
199
203
|
if the text is a JSON object then the following keys can be used:
|
|
200
204
|
* **responseText** needs to contain the text to return to Amazon
|
|
201
205
|
* **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.
|
|
206
|
+
* **sessionId** needs to contain the sessionId the response is meaned for. Ideally provide it to allow concurrent sessions. If not provided the first session that expects a response is assumed.
|
|
202
207
|
|
|
203
208
|
**Return result via the message to iot instance**
|
|
204
209
|
|
|
205
|
-
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.
|
|
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** and **sessionId** as described above.
|
|
206
211
|
There will be no response from the iot instance to the message!
|
|
207
212
|
|
|
208
213
|
**Example of a script that uses texts**
|
|
@@ -222,14 +227,15 @@ on({id: 'iot.0.smart.lastCommandObj', ack: true, change: 'any'}, obj => {
|
|
|
222
227
|
const request = JSON.parse(obj.state.val);
|
|
223
228
|
const response = {
|
|
224
229
|
'responseText': 'Received phrase is: ' + request.words.join(' ') + '. Bye',
|
|
225
|
-
'shouldEndSession': true
|
|
230
|
+
'shouldEndSession': true,
|
|
231
|
+
'sessionId': request.sessionId
|
|
226
232
|
};
|
|
227
233
|
|
|
228
234
|
// Return response via state
|
|
229
235
|
setState('iot.0.smart.lastResponse', JSON.stringify(response)); // important, that ack=false (default)
|
|
230
236
|
|
|
231
237
|
// or alternatively return as message
|
|
232
|
-
sendTo('iot.0', response);
|
|
238
|
+
sendTo('iot.0', 'alexaCustomResponse', response);
|
|
233
239
|
});
|
|
234
240
|
```
|
|
235
241
|
|
|
@@ -263,6 +269,13 @@ Following types are supported:
|
|
|
263
269
|
-->
|
|
264
270
|
|
|
265
271
|
## Changelog
|
|
272
|
+
### 1.12.1 (2022-09-27)
|
|
273
|
+
* (bluefox) Corrected error in GUI with empty password
|
|
274
|
+
|
|
275
|
+
### 1.12.0 (2022-09-27)
|
|
276
|
+
* (Apollon77) Do not control saturation with a percentage request via alexa
|
|
277
|
+
* (bluefox) Migrated GUI to v5
|
|
278
|
+
|
|
266
279
|
### 1.11.9 (2022-07-22)
|
|
267
280
|
* (Apollon77) Fix temperature controlling for thermostats via alexa
|
|
268
281
|
|
package/admin/actions.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
function getActions(obj) {
|
|
2
|
-
var type = obj.common.type;
|
|
3
|
-
var actions = null;
|
|
4
|
-
|
|
5
|
-
if (obj.common.write === false) {
|
|
6
|
-
if (obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
|
|
7
|
-
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
|
|
8
|
-
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K' ||
|
|
9
|
-
obj.common.role === 'value.temperature') {
|
|
10
|
-
actions = ['getTemperatureReading'];
|
|
11
|
-
type = '';
|
|
12
|
-
} else {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
} else {
|
|
16
|
-
if (type === 'number') {
|
|
17
|
-
if ((obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
|
|
18
|
-
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
|
|
19
|
-
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K')
|
|
20
|
-
&&
|
|
21
|
-
obj.common.role !== 'level.color.temperature') {
|
|
22
|
-
actions = ['setTargetTemperature', 'incrementTargetTemperature', 'decrementTargetTemperature', 'getTargetTemperature'];
|
|
23
|
-
type = '';
|
|
24
|
-
} else if (obj.common.role === 'level.color.hue') {
|
|
25
|
-
actions = ['setColor', 'turnOn', 'turnOff'];
|
|
26
|
-
} else if (obj.common.role === 'level.color.temperature') {
|
|
27
|
-
actions = ['incrementColorTemperature', 'decrementColorTemperature', 'setColorTemperature'];
|
|
28
|
-
} else {
|
|
29
|
-
actions = ['setPercentage', 'incrementPercentage', 'decrementPercentage', 'turnOn', 'turnOff'];
|
|
30
|
-
}
|
|
31
|
-
} else if (obj.common.role === 'switch.lock') {
|
|
32
|
-
actions = ['setLockState', 'getLockState'];
|
|
33
|
-
type = '';
|
|
34
|
-
} else if (obj.common.role && obj.common.role.match(/^button/)) {
|
|
35
|
-
actions = ['turnOn'];
|
|
36
|
-
type = '';
|
|
37
|
-
} else if (obj.common.role === 'level.color.rgb') {
|
|
38
|
-
actions = ['setColor', 'turnOn', 'turnOff'];
|
|
39
|
-
} else {
|
|
40
|
-
actions = ['turnOn', 'turnOff'];
|
|
41
|
-
type = '';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return {type: type, actions: actions};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (typeof module !== 'undefined' && module.parent) {
|
|
48
|
-
module.exports.getActions = getActions;
|
|
49
|
-
}
|
|
1
|
+
function getActions(obj) {
|
|
2
|
+
var type = obj.common.type;
|
|
3
|
+
var actions = null;
|
|
4
|
+
|
|
5
|
+
if (obj.common.write === false) {
|
|
6
|
+
if (obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
|
|
7
|
+
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
|
|
8
|
+
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K' ||
|
|
9
|
+
obj.common.role === 'value.temperature') {
|
|
10
|
+
actions = ['getTemperatureReading'];
|
|
11
|
+
type = '';
|
|
12
|
+
} else {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
if (type === 'number') {
|
|
17
|
+
if ((obj.common.unit === 'C' || obj.common.unit === 'C°' || obj.common.unit === '°C' ||
|
|
18
|
+
obj.common.unit === 'F' || obj.common.unit === 'F°' || obj.common.unit === '°F' ||
|
|
19
|
+
obj.common.unit === 'K' || obj.common.unit === 'K°' || obj.common.unit === '°K')
|
|
20
|
+
&&
|
|
21
|
+
obj.common.role !== 'level.color.temperature') {
|
|
22
|
+
actions = ['setTargetTemperature', 'incrementTargetTemperature', 'decrementTargetTemperature', 'getTargetTemperature'];
|
|
23
|
+
type = '';
|
|
24
|
+
} else if (obj.common.role === 'level.color.hue' || obj.common.role === 'level.color.saturation') {
|
|
25
|
+
actions = ['setColor', 'turnOn', 'turnOff'];
|
|
26
|
+
} else if (obj.common.role === 'level.color.temperature') {
|
|
27
|
+
actions = ['incrementColorTemperature', 'decrementColorTemperature', 'setColorTemperature'];
|
|
28
|
+
} else {
|
|
29
|
+
actions = ['setPercentage', 'incrementPercentage', 'decrementPercentage', 'turnOn', 'turnOff'];
|
|
30
|
+
}
|
|
31
|
+
} else if (obj.common.role === 'switch.lock') {
|
|
32
|
+
actions = ['setLockState', 'getLockState'];
|
|
33
|
+
type = '';
|
|
34
|
+
} else if (obj.common.role && obj.common.role.match(/^button/)) {
|
|
35
|
+
actions = ['turnOn'];
|
|
36
|
+
type = '';
|
|
37
|
+
} else if (obj.common.role === 'level.color.rgb') {
|
|
38
|
+
actions = ['setColor', 'turnOn', 'turnOff'];
|
|
39
|
+
} else {
|
|
40
|
+
actions = ['turnOn', 'turnOff'];
|
|
41
|
+
type = '';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {type: type, actions: actions};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (typeof module !== 'undefined' && module.parent) {
|
|
48
|
+
module.exports.getActions = getActions;
|
|
49
|
+
}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.css": "./static/css/main.
|
|
4
|
-
"main.js": "./static/js/main.
|
|
5
|
-
"main.js.map": "./static/js/main.67ccc2e8.chunk.js.map",
|
|
6
|
-
"runtime-main.js": "./static/js/runtime-main.0327cad0.js",
|
|
7
|
-
"runtime-main.js.map": "./static/js/runtime-main.0327cad0.js.map",
|
|
8
|
-
"static/css/2.6ab12a0e.chunk.css": "./static/css/2.6ab12a0e.chunk.css",
|
|
9
|
-
"static/js/2.e9a02d96.chunk.js": "./static/js/2.e9a02d96.chunk.js",
|
|
10
|
-
"static/js/2.e9a02d96.chunk.js.map": "./static/js/2.e9a02d96.chunk.js.map",
|
|
3
|
+
"main.css": "./static/css/main.96b3c861.css",
|
|
4
|
+
"main.js": "./static/js/main.30cb625a.js",
|
|
11
5
|
"index.html": "./index.html",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"static/js/2.e9a02d96.chunk.js.LICENSE.txt": "./static/js/2.e9a02d96.chunk.js.LICENSE.txt"
|
|
6
|
+
"main.96b3c861.css.map": "./static/css/main.96b3c861.css.map",
|
|
7
|
+
"main.30cb625a.js.map": "./static/js/main.30cb625a.js.map"
|
|
15
8
|
},
|
|
16
9
|
"entrypoints": [
|
|
17
|
-
"static/
|
|
18
|
-
"static/
|
|
19
|
-
"static/js/2.e9a02d96.chunk.js",
|
|
20
|
-
"static/css/main.e2d673ee.chunk.css",
|
|
21
|
-
"static/js/main.67ccc2e8.chunk.js"
|
|
10
|
+
"static/css/main.96b3c861.css",
|
|
11
|
+
"static/js/main.30cb625a.js"
|
|
22
12
|
]
|
|
23
13
|
}
|
package/admin/index_m.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="./../../lib/js/socket.io.js"></script><title>IoT Settings</title><
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><script type="text/javascript" src="./../../lib/js/socket.io.js"></script><title>IoT Settings</title><script defer="defer" src="./static/js/main.30cb625a.js"></script><link href="./static/css/main.96b3c861.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
body,html{height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0;overflow:hidden;padding:0;width:100%}::-webkit-scrollbar,::-webkit-scrollbar-track{background-color:#ccc}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-thumb{background-color:#575757}#root,.App{height:100%}
|
|
2
|
+
/*# sourceMappingURL=main.96b3c861.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/css/main.96b3c861.css","mappings":"AAGA,UAFE,WAWF,CATA,KAIE,kCAAmC,CACnC,iCAAkC,CAFlC,mIAA8J,CAF9J,QAAS,CAOT,eAAgB,CANhB,SAAU,CAIV,UAGF,CAKA,8CAFE,qBAKF,CAHA,oBACE,SAEF,CACA,0BACE,wBACF,CAMA,WACE,WACF","sources":["index.css"],"sourcesContent":["html {\n height: 100%;\n}\nbody {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n/* scrollbar */\n*::-webkit-scrollbar-track {\n background-color: #ccc;\n}\n*::-webkit-scrollbar {\n width: 6px;\n background-color: #ccc;\n}\n*::-webkit-scrollbar-thumb {\n background-color: #575757;\n}\n\n\n#root {\n height: 100%;\n}\n.App {\n height: 100%;\n}"],"names":[],"sourceRoot":""}
|