Skip to content

Instantly share code, notes, and snippets.

@sktaylortrash
Last active September 14, 2018 02:46
Show Gist options
  • Save sktaylortrash/69a06b712f6e70f5207b3c3a4d72871b to your computer and use it in GitHub Desktop.
Save sktaylortrash/69a06b712f6e70f5207b3c3a4d72871b to your computer and use it in GitHub Desktop.
node-red-contrib-alexa-local - flow for Deconz Rest-API to control single ZigBee bulb
[
{
"id": "4263eef2.287a9",
"type": "alexa-local",
"z": "59dbd5ec.6f955c",
"devicename": "Dimmer1",
"inputtrigger": false,
"x": 100,
"y": 2680,
"wires": [
[
"5a576081.8086e"
]
]
},
{
"id": "5a576081.8086e",
"type": "switch",
"z": "59dbd5ec.6f955c",
"name": "On/Off or Dim",
"property": "on_off_command",
"propertyType": "msg",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 340,
"y": 2680,
"wires": [
[
"d5d62ac3.f35458"
],
[
"cf889a23.69b308"
]
]
},
{
"id": "cf889a23.69b308",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "Set Bright",
"func": "msg.payload = msg.bri\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 520,
"y": 2720,
"wires": [
[
"a755ceba.78ab6"
]
]
},
{
"id": "d5d62ac3.f35458",
"type": "switch",
"z": "59dbd5ec.6f955c",
"name": "on/off",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 510,
"y": 2660,
"wires": [
[
"b6c76627.ed9bd8"
],
[
"d434bc8.ba7484"
]
]
},
{
"id": "d7c3f992.1ecf08",
"type": "http request",
"z": "59dbd5ec.6f955c",
"name": "",
"method": "PUT",
"ret": "obj",
"url": "http://deconz.local/api/<apikey>/lights/[ID#]/state",
"tls": "",
"x": 1050,
"y": 2680,
"wires": [
[]
]
},
{
"id": "b6c76627.ed9bd8",
"type": "change",
"z": "59dbd5ec.6f955c",
"name": "On",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"on\":true}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 2640,
"wires": [
[
"d7c3f992.1ecf08"
]
]
},
{
"id": "d434bc8.ba7484",
"type": "change",
"z": "59dbd5ec.6f955c",
"name": "Off",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"on\":false}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 2680,
"wires": [
[
"d7c3f992.1ecf08"
]
]
},
{
"id": "a755ceba.78ab6",
"type": "range",
"z": "59dbd5ec.6f955c",
"minin": "1",
"maxin": "100",
"minout": "1",
"maxout": "254",
"action": "scale",
"round": true,
"property": "payload",
"name": "",
"x": 680,
"y": 2720,
"wires": [
[
"7bf5bf38.8e291"
]
]
},
{
"id": "7bf5bf38.8e291",
"type": "change",
"z": "59dbd5ec.6f955c",
"name": "Bright",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"bri\": msg.payload,\t \"transitiontime\": 1\t\t}",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 830,
"y": 2720,
"wires": [
[
"d7c3f992.1ecf08"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment