[ { "id": "a8cfc909a9101b28", "type": "subflow", "name": "OFF Timer", "info": "", "category": "", "in": [ { "x": 460, "y": 240, "wires": [ { "id": "3c96982a96ae3d0f" } ] } ], "out": [ { "x": 1240, "y": 440, "wires": [ { "id": "f8df8ba9de638dd5", "port": 0 } ] } ], "env": [], "meta": {}, "color": "#DDAA99", "status": { "x": 880, "y": 240, "wires": [ { "id": "61955960e4fc8b00", "port": 0 } ] } }, { "id": "4d409bc7deea5dcb", "type": "time-range-switch", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "", "lat": "43.20775", "lon": "-123.32381", "startTime": "sunset", "endTime": "22:00", "startOffset": 0, "endOffset": 0, "x": 700, "y": 380, "wires": [ [ "ed49a0978939f161" ], [ "b194c02180d17b65" ] ] }, { "id": "d3b20ec2690f90f6", "type": "time-range-switch", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "", "lat": "43.2078", "lon": "-123.32372", "startTime": "sunrise", "endTime": "sunset", "startOffset": 0, "endOffset": 0, "x": 700, "y": 320, "wires": [ [ "4784bac1fcc221c4" ], [ "4d409bc7deea5dcb" ] ] }, { "id": "b194c02180d17b65", "type": "time-range-switch", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "", "lat": "43.20775", "lon": "-123.32381", "startTime": "22:00", "endTime": "sunrise", "startOffset": 0, "endOffset": 0, "x": 700, "y": 440, "wires": [ [ "3c8588597cf15e58" ], [] ] }, { "id": "3c8588597cf15e58", "type": "trigger", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "30 seconds", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "5", "extend": true, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 930, "y": 440, "wires": [ [ "f8df8ba9de638dd5" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "ed49a0978939f161", "type": "trigger", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "1 Minute", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "1", "extend": true, "overrideDelay": false, "units": "min", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 920, "y": 380, "wires": [ [ "f8df8ba9de638dd5" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "4784bac1fcc221c4", "type": "trigger", "z": "a8cfc909a9101b28", "g": "41beea965a271f13", "name": "3 Minutes", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "3", "extend": true, "overrideDelay": false, "units": "min", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 920, "y": 320, "wires": [ [ "f8df8ba9de638dd5" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "61955960e4fc8b00", "type": "status", "z": "a8cfc909a9101b28", "name": "", "scope": [ "3c8588597cf15e58", "ed49a0978939f161", "4784bac1fcc221c4" ], "x": 720, "y": 240, "wires": [ [] ] }, { "id": "313c0097.f1216", "type": "subflow", "name": "HUE - Motion Sensor Event Filter", "info": "", "category": "", "in": [ { "x": 380, "y": 280, "wires": [ { "id": "f00de543.b72668" } ] } ], "out": [ { "x": 960, "y": 200, "wires": [ { "id": "6bf15156.15b6f", "port": 0 } ] }, { "x": 960, "y": 280, "wires": [ { "id": "6bf15156.15b6f", "port": 0 }, { "id": "26f8a17a.e1b86e", "port": 0 } ] }, { "x": 960, "y": 360, "wires": [ { "id": "26f8a17a.e1b86e", "port": 0 } ] } ], "env": [], "meta": {}, "color": "#DDAA99" }, { "id": "f00de543.b72668", "type": "switch", "z": "313c0097.f1216", "name": "payload.data.0.motion.motion", "property": "payload.data.0.motion.motion", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 570, "y": 280, "wires": [ [ "6bf15156.15b6f" ], [ "26f8a17a.e1b86e" ] ] }, { "id": "6bf15156.15b6f", "type": "change", "z": "313c0097.f1216", "name": "true", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 830, "y": 240, "wires": [ [] ] }, { "id": "26f8a17a.e1b86e", "type": "change", "z": "313c0097.f1216", "name": "false", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 830, "y": 320, "wires": [ [] ] }, { "id": "94e24bce.4cf888", "type": "comment", "z": "313c0097.f1216", "name": "PLEASE READ - DOUBLE CLICK", "info": "Output 1:\nWill send just an **true** when Motion is detected\n\nOutput 2:\nWill send an **true** when Motion is detected and a **false** if no motion is detected any longer.\n\nOutput 3:\nWill send just an **false** when no Motion is detected any longer.\n\n\n-----------------------\nAll outputs are boolean\n-----------------------\n\nMost easy Subflow, but convinient when lots of sensors need to be set up.", "x": 580, "y": 240, "wires": [] }, { "id": "3c1e2a8e.9361c6", "type": "comment", "z": "313c0097.f1216", "name": "motion true", "info": "", "x": 1060, "y": 200, "wires": [] }, { "id": "dad8bfd3.3e71d", "type": "comment", "z": "313c0097.f1216", "name": "motion false", "info": "", "x": 1070, "y": 360, "wires": [] }, { "id": "ed505a4f.d8e6d8", "type": "comment", "z": "313c0097.f1216", "name": "motion true / false", "info": "", "x": 1090, "y": 280, "wires": [] }, { "id": "cd5687adb333d888", "type": "tab", "label": "Alexa Voice Processing Example", "disabled": false, "info": "", "env": [] }, { "id": "04769e5cd35a789c", "type": "group", "z": "cd5687adb333d888", "style": { "stroke": "#000000", "label": true, "fill": "#addb7b", "color": "#000000" }, "nodes": [ "ef6b06eca6038b52", "1ed007b2fd735bf6", "fd525332da638479", "4a7875744c781fe5", "9ccf2702d0a8b701", "3e3ec0784db780a5", "102781df86bd5a9a", "32c8180bfbb28326", "34f6dff134c91428", "3fb27c74082951a2", "0238212af3aba964", "1d702465610ec397", "54a2bd49814de949", "7f4b04b4e7702391", "7c6d54c01522ac20", "54c687c796511e0a", "03e2a881a05bca0b", "ed2462e15a7b76cb", "307b80a8bdf24795", "93e75d4f6f31da64", "603456298483ab2a", "087d81d98a6788d0", "0983a5a7d39e65bb", "4c04fc201d29d292", "186e26c1efec0885", "bb682a0c1b1491ed", "af17466c864cfc09", "a8eeb6fd4cf542ec", "7d3c83ef2d32535e", "8c709af79cc086a8", "cc214ad3317a8b0e", "82f5dc0dc2c7320b", "08d51ac523277ba3", "c2cb44f7ae15e65e" ], "x": 214, "y": 179, "w": 1532, "h": 602 }, { "id": "387fb6e77b9549eb", "type": "group", "z": "cd5687adb333d888", "name": "Bedroom", "style": { "stroke": "#000000", "fill": "#bfdbef", "label": true, "color": "#000000" }, "nodes": [ "3f3ad2b054ba0202", "d3b4ab8d61e438ca", "ba11790ea5bea946", "9beb192cd38b3004", "27cf708389081da3", "3eb351a188124036", "0c0f248764915f39", "b17e92701797d280", "9b66569b4c38e010", "a43261c41586a230", "e3c657844dcc7977", "2ca1e07d68b3b69c", "908613faf658b87e", "5bba50de832eb74f", "67e3e55b6d74def1", "d9767d730b92793e", "77cd857c5bf2b8e4", "eafd127e1b5d328f", "5ddf2dcd670e072d", "3d210aa4fb826714", "f189ae1814bb79a5", "87b9d3ce2d460522", "1754d0b863d2dc98", "02c995cab585bf21", "5f8734b22e0c9d1f", "fdb598d58b782f18", "b5a68a9f085c24ec", "c78b3d04075117a6", "1928bf5553d570b1", "7c946c5dc293b1d2", "e66dcdca916529de", "07730d5cc425e4a3", "d9fd9d376bbbf5e0", "d92ffca3f2efda66", "54e351f6a3fab2e8", "33734ca0077eb7ac", "ee061045daba1036", "03c9334bdb5b4abd", "e58c87e34f8fda22", "41f27d9395861ca5" ], "x": 184, "y": 839, "w": 2402, "h": 362 }, { "id": "01eeda210db6be28", "type": "group", "z": "cd5687adb333d888", "style": { "stroke": "#999999", "stroke-opacity": "1", "fill": "none", "fill-opacity": "1", "label": true, "label-position": "nw", "color": "#a4a4a4" }, "nodes": [ "1848b703b54340c5", "17d3adb838a09810", "f313d8f8057ff482", "f142bb079213071e", "6f6c5c8715c6d5b2", "9b5e3ed1da1b70aa", "fcf2637afeb8389a", "d39251db0c575c10", "7cc6e862ccb9bf92", "d6ac29d39602af51", "480b758ce62a6185", "5fd24e176d4f032c" ], "x": 194, "y": 1259, "w": 852, "h": 242 }, { "id": "5b0d716b4004aaf6", "type": "group", "z": "cd5687adb333d888", "style": { "stroke": "#000000", "fill": "#bfdbef", "label": true, "color": "#000000" }, "nodes": [ "79d773bf3198f1da", "03c07ae51f111993", "f895c7e1471d341f", "926683504769e452" ], "x": 194, "y": 1539, "w": 812, "h": 142 }, { "id": "d2a5c41371748949", "type": "group", "z": "cd5687adb333d888", "name": "", "style": { "stroke": "#000000", "fill": "#bfdbef", "label": true, "color": "#000000" }, "nodes": [ "c59bb2926f18e489", "62f7ca5829e8d390", "acbb5622844abeb0", "b35690eaf78a2642", "6a37e52b7942b10f", "3336c6c0ea2f64f6", "490428798745bbf1" ], "x": 194, "y": 1739, "w": 852, "h": 142 }, { "id": "744b9148968e869e", "type": "group", "z": "cd5687adb333d888", "name": "Off timer node to call off timer subflow", "style": { "label": true }, "nodes": [ "6a030fb5f22d5206", "6582fb38d451cacc" ], "x": 1854, "y": 1259, "w": 372, "h": 122 }, { "id": "ed9855414848e72c", "type": "group", "z": "cd5687adb333d888", "name": "Off Timer Subflow", "style": { "stroke": "#000000", "fill": "#bfdbef", "label": true, "color": "#000000" }, "nodes": [ "b757f4b62a2906dc", "e3cc5ff39a439de0", "e4dbf8bbc847954f", "d0667a4400529dfd", "bcf02e5f439d8db2", "5e94f4a258e944df", "7e084fd415761e54", "570aee869428e1de", "026d9ae7c9e4ddb9" ], "x": 1174, "y": 1254, "w": 612, "h": 267 }, { "id": "4a7875744c781fe5", "type": "junction", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "x": 460, "y": 440, "wires": [ [ "fd525332da638479", "1ed007b2fd735bf6" ] ] }, { "id": "087d81d98a6788d0", "type": "junction", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "x": 1440, "y": 300, "wires": [ [ "102781df86bd5a9a" ] ] }, { "id": "cc214ad3317a8b0e", "type": "junction", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "x": 1220, "y": 300, "wires": [ [ "4c04fc201d29d292" ] ] }, { "id": "1928bf5553d570b1", "type": "junction", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "x": 1740, "y": 920, "wires": [ [ "d3b4ab8d61e438ca" ] ] }, { "id": "7c946c5dc293b1d2", "type": "junction", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "x": 1020, "y": 920, "wires": [ [ "1928bf5553d570b1" ] ] }, { "id": "e66dcdca916529de", "type": "junction", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "x": 960, "y": 1000, "wires": [ [ "27cf708389081da3", "a43261c41586a230", "7c946c5dc293b1d2" ] ] }, { "id": "7e084fd415761e54", "type": "junction", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "x": 1760, "y": 1480, "wires": [ [] ] }, { "id": "570aee869428e1de", "type": "junction", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "x": 1200, "y": 1280, "wires": [ [ "e3cc5ff39a439de0" ] ] }, { "id": "7cc6e862ccb9bf92", "type": "junction", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "x": 220, "y": 1380, "wires": [ [ "1848b703b54340c5" ] ] }, { "id": "d6ac29d39602af51", "type": "junction", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "x": 820, "y": 1300, "wires": [ [] ] }, { "id": "480b758ce62a6185", "type": "junction", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "x": 820, "y": 1380, "wires": [ [] ] }, { "id": "5fd24e176d4f032c", "type": "junction", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "x": 820, "y": 1460, "wires": [ [] ] }, { "id": "ef6b06eca6038b52", "type": "alexa-remote-event", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "", "account": "", "event": "ws-device-activity", "x": 330, "y": 440, "wires": [ [ "4a7875744c781fe5" ] ] }, { "id": "1ed007b2fd735bf6", "type": "change", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "set payload from summary", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.description.summary", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 620, "y": 520, "wires": [ [ "9ccf2702d0a8b701" ] ] }, { "id": "fd525332da638479", "type": "change", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "alexa", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 580, "y": 360, "wires": [ [ "0983a5a7d39e65bb" ] ] }, { "id": "9ccf2702d0a8b701", "type": "ecolect", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Local Voice Commands for Lighting", "topics": [ { "name": "lights", "phrases": "turn {state} the {item} for {number} {units}\nturn {state} the {item} in the {area} for {number} {units}\nturn {state} the {item} in the {area}\n{action} {item}\n{item} {state}\nturn {state} the {area} {item} for {number} {units}\nturn {state} the {area} {item} \nturn {state} the {item} in the {area}\nturn {state} the {item} in the {area} for {number} {units}\nadd {number} more {units} to {area} {item}\nadd {number} more {units} to {item}\nadd {number} more {units}\nturn {state} the {item}\nturn the {item} {state}", "values": [ { "name": "item", "type": "enumeration", "enumerations": [ "lights", "light" ] }, { "name": "units", "type": "enumeration", "enumerations": [ "seconds", "minutes", "hours", "\"\"" ] }, { "name": "state", "type": "enumeration", "enumerations": [ "on", "true", "off", "false" ] }, { "name": "number", "type": "enumeration", "enumerations": [ "\"\"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "ninteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thrity-four", "thrity-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "fourty", "fourty-one", "fourty-two", "fourty-three", "fourty-four", "fourty-five", "fourty-six", "fourty-seven", "fourty-eight", "fourty-nine", "fifty", "fifty-one", "fifty-two", "fifty-three", "fifty-four", "fifty-five", "fifty-six", "fifty-seven", "fifty-eight", "fifty-nine", "sixty", "sixty-one", "sixty-two", "sixty-three", "sixty-four", "sixty-five", "sixty-six", "sixty-seven", "sixty-eight", "sixty-nine", "seventy", "seventy-one", "seventy-two", "seventy-three", "seventy-four", "seventy-five", "seventy-six", "seventy-seven", "seventy-eight", "seventy-nine", "eighty", "eighty-one", "eighty-two", "eighty-three", "eighty-four", "eighty-five", "eighty-six", "eighty-seven", "eighty-eight", "eighty-nine", "ninty", "ninty-one", "ninty-two", "ninty-three", "ninty-four", "ninty-five", "ninty-six", "ninty-seven", "ninty-eight", "ninty-nine", "one-hundred" ] }, { "name": "area", "type": "enumeration", "enumerations": [ "\"\"", "bathroom", "bedroom", "dining room", "entryway", "family room", "garage", "guest room", "hallway", "kitchen", "laundry room", "living room", "master bathroom", "master bath", "office", "outside" ] }, { "name": "action", "type": "enumeration", "enumerations": [ "disable", "enable", "activate", "deactivate", "change" ] } ] } ], "outputs": 2, "x": 1020, "y": 520, "wires": [ [ "3e3ec0784db780a5", "0983a5a7d39e65bb" ], [] ] }, { "id": "3e3ec0784db780a5", "type": "switch", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Room/Area", "property": "values.area", "propertyType": "msg", "rules": [ { "t": "eq", "v": "bathroom", "vt": "str" }, { "t": "eq", "v": "bedroom", "vt": "str" }, { "t": "eq", "v": "dining room", "vt": "str" }, { "t": "eq", "v": "entryway", "vt": "str" }, { "t": "eq", "v": "family room", "vt": "str" }, { "t": "eq", "v": "garage", "vt": "str" }, { "t": "eq", "v": "guest room", "vt": "str" }, { "t": "eq", "v": "hallway", "vt": "str" }, { "t": "eq", "v": "kitchen", "vt": "str" }, { "t": "eq", "v": "laundry", "vt": "str" }, { "t": "eq", "v": "living room", "vt": "str" }, { "t": "eq", "v": "master bath", "vt": "str" }, { "t": "eq", "v": "office", "vt": "str" }, { "t": "eq", "v": "outside", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 14, "x": 1350, "y": 480, "wires": [ [ "087d81d98a6788d0", "93e75d4f6f31da64" ], [ "087d81d98a6788d0", "0238212af3aba964" ], [ "087d81d98a6788d0", "603456298483ab2a" ], [ "087d81d98a6788d0", "32c8180bfbb28326" ], [ "087d81d98a6788d0", "7f4b04b4e7702391" ], [ "087d81d98a6788d0", "1d702465610ec397" ], [ "087d81d98a6788d0", "7c6d54c01522ac20" ], [ "087d81d98a6788d0", "54a2bd49814de949" ], [ "087d81d98a6788d0", "54c687c796511e0a" ], [ "087d81d98a6788d0", "34f6dff134c91428" ], [ "087d81d98a6788d0", "03e2a881a05bca0b" ], [ "087d81d98a6788d0", "ed2462e15a7b76cb" ], [ "087d81d98a6788d0", "3fb27c74082951a2" ], [ "087d81d98a6788d0", "307b80a8bdf24795" ] ], "outputLabels": [ "Bathroom", "Bedroom", "Dining Room", "Entryway", "Family Room", "Garage", "Guest Room", "Hallway", "Kitchen", "Laundry Room", "Living Room", "Master Bath", "Office", "Outside" ] }, { "id": "102781df86bd5a9a", "type": "debug", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "debug 629", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "values.area", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 1330, "y": 340, "wires": [] }, { "id": "32c8180bfbb28326", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Entryway Lights", "mode": "link", "links": [ "1cbe1d67bbf89d7c", "1a9152e0156e6032", "625414fccf4a9fda" ], "x": 1640, "y": 340, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "34f6dff134c91428", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Laundry Room Lights", "mode": "link", "links": [ "2d4d225366c81a39" ], "x": 1620, "y": 580, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "3fb27c74082951a2", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Office Lights", "mode": "link", "links": [ "e127b95333e569fd", "27f951496da4f276", "5445e96a55d1da7f", "a03c0d4ba6e71fda" ], "x": 1650, "y": 700, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "0238212af3aba964", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Bedroom Lights", "mode": "link", "links": [ "21ebd38950e29f43", "9beb192cd38b3004" ], "x": 1640, "y": 260, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "1d702465610ec397", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Garage Lights", "mode": "link", "links": [ "5c8badb0bd0992fe", "af16a99b618ad233" ], "x": 1640, "y": 420, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "54a2bd49814de949", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Hallway Lights", "mode": "link", "links": [ "a7e452d41c38e273", "cb18fe14a6741984", "d4ec06abe53d6997" ], "x": 1640, "y": 500, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "7f4b04b4e7702391", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Family Room Lights", "mode": "link", "links": [ "38501d5d2e2ec4f3", "080aa230a7e46be9", "06da2e14ad7b799c" ], "x": 1620, "y": 380, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "7c6d54c01522ac20", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Guest Room Lights", "mode": "link", "links": [ "f50c58a0bed97319", "e80ffb8ae2bc91e5" ], "x": 1630, "y": 460, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "54c687c796511e0a", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Kitchen Lights", "mode": "link", "links": [ "54666f04878aad07", "0582f9bd51b4816e", "47791314656424c8" ], "x": 1640, "y": 540, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "03e2a881a05bca0b", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Living Room Lights", "mode": "link", "links": [ "3423649593fde29a" ], "x": 1630, "y": 620, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "ed2462e15a7b76cb", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Master Bath Lights", "mode": "link", "links": [], "x": 1630, "y": 660, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "307b80a8bdf24795", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Outside Lights", "mode": "link", "links": [ "fe0ce549f564ab8b", "1699d495e424c0f0", "a472c10203120de6" ], "x": 1640, "y": 740, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "93e75d4f6f31da64", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Bathroom Lights", "mode": "link", "links": [], "x": 1630, "y": 220, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "603456298483ab2a", "type": "link out", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Dining Room Lights", "mode": "link", "links": [ "4919e8fbd04f91dd", "9f16156ffa7547e6" ], "x": 1630, "y": 300, "wires": [], "icon": "node-red/light.svg", "l": true }, { "id": "0983a5a7d39e65bb", "type": "join", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "", "mode": "custom", "build": "object", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "2", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "num", "reduceFixup": "", "x": 590, "y": 420, "wires": [ [ "186e26c1efec0885" ] ] }, { "id": "4c04fc201d29d292", "type": "change", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "set payload", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.status.text", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1070, "y": 220, "wires": [ [ "8c709af79cc086a8" ] ] }, { "id": "186e26c1efec0885", "type": "switch", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "", "property": "values.units", "propertyType": "msg", "rules": [ { "t": "nnull" }, { "t": "null" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 830, "y": 360, "wires": [ [ "bb682a0c1b1491ed" ], [ "af17466c864cfc09" ] ] }, { "id": "bb682a0c1b1491ed", "type": "function", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Capture question", "func": "var device_name = msg.payload.alexa.name;\nvar summary = msg.payload.alexa.description.summary;\nvar state = msg.values.state;\nvar item = msg.values.item;\nvar area = msg.values.area;\nvar number = msg.values.number;\nvar units = msg.values.units;\n\nif ((summary != \"alexa\") && (summary != \"\")) {\n\n if ((state != \"\") && (item != \"\") && (area != \"\") && (number != \"\") && (units != \"\")) {\n\n msg.payload = {};\n\n msg = {\n topic: \"Alexa_response\",\n device_name: device_name,\n payload: {\n \"status\": { text: \"Turning \" + state + \" the \" + item + \" in the \" + area + \" for \" + number + \" \" + units }\n }\n }\n node.status({ text: \"Turning \" + state + \" the \" + item + \"in the \" + area + \"for \" + number + \" \" + units });\n return msg;\n }\n \n\nelse {\n return null;\n }\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1070, "y": 300, "wires": [ [ "cc214ad3317a8b0e" ] ] }, { "id": "af17466c864cfc09", "type": "switch", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "", "property": "values.area", "propertyType": "msg", "rules": [ { "t": "nnull" }, { "t": "null" } ], "checkall": "false", "repair": false, "outputs": 2, "x": 830, "y": 420, "wires": [ [ "a8eeb6fd4cf542ec" ], [ "7d3c83ef2d32535e" ] ] }, { "id": "a8eeb6fd4cf542ec", "type": "function", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Capture question", "func": "var device_name = msg.payload.alexa.name;\nvar summary = msg.payload.alexa.description.summary;\nvar state = msg.values.state;\nvar item = msg.values.item;\nvar area = msg.values.area;\n\nif ((summary != \"alexa\") && (summary != \"\")) {\n\n if ((state != \"\") && (item != \"\") && (area != \"\")) {\n\n msg.payload = {};\n\n msg = {\n topic: \"Alexa_response\",\n device_name: device_name,\n payload: {\n \"status\": { text: \"Turning \" + state + \" the \" + item + \" in the \" + area }\n }\n }\n node.status({ text: \"Turning \" + state + \" the \" + item + \"in the \" + area });\n return msg;\n }\n \nelse {\n return null;\n }\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1070, "y": 360, "wires": [ [ "cc214ad3317a8b0e" ] ] }, { "id": "7d3c83ef2d32535e", "type": "function", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Capture question", "func": "var device_name = msg.payload.alexa.name;\nvar summary = msg.payload.alexa.description.summary;\nvar state = msg.values.state;\nvar item = msg.values.item;\n\nif ((summary != \"alexa\") && (summary != \"\")) {\n\n if ((state != \"\") && (item != \"\")) {\n\n msg.payload = {};\n\n msg = {\n topic: \"Alexa_response\",\n device_name: device_name,\n payload: {\n \"status\": { text: \"Turning \" + state + \" the \" + item }\n }\n }\n }\n node.status({ text: \"Turning \" + state + \" the \" + item });\n return msg;\n \n}\nelse {\n return null;\n }", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1070, "y": 420, "wires": [ [ "cc214ad3317a8b0e" ] ] }, { "id": "8c709af79cc086a8", "type": "alexa-remote-routine", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "Alexa device", "account": "", "routineNode": { "type": "speak", "payload": { "type": "regular", "text": { "type": "msg", "value": "payload" }, "devices": { "type": "msg", "value": "device_name" } } }, "x": 1350, "y": 220, "wires": [ [] ] }, { "id": "3f3ad2b054ba0202", "type": "link in", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Bedroom Lights Off", "links": [], "x": 1845, "y": 1160, "wires": [ [ "3eb351a188124036" ] ], "icon": "font-awesome/fa-moon-o" }, { "id": "d3b4ab8d61e438ca", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "RESET", "rules": [ { "t": "set", "p": "reset", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1845, "y": 1060, "wires": [ [ "87b9d3ce2d460522" ] ], "icon": "font-awesome/fa-refresh", "l": false }, { "id": "ba11790ea5bea946", "type": "switch", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Home Mode", "property": "HomeMode", "propertyType": "global", "rules": [ { "t": "eq", "v": "Day", "vt": "str" }, { "t": "eq", "v": "Evening", "vt": "str" }, { "t": "eq", "v": "Night", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 2170, "y": 920, "wires": [ [ "77cd857c5bf2b8e4" ], [ "67e3e55b6d74def1" ], [ "d9767d730b92793e" ] ], "icon": "font-awesome/fa-home" }, { "id": "9beb192cd38b3004", "type": "link in", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Bedroom Lights Voice Control", "links": [ "d49d4f42fe4c1b18", "0238212af3aba964", "2fac92b6ff56ce35" ], "x": 225, "y": 1000, "wires": [ [ "b5a68a9f085c24ec", "c78b3d04075117a6" ] ], "icon": "font-awesome/fa-bullhorn" }, { "id": "27cf708389081da3", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Bedroom Lights", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "grouped_light", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for bedroom lights group goes here", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "{\"on\":{\"on\":true}}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "{\"on\":{\"on\":false}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1080, "y": 1000, "wires": [ [ "e3c657844dcc7977" ] ], "icon": "font-awesome/fa-lightbulb-o" }, { "id": "3eb351a188124036", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Bedroom Lights = OFF", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "grouped_light", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for bedroom light group goes here", "tot": "str" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"on\":{\"on\":false}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2180, "y": 1160, "wires": [ [ "0c0f248764915f39" ] ] }, { "id": "0c0f248764915f39", "type": "link out", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Hue", "mode": "link", "links": [ "0763283cf82ea3ab", "62f7ca5829e8d390" ], "x": 2510, "y": 1160, "wires": [], "l": true }, { "id": "b17e92701797d280", "type": "switch", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "D'Dee Sleep Status", "property": "state.DDeeSleepState.value", "propertyType": "global", "rules": [ { "t": "eq", "v": "Awake", "vt": "str" }, { "t": "eq", "v": "Asleep", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1950, "y": 1000, "wires": [ [ "9b66569b4c38e010" ], [ "3eb351a188124036" ] ], "icon": "font-awesome/fa-bed" }, { "id": "9b66569b4c38e010", "type": "switch", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Rich Sleep Status", "property": "state.RichSleepState.value", "propertyType": "global", "rules": [ { "t": "eq", "v": "Awake", "vt": "str" }, { "t": "eq", "v": "Asleep", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1950, "y": 940, "wires": [ [ "ba11790ea5bea946" ], [ "eafd127e1b5d328f" ] ], "icon": "font-awesome/fa-bed" }, { "id": "a43261c41586a230", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Motion Sensor", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "motion", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for motion sensor goes here", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "{\"enabled\":true}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "{\"enabled\":false}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1280, "y": 1000, "wires": [ [ "e3c657844dcc7977" ] ], "icon": "node-red-contrib-huemagic/hue-motion.svg" }, { "id": "e3c657844dcc7977", "type": "link out", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Hue", "mode": "link", "links": [ "0763283cf82ea3ab", "62f7ca5829e8d390", "82a73a524b2c8692" ], "x": 1290, "y": 1100, "wires": [], "l": true }, { "id": "2ca1e07d68b3b69c", "type": "switch", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Motion Event Stream", "property": "payload.data.0.id", "propertyType": "msg", "rules": [ { "t": "cont", "v": "hue id number for motion sensor goes here", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 1540, "y": 1020, "wires": [ [ "908613faf658b87e" ] ] }, { "id": "908613faf658b87e", "type": "subflow:313c0097.f1216", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "", "x": 1620, "y": 1080, "wires": [ [ "d3b4ab8d61e438ca", "b17e92701797d280" ], [], [ "87b9d3ce2d460522" ] ] }, { "id": "5bba50de832eb74f", "type": "link in", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Events IN", "links": [ "d3cbfa9016794115", "926683504769e452", "c672c61b26f6ad0e" ], "x": 1460, "y": 960, "wires": [ [ "2ca1e07d68b3b69c" ] ], "l": true }, { "id": "67e3e55b6d74def1", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Relax", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "scene", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for hue relax scene for the bedroom goes here", "tot": "str" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"recall\":{\"action\":\"active\"}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2330, "y": 920, "wires": [ [ "0c0f248764915f39" ] ], "icon": "font-awesome/fa-star" }, { "id": "d9767d730b92793e", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Nightlight", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "scene", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for hue night scene for the bedroom goes here", "tot": "str" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"recall\":{\"action\":\"active\"}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2340, "y": 960, "wires": [ [ "0c0f248764915f39" ] ], "icon": "font-awesome/fa-star" }, { "id": "77cd857c5bf2b8e4", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Bright", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "scene", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for hue bright scene for the bedroom goes here", "tot": "str" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"recall\":{\"action\":\"active\"}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2330, "y": 880, "wires": [ [ "0c0f248764915f39" ] ], "icon": "font-awesome/fa-star" }, { "id": "eafd127e1b5d328f", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Light on 1%", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "light", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "hue id number for the closet lights goes here", "tot": "str" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"on\":{\"on\":true},\"dimming\":{\"brightness\":1},\"dynamics\":{\"duration\":1000},\"color_temperature\":{\"mirek\":500}}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2170, "y": 1040, "wires": [ [ "0c0f248764915f39" ] ], "icon": "node-red-contrib-huemagic/hue-brightness.svg" }, { "id": "5ddf2dcd670e072d", "type": "FilterUltimate", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "On/Off", "x": 850, "y": 1160, "wires": [ [ "f189ae1814bb79a5" ], [ "f189ae1814bb79a5" ] ], "icon": "node-red-contrib-huemagic/hue-motion.svg" }, { "id": "3d210aa4fb826714", "type": "link in", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Voice Control Bedroom Motion", "links": [ "1353fc597bda05de", "b4b76eca462150b1", "f862188cebe4dc5b" ], "x": 725, "y": 1160, "wires": [ [ "5ddf2dcd670e072d" ] ], "icon": "font-awesome/fa-bullhorn" }, { "id": "f189ae1814bb79a5", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Motion Sensor", "rules": [ { "t": "set", "p": "endpoint", "pt": "msg", "to": "motion", "tot": "str" }, { "t": "set", "p": "topic", "pt": "msg", "to": "9856f119-441d-4965-8869-de2654b680ec", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "{\"enabled\":true}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "{\"enabled\":false}", "tot": "json" }, { "t": "set", "p": "verb", "pt": "msg", "to": "put", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1080, "y": 1160, "wires": [ [ "e3c657844dcc7977" ] ], "icon": "node-red-contrib-huemagic/hue-motion.svg" }, { "id": "87b9d3ce2d460522", "type": "trigger", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "1 Minute", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "1", "extend": true, "overrideDelay": false, "units": "min", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 1960, "y": 1120, "wires": [ [ "3eb351a188124036" ] ] }, { "id": "1754d0b863d2dc98", "type": "inject", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Off", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 885, "y": 1080, "wires": [ [ "e66dcdca916529de" ] ], "outputLabels": [ "Off" ], "icon": "font-awesome/fa-toggle-off", "l": false }, { "id": "02c995cab585bf21", "type": "inject", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "On", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 885, "y": 920, "wires": [ [ "e66dcdca916529de" ] ], "outputLabels": [ "On" ], "icon": "font-awesome/fa-toggle-on", "l": false }, { "id": "5f8734b22e0c9d1f", "type": "join", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "", "mode": "custom", "build": "array", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "2", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 510, "y": 980, "wires": [ [ "fdb598d58b782f18", "d9fd9d376bbbf5e0" ] ] }, { "id": "fdb598d58b782f18", "type": "stoptimer-varidelay", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "duration": "60", "durationType": "num", "units": "Minute", "payloadtype": "str", "payloadval": "off", "name": "", "reporting": "last_minute_seconds", "persist": true, "ignoretimerpass": true, "x": 660, "y": 1020, "wires": [ [ "07730d5cc425e4a3" ], [], [] ] }, { "id": "b5a68a9f085c24ec", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "set numbers", "rules": [ { "t": "change", "p": "values.number", "pt": "msg", "from": "one", "fromt": "str", "to": "1", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "two", "fromt": "str", "to": "2", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "three", "fromt": "str", "to": "3", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "four", "fromt": "str", "to": "4", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "five", "fromt": "str", "to": "5", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "six", "fromt": "str", "to": "6", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "seven", "fromt": "str", "to": "7", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "eight", "fromt": "str", "to": "8", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "nine", "fromt": "str", "to": "9", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "ten", "fromt": "str", "to": "10", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "fifteen", "fromt": "str", "to": "15", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "twenty", "fromt": "str", "to": "20", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "thirty", "fromt": "str", "to": "30", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "fourty", "fromt": "str", "to": "40", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "fifty", "fromt": "str", "to": "50", "tot": "num" }, { "t": "change", "p": "values.number", "pt": "msg", "from": "sixty", "fromt": "str", "to": "60", "tot": "num" }, { "t": "set", "p": "delay", "pt": "msg", "to": "values.number", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 350, "y": 980, "wires": [ [ "5f8734b22e0c9d1f" ] ] }, { "id": "c78b3d04075117a6", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "set units", "rules": [ { "t": "set", "p": "units", "pt": "msg", "to": "values.units", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 1020, "wires": [ [ "5f8734b22e0c9d1f" ] ] }, { "id": "07730d5cc425e4a3", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "set state", "rules": [ { "t": "change", "p": "values.state", "pt": "msg", "from": "on", "fromt": "str", "to": "false", "tot": "bool" }, { "t": "change", "p": "values.state", "pt": "msg", "from": "off", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "set", "p": "payload", "pt": "msg", "to": "values.state", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 840, "y": 1020, "wires": [ [ "e66dcdca916529de" ] ] }, { "id": "d9fd9d376bbbf5e0", "type": "change", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "set state", "rules": [ { "t": "change", "p": "values.state", "pt": "msg", "from": "on", "fromt": "str", "to": "true", "tot": "bool" }, { "t": "change", "p": "values.state", "pt": "msg", "from": "off", "fromt": "str", "to": "false", "tot": "bool" }, { "t": "set", "p": "payload", "pt": "msg", "to": "values.state", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 840, "y": 980, "wires": [ [ "e66dcdca916529de" ] ] }, { "id": "82f5dc0dc2c7320b", "type": "comment", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "node-red-contrib-ecolect", "info": "This node used the ecolect node to parse \nphrases for routing", "x": 1030, "y": 560, "wires": [] }, { "id": "08d51ac523277ba3", "type": "comment", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "@dynamicdave function nodes for routing", "info": "These nodes test for whether or not certain\nvalues have been created and route the \nmessage accordingly. Huge thanks to \nhttps://discourse.nodered.org/u/dynamicdave \nwho created the function node these nodes\nare based on. They were the last piece I\nneeded to put this all together. See\nhttps://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867\n\n", "x": 1080, "y": 260, "wires": [] }, { "id": "d92ffca3f2efda66", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "further processing of the verbal commands", "info": "once the mesage reaches this flow, the number\nand units values are rejoined to set a timer.\nThis can be in the form of, \"Alexa, turn on\nthe bedroom light for 10 minutes\" or even,\n\"Alexa, turn off the bedroom light for 3\nseconds.\" Currently, if no time value is \npassed to the timer node, then the lights\nwill revert to their previous state after\nsixty minutes.\n", "x": 580, "y": 940, "wires": [] }, { "id": "54e351f6a3fab2e8", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "@yadomi/node-red-contrib-philipshue-events ", "info": "the lights node and motion nodes, as well as\nthe hue link nodes all use @yandomi's \nphillipshue events node. This performs much \nbetter than huemagic. It takes a bit to \ntrack down all of the lights, groups and\nscenes ID's but once you have them, it's\neasy from there. ", "x": 1210, "y": 960, "wires": [] }, { "id": "33734ca0077eb7ac", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "verbal motion sensor override", "info": "The way the flows are set up, if I turn on a \nlight without motion, such as verbally, or via \nan app (and in some cases with a physical \nswitch) the motion will be overridden until\na reset condition is met. This group alls \nme to use verbal commands to disable this \nmotion sensor. That is achieved by using a combo\nof node-red-contrib-alexa-remote2-applestrudel \nand node-red-contrib-amazon-echo-oztourer (for\ncreating virtual devices).", "x": 1320, "y": 1160, "wires": [] }, { "id": "1848b703b54340c5", "type": "switch", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "payload.data.0.motion.motion", "property": "payload.data.0.motion.motion", "propertyType": "msg", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 410, "y": 1380, "wires": [ [ "17d3adb838a09810" ], [ "f313d8f8057ff482" ] ] }, { "id": "17d3adb838a09810", "type": "change", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "true", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 1340, "wires": [ [ "d6ac29d39602af51", "480b758ce62a6185" ] ] }, { "id": "f313d8f8057ff482", "type": "change", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "false", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "false", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 1420, "wires": [ [ "5fd24e176d4f032c", "480b758ce62a6185" ] ] }, { "id": "f142bb079213071e", "type": "comment", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "PLEASE READ - DOUBLE CLICK", "info": "Output 1:\nWill send just an **true** when Motion is detected\n\nOutput 2:\nWill send an **true** when Motion is detected and a **false** if no motion is detected any longer.\n\nOutput 3:\nWill send just an **false** when no Motion is detected any longer.\n\n\n-----------------------\nAll outputs are boolean\n-----------------------\n\nMost easy Subflow, but convinient when lots of sensors need to be set up.\n\nNOTE: to use this as a subflow, set one input node\nand attach it to the left junction node and two or three\noutput nodes to link to the junctions on the right", "x": 420, "y": 1340, "wires": [] }, { "id": "6f6c5c8715c6d5b2", "type": "comment", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "motion true", "info": "", "x": 900, "y": 1300, "wires": [] }, { "id": "9b5e3ed1da1b70aa", "type": "comment", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "motion false", "info": "", "x": 910, "y": 1460, "wires": [] }, { "id": "fcf2637afeb8389a", "type": "comment", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "motion true / false", "info": "", "x": 930, "y": 1380, "wires": [] }, { "id": "d39251db0c575c10", "type": "comment", "z": "cd5687adb333d888", "g": "01eeda210db6be28", "name": "Hue Motion Sensor Event Filter SubflowThi", "info": "I can't recall where I picked up this subflow\nbut this is a recreation of it. Not my work, \nbut quite useful since myt light flows where\ngrowing pretty long. ", "x": 400, "y": 1300, "wires": [] }, { "id": "ee061045daba1036", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Setting lights based on conditions", "info": "This uses the sleep status for a pressure \nsensor to dertermine if who is in bed. Since\nmy wife gets up very early for work, it sets\nlighting in the bedroom and other parts of the\nhouse based on her presence in the room using \nmotion sensors. Since I stay up later, there\nare different ways I use the lights when she\nis in bed. So, this keeps them from coming \non in the bedroom while she is asleep. It also\nsets the lighting based on the home mode \n(day, evening, night). I also store our sleep\nstates in global variables because I use\nthem in numerous flows. For that I'm using\nnode-red-contrib-state to make sure these variables\ncan survive a power outtage or restart of my rpi.", "x": 2240, "y": 1000, "wires": [] }, { "id": "03c9334bdb5b4abd", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "trigger node", "info": "This trigger node functions as a reset timer \nfor the motion sensor so it doesn't go off\nwhile people are in the room, but does allow\nthe lights to be turned off while people \nare not in the room. You could also use the\noff timer subflow (which I made based on the \nHue Motion subflow). In this case, remove the \ntrigger node, wire up the off timer subflow \nnode exactly the same way, and then have it call;\nthe off timer subflow to dynamically set \nmotion reset values based on (in this case) home \nmode. ", "x": 1970, "y": 1080, "wires": [] }, { "id": "e58c87e34f8fda22", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "Link in from presence flows", "info": "This allows lights status to be imediately over-\nridden if certain conditions are met from my\npresence detection flows. ", "x": 1700, "y": 1160, "wires": [] }, { "id": "c2cb44f7ae15e65e", "type": "comment", "z": "cd5687adb333d888", "g": "04769e5cd35a789c", "name": "node-red-contrib-alexa-remote2-applestrudel ", "info": "I use the applestrudel version of the remote2\nnodes since they seem to be well maintained\nand kept up to date. ", "x": 410, "y": 480, "wires": [] }, { "id": "79d773bf3198f1da", "type": "debug", "z": "cd5687adb333d888", "g": "5b0d716b4004aaf6", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 910, "y": 1640, "wires": [] }, { "id": "03c07ae51f111993", "type": "philipshue-events", "z": "cd5687adb333d888", "g": "5b0d716b4004aaf6", "bridge": "", "x": 310, "y": 1640, "wires": [ [ "79d773bf3198f1da", "926683504769e452" ] ] }, { "id": "f895c7e1471d341f", "type": "comment", "z": "cd5687adb333d888", "g": "5b0d716b4004aaf6", "name": "Event Stream from the Bridge", "info": "", "x": 640, "y": 1580, "wires": [] }, { "id": "926683504769e452", "type": "link out", "z": "cd5687adb333d888", "g": "5b0d716b4004aaf6", "name": "BRIDGE EVENTSTREAM OUT", "links": [ "fc836ab4.4adae8", "a5f7c87b.cd5608", "cca6906da0638eef", "2af11bf710b112f2", "7b252f32d9897ba9", "e948232be0dfc30d", "321f3dc7082cf9c0", "383322ab2b8c81fb", "6ef01b91af326186", "9f552ed1904cd154", "bff8d49e05964883", "655d3b3f0c816b88", "cb57148a5af53fd2", "5bba50de832eb74f", "7b92769cddbd2ca7", "27d92c893fd6edd8", "6d11ebe0ff65c102", "cda8e24f5a03d823", "2b49675f6f9894e7", "8ae2c92487c4b1c2", "ebbf95899ef3da67" ], "x": 465, "y": 1580, "wires": [] }, { "id": "c59bb2926f18e489", "type": "function", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "HUE API V2 - HTTP Request", "func": "\n// you can copy the user from the hue config node\nvar user = \"YOUR HUE ACCESS TOKEN GOES HERE\";\n\n\nif(msg.endpoint === undefined)\n msg.url = \"https://Your hue hub url goes here/clip/v2/resource\";\nelse if(msg.topic === undefined)\n msg.url = \"https://Your hue hub url goes here/clip/v2/resource/\" + msg.endpoint;\nelse\n msg.url = \"https://Your hue hub url goes here/clip/v2/resource/\" + msg.endpoint + \"/\" + msg.topic;\n\n\nmsg.headers = {};\n\nmsg.headers['hue-application-key'] = user;\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers['Accept'] = 'application/json';\n\nif(msg.payload != undefined)\n msg.headers['ContentLength'] = JSON.stringify(msg.payload).length;\n\nif(msg.verb === undefined)\n msg.method = \"get\";\nelse\n msg.method = msg.verb;\n\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 420, "y": 1840, "wires": [ [ "b35690eaf78a2642", "6a37e52b7942b10f" ] ] }, { "id": "62f7ca5829e8d390", "type": "link in", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "Hue API V2 - HTTP Request", "links": [ "5822eca7c5cd7ee7", "801fc7dd54b0a76a", "7b5e08ed75e90ba3", "565bd4d6c2bef6fe", "7abba934002831c4", "6807a7083888945a", "95847006271e0133", "218c31e9dca28ac2", "afec2a09e8d913f3", "98e818606e34b5a0", "138ddf6ebdebf145", "a00c3d413160d4c8", "c59052249b68de8e", "e37953a9c216b41a", "6c38ad6edfa7fe16", "35e2869bd9ea28dc", "a7f7abde93b7db46", "bdc6b4e1fccc87aa", "ba7b51ee6717c955", "361552ad2a6c6733", "03308de279bf2191", "c89f31f899eebe6d", "67ffd8a834ceec9a", "37dfb5e583f98815", "c482254230ee5ffd", "6585d06a1417bc16", "d8e108cc1362a441", "27dbb464311a45b7", "6bf3034312e1586e", "1537d722f2815bb7", "311c3c12720d382f", "8f4e3af81d5acea9", "75eb0869c8510a98", "15124f6abbaf5ea5", "78f447d73514e0b3", "856996b96b0bd0ae", "311001386521958d", "3d4b5937755ee4ac", "c31dc83129dd982a", "ceb33dc82fb0b930", "030033a76122fcfb", "85b482f66a267c7f", "b19a31e7195ecd20", "33e44c89f414bdaa", "9f7f27bb9aa63bb7", "ada4c53d08584e1e", "c34c4f44ddaf562f", "0855ad68113ec412", "a74badd9128a6f83", "a5beaa015e7accc8", "839c5594bca8e8c9", "ef34b880d18038e4", "18efe3a973fdd95a", "7177dfe6c1d1a6a8", "2c938c77a5f0bfd1", "b424febf66e05be2", "7241cb1c076a641a", "9a16c372240987b8", "4cf67138be93c941", "71323e4ce02f818e", "7a7e56c3204ec63f", "50b149f77eef1dcf", "ee117eacc569c7b0", "8831aa1c4aae4f67", "2629c11ab4834439", "3cfa9d8398d5c3bc", "859b70db948d01b8", "a89cb07ce0fb971b", "8a147aa74b2bd2be", "0c0f248764915f39", "e3c657844dcc7977", "950d2f8579c74833", "0cb96a964d66ec43", "077db26d3c9275b0", "fdee95d209a62cf6", "77157fc4f0cc161b", "3274dfccb7a73985", "731b988cd9d49a39", "c8e93128aa3eb1ad", "d3be47944d8ec1c6", "d96b8fc859f06449", "b387a00541e2cddf", "1abee9d8d5644fc4", "40e264a0a0bf3d89", "5287bb51b7b41e0b", "d388d9e02806bcbc", "7071c4d0d2530110", "e215d9fb1839c85b", "730d7788e7eb1dbf", "39d46b46f9be987e", "aabda3c2517b1571", "f68bf1b4866f7bbd" ], "x": 235, "y": 1840, "wires": [ [ "c59bb2926f18e489", "490428798745bbf1" ] ] }, { "id": "acbb5622844abeb0", "type": "http request", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "https request HUE API V2", "method": "use", "ret": "obj", "paytoqs": "ignore", "url": "", "tls": "c2ca63af9b900283", "persist": false, "proxy": "", "authType": "", "senderr": false, "headers": [], "credentials": {}, "x": 910, "y": 1840, "wires": [ [ "3336c6c0ea2f64f6" ] ] }, { "id": "b35690eaf78a2642", "type": "delay", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "", "pauseType": "rate", "timeout": "2", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "0.5", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 670, "y": 1840, "wires": [ [ "acbb5622844abeb0" ] ] }, { "id": "6a37e52b7942b10f", "type": "debug", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "debug 630", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "auto", "x": 670, "y": 1780, "wires": [] }, { "id": "3336c6c0ea2f64f6", "type": "debug", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "debug 631", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "auto", "x": 930, "y": 1780, "wires": [] }, { "id": "490428798745bbf1", "type": "debug", "z": "cd5687adb333d888", "g": "d2a5c41371748949", "name": "debug 632", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "auto", "x": 370, "y": 1780, "wires": [] }, { "id": "6a030fb5f22d5206", "type": "subflow:a8cfc909a9101b28", "z": "cd5687adb333d888", "g": "744b9148968e869e", "name": "", "x": 1950, "y": 1300, "wires": [ [] ] }, { "id": "6582fb38d451cacc", "type": "comment", "z": "cd5687adb333d888", "g": "744b9148968e869e", "name": "Unsed in place of trigger node above", "info": "Off Timer node can be used in place of \ntrigger node in light flow for \ncondition based motion reset times.", "x": 2050, "y": 1340, "wires": [] }, { "id": "b757f4b62a2906dc", "type": "time-range-switch", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "", "lat": "43.20775", "lon": "-123.32381", "startTime": "sunset", "endTime": "22:00", "startOffset": 0, "endOffset": 0, "x": 1340, "y": 1420, "wires": [ [ "bcf02e5f439d8db2" ], [ "e4dbf8bbc847954f" ] ] }, { "id": "e3cc5ff39a439de0", "type": "time-range-switch", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "", "lat": "43.2078", "lon": "-123.32372", "startTime": "sunrise", "endTime": "sunset", "startOffset": 0, "endOffset": 0, "x": 1340, "y": 1360, "wires": [ [ "5e94f4a258e944df" ], [ "b757f4b62a2906dc" ] ] }, { "id": "e4dbf8bbc847954f", "type": "time-range-switch", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "", "lat": "43.20775", "lon": "-123.32381", "startTime": "22:00", "endTime": "sunrise", "startOffset": 0, "endOffset": 0, "x": 1340, "y": 1480, "wires": [ [ "d0667a4400529dfd" ], [] ] }, { "id": "d0667a4400529dfd", "type": "trigger", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "30 seconds", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "5", "extend": true, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 1570, "y": 1480, "wires": [ [ "7e084fd415761e54" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "bcf02e5f439d8db2", "type": "trigger", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "1 Minute", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "1", "extend": true, "overrideDelay": false, "units": "min", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 1560, "y": 1420, "wires": [ [ "7e084fd415761e54" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "5e94f4a258e944df", "type": "trigger", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "3 Minutes", "op1": "", "op2": "false", "op1type": "nul", "op2type": "bool", "duration": "3", "extend": true, "overrideDelay": false, "units": "min", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 1560, "y": 1360, "wires": [ [ "7e084fd415761e54" ] ], "icon": "node-red-contrib-bigtimer/timer.png" }, { "id": "026d9ae7c9e4ddb9", "type": "status", "z": "cd5687adb333d888", "g": "ed9855414848e72c", "name": "", "scope": [ "d0667a4400529dfd", "bcf02e5f439d8db2", "5e94f4a258e944df" ], "x": 1560, "y": 1300, "wires": [ [] ] }, { "id": "78186f0ee7284c0f", "type": "comment", "z": "cd5687adb333d888", "name": "Node paletts used", "info": "node-red-contrib-alexa-remote2-applestrudel \nnode-red-contrib-amazon-echo-oztourer\nnode-red-contrib-ecolect \n@yadomi/node-red-contrib-philipshue-events \nnode-red-contrib-stoptimer-varidelay\nnode-red-contrib-time-range-switch\n", "x": 370, "y": 60, "wires": [] }, { "id": "41f27d9395861ca5", "type": "comment", "z": "cd5687adb333d888", "g": "387fb6e77b9549eb", "name": "node-red-contrib-stoptimer-varidelay", "info": "", "x": 610, "y": 1060, "wires": [] }, { "id": "c2ca63af9b900283", "type": "tls-config", "name": "", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": false } ]