change the node that reflect the assignment between the device and the domoticz IDX (will find mine inside)
Code: Select all
[
{
"id": "31fcbdb0.fb01f2",
"type": "alexa-home-resp",
"z": "11a271e9.04566e",
"x": 690,
"y": 210,
"wires": []
},
{
"id": "3643162d.05518a",
"type": "http request",
"z": "11a271e9.04566e",
"name": "dz HTTP API",
"method": "GET",
"ret": "obj",
"paytoqs": false,
"url": "",
"tls": "",
"proxy": "",
"x": 688.9998321533203,
"y": 151.00006198883057,
"wires": [
[
"d0fec16.5378c4"
]
]
},
{
"id": "d0fec16.5378c4",
"type": "function",
"z": "11a271e9.04566e",
"name": "create extra info key",
"func": "var tDev = msg.payload.result[0].Temp;\n\nvar msg = {};\nmsg.extra = {\n \"temperatureReading\": {\n \"value\": tDev\n },\n \"applianceResponseTimestamp\": new Date().toISOString()\n};\n\nmsg.complete = true ;\nreturn msg; \n",
"outputs": 1,
"noerr": 0,
"x": 909.9998931884766,
"y": 151.00002574920654,
"wires": [
[
"4110b038.fde5a"
]
]
},
{
"id": "bf5a3308.6e4ef",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "36663",
"acknoledge": false,
"name": "",
"topic": "",
"x": 118.0000638961792,
"y": 141.00002574920654,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
},
{
"id": "e255d6a0.1e4b98",
"type": "join",
"z": "11a271e9.04566e",
"name": "join",
"mode": "custom",
"build": "merged",
"property": "",
"propertyType": "full",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 316.0692882537842,
"y": 209.28129291534424,
"wires": [
[
"a2164003.04d81"
]
]
},
{
"id": "4110b038.fde5a",
"type": "delay",
"z": "11a271e9.04566e",
"name": "",
"pauseType": "delay",
"timeout": "50",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1120.0694427490234,
"y": 151.59035205841064,
"wires": [
[
"e255d6a0.1e4b98"
]
]
},
{
"id": "a2164003.04d81",
"type": "function",
"z": "11a271e9.04566e",
"name": "fix payload key",
"func": "delete msg.payload;\nmsg.payload = true;\nreturn msg; \n",
"outputs": 1,
"noerr": 0,
"x": 480.0172805786133,
"y": 210.0105104446411,
"wires": [
[
"31fcbdb0.fb01f2"
]
]
},
{
"id": "3b861c2.7a083e4",
"type": "function",
"z": "11a271e9.04566e",
"name": "convert Alexa Name ==> Domoticz IDX",
"func": "var lnkUrl = \"http://127.0.0.1:8080/json.htm?type=devices&rid=\" ;\nvar reqRoom = msg.name;\n\n// JSON Links Device Name to Domoticz IDX\nvar map = {\n \"Cucina\" : 7,\n \"Sala\" : 17,\n \"Camera\" : 323,\n \"Cameretta\" : 297,\n \"Bagnetto\" : 6,\n\"Cabina Armadio\" : 1947\n}\n\nvar msg = {};\nmsg.url = lnkUrl + map[reqRoom];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 409.80870819091797,
"y": 152.25370502471924,
"wires": [
[
"3643162d.05518a"
]
]
},
{
"id": "a3b2f58.2081508",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "36724",
"acknoledge": false,
"name": "",
"topic": "",
"x": 118.01741313934326,
"y": 98.00007820129395,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
},
{
"id": "705fc4f4.48bd7c",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "36725",
"acknoledge": false,
"name": "",
"topic": "",
"x": 117.01741313934326,
"y": 181.00007343292236,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
},
{
"id": "5f3b1c4b.605a64",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "36726",
"acknoledge": false,
"name": "",
"topic": "",
"x": 118.0173978805542,
"y": 224.00012874603271,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
},
{
"id": "c32a6fd8.da171",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "36728",
"acknoledge": false,
"name": "",
"topic": "",
"x": 117.01738262176514,
"y": 266.00009059906006,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
},
{
"id": "f841f0c8.a958d",
"type": "comment",
"z": "11a271e9.04566e",
"name": "TEMPERATURE",
"info": "",
"x": 181.07643127441406,
"y": 51.7327184677124,
"wires": []
},
{
"id": "d4d8f7df.921188",
"type": "alexa-home",
"z": "11a271e9.04566e",
"conf": "",
"device": "49385",
"acknoledge": false,
"name": "",
"topic": "",
"x": 81.91392517089844,
"y": 314.7294874191284,
"wires": [
[
"e255d6a0.1e4b98",
"3b861c2.7a083e4"
]
]
}
]