Skip to content

Instantly share code, notes, and snippets.

@sktaylortrash
Created September 14, 2018 02:04
Show Gist options
  • Save sktaylortrash/12eb048dbfb78f36640b90cf37d692e7 to your computer and use it in GitHub Desktop.
Save sktaylortrash/12eb048dbfb78f36640b90cf37d692e7 to your computer and use it in GitHub Desktop.
node-red-contrib-alexa-local - flow for light fixture with multiple MQTT enabled bulbs
[
{
"id": "9967fb32.25ef58",
"type": "alexa-local",
"z": "59dbd5ec.6f955c",
"devicename": "Fan Bulb 1",
"inputtrigger": false,
"x": 110,
"y": 2180,
"wires": [
[
"4c8e2d04.65e994",
"d3bfac4c.dc46f"
]
]
},
{
"id": "a432e831.4233d8",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 1 On/Off",
"topic": "light/LivingRoom/fanwest/216773570733998247/switch",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 950,
"y": 2140,
"wires": []
},
{
"id": "7f898d11.152fa4",
"type": "alexa-local",
"z": "59dbd5ec.6f955c",
"devicename": "Living Room",
"inputtrigger": false,
"x": 110,
"y": 2440,
"wires": [
[
"edfca7bd.b83de8",
"d3bfac4c.dc46f"
]
]
},
{
"id": "3deddd32.0b1b32",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 2 On/Off",
"topic": "light/LivingRoom/faneast/216773570733869505/switch",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 950,
"y": 2280,
"wires": []
},
{
"id": "4c8e2d04.65e994",
"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": 2180,
"wires": [
[
"9b1b7516.118f88"
],
[
"2c65fcbd.cd7944"
]
]
},
{
"id": "1aa21404.18112c",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 1 Brightness",
"topic": "light/LivingRoom/fanwest/216773570733998247/brightness/set",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 960,
"y": 2200,
"wires": []
},
{
"id": "edfca7bd.b83de8",
"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": 2440,
"wires": [
[
"84d550d5.cf974"
],
[
"4f55e6dc.cb7c28"
]
]
},
{
"id": "4f55e6dc.cb7c28",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "Set Bright",
"func": "msg.payload = msg.bri\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 520,
"y": 2460,
"wires": [
[
"9be2ddd0.4d76",
"c726def4.6ac2d",
"1aa21404.18112c"
]
]
},
{
"id": "9be2ddd0.4d76",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 2 Brightness",
"topic": "light/LivingRoom/faneast/216773570733869505/brightness/set",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 960,
"y": 2340,
"wires": []
},
{
"id": "c726def4.6ac2d",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 3 Brightness",
"topic": "light/LivingRoom/fannorth/216773570733998518/brightness/set",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 960,
"y": 2580,
"wires": []
},
{
"id": "649d2cab.6f9554",
"type": "mqtt out",
"z": "59dbd5ec.6f955c",
"name": "Fan Bulb 3 On/Off",
"topic": "light/LivingRoom/fannorth/216773570733998518/switch",
"qos": "0",
"retain": "false",
"broker": "79ae0f24.e78a8",
"x": 950,
"y": 2520,
"wires": []
},
{
"id": "84d550d5.cf974",
"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": 2420,
"wires": [
[
"d51f88ba.bd15b8"
],
[
"251dc9b6.3abf16"
]
]
},
{
"id": "d51f88ba.bd15b8",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "1",
"func": "msg.payload = \"1\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2400,
"wires": [
[
"649d2cab.6f9554",
"3deddd32.0b1b32",
"a432e831.4233d8"
]
]
},
{
"id": "251dc9b6.3abf16",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "0",
"func": "msg.payload = \"0\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2440,
"wires": [
[
"649d2cab.6f9554",
"3deddd32.0b1b32",
"a432e831.4233d8"
]
]
},
{
"id": "2c65fcbd.cd7944",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "Set Bright",
"func": "msg.payload = msg.bri\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 520,
"y": 2200,
"wires": [
[
"1aa21404.18112c"
]
]
},
{
"id": "9b1b7516.118f88",
"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": 2160,
"wires": [
[
"3f5abc5b.5d6ac4"
],
[
"4ee92093.7d20b"
]
]
},
{
"id": "3f5abc5b.5d6ac4",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "1",
"func": "msg.payload = \"1\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2140,
"wires": [
[
"a432e831.4233d8"
]
]
},
{
"id": "4ee92093.7d20b",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "0",
"func": "msg.payload = \"0\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2180,
"wires": [
[
"a432e831.4233d8"
]
]
},
{
"id": "7ff324dd.6dd63c",
"type": "alexa-local",
"z": "59dbd5ec.6f955c",
"devicename": "Fan Bulb 2",
"inputtrigger": false,
"x": 111.25,
"y": 2315,
"wires": [
[
"e2f85f.663fe7a",
"d3bfac4c.dc46f"
]
]
},
{
"id": "e2f85f.663fe7a",
"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": 341.25,
"y": 2315,
"wires": [
[
"d33e7c5e.ca186"
],
[
"5239f03.aa6e31"
]
]
},
{
"id": "5239f03.aa6e31",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "Set Bright",
"func": "msg.payload = msg.bri\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 521.25,
"y": 2335,
"wires": [
[
"9be2ddd0.4d76"
]
]
},
{
"id": "d33e7c5e.ca186",
"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": 511.25,
"y": 2295,
"wires": [
[
"62456f08.6d258"
],
[
"a8c8e541.27bdb8"
]
]
},
{
"id": "62456f08.6d258",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "1",
"func": "msg.payload = \"1\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 651.25,
"y": 2275,
"wires": [
[
"3deddd32.0b1b32"
]
]
},
{
"id": "a8c8e541.27bdb8",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "0",
"func": "msg.payload = \"0\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 651.25,
"y": 2315,
"wires": [
[
"3deddd32.0b1b32"
]
]
},
{
"id": "5669885f.6b5638",
"type": "alexa-local",
"z": "59dbd5ec.6f955c",
"devicename": "Fan Bulb 3",
"inputtrigger": false,
"x": 110,
"y": 2560,
"wires": [
[
"943d2fdc.f5592",
"d3bfac4c.dc46f"
]
]
},
{
"id": "943d2fdc.f5592",
"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": 2560,
"wires": [
[
"50fe0bcf.ab98b4"
],
[
"5f8127e9.51df98"
]
]
},
{
"id": "5f8127e9.51df98",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "Set Bright",
"func": "msg.payload = msg.bri\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 520,
"y": 2580,
"wires": [
[
"c726def4.6ac2d"
]
]
},
{
"id": "50fe0bcf.ab98b4",
"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": 2540,
"wires": [
[
"eb2785d4.d91768"
],
[
"a4df2f4e.cf285"
]
]
},
{
"id": "eb2785d4.d91768",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "1",
"func": "msg.payload = \"1\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2520,
"wires": [
[
"649d2cab.6f9554"
]
]
},
{
"id": "a4df2f4e.cf285",
"type": "function",
"z": "59dbd5ec.6f955c",
"name": "0",
"func": "msg.payload = \"0\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 650,
"y": 2560,
"wires": [
[
"649d2cab.6f9554"
]
]
},
{
"id": "d3bfac4c.dc46f",
"type": "debug",
"z": "59dbd5ec.6f955c",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 310,
"y": 2240,
"wires": []
},
{
"id": "79ae0f24.e78a8",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "15",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment