Rob's Node-Red Template and Example Flow Thread!

Welcome to Rob’s Node-Red Template and Example Flow Thread!

Here you will find a growing collection of templates/example flows you can import into your own instance and expand upon.

I will be assuming basic familiarity with Node-Red, as such I will not be explaining the basic nodes (switch, change, etc) or the basics of messages, triggering, etc unless there is a request for me to do so. These nodes will be labeled in the examples with what they do. Loading the flow to your own instance of Node-Red will allow you to see more details on the commands used for any given node.

I will also be attempting to keep the flows as simple and easy to follow visually as possible. I will post more advanced/complex flows after the basics are out of the way :slight_smile:

If you have any requests, including for me to put detailed node by node breakdowns for any of these examples, Please feel free to PM me or leave a comment here and I’ll see what I can do!

Let’s jump right in and get started with some Motion Sensor Controlled Lighting Flows

Click for the flow code [{"id":"8a5aa323bb7f8435","type":"tab","label":"Flow 5","disabled":false,"info":"","env":[]},{"id":"8277c82b05724992","type":"change","z":"8a5aa323bb7f8435","name":"Set Motion 1 ","rules":[{"t":"set","p":"#:(file)::motion1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":980,"wires":[["c44332393533817c"]]},{"id":"f3c36a53aaa9ae70","type":"change","z":"8a5aa323bb7f8435","name":"Set Motion 3","rules":[{"t":"set","p":"#:(file)::motion3","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1060,"wires":[["c44332393533817c"]]},{"id":"9dabd5ded6f2d12d","type":"change","z":"8a5aa323bb7f8435","name":"Set Motion 4","rules":[{"t":"set","p":"#:(file)::motion4","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1100,"wires":[["c44332393533817c"]]},{"id":"c44332393533817c","type":"switch","z":"8a5aa323bb7f8435","name":"active?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":560,"y":1020,"wires":[["8da5b7b46b715ef5","82a72785489584a6"],["d0ad718abfa5fc0f"]]},{"id":"0372d6914eba0f8a","type":"stoptimer2","z":"8a5aa323bb7f8435","duration":"30","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"60 sec","x":1310,"y":1080,"wires":[["b5625b3a508972d6"],[]]},{"id":"3ddc24311e4917b1","type":"change","z":"8a5aa323bb7f8435","name":"Set Motion 2","rules":[{"t":"set","p":"#:(file)::motion2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1020,"wires":[["c44332393533817c"]]},{"id":"d0ad718abfa5fc0f","type":"switch","z":"8a5aa323bb7f8435","name":"Motion 1","property":"#:(file)::motion1","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":660,"y":1100,"wires":[["f1a59ba86f098f59"]]},{"id":"9ada2ae30437e64d","type":"switch","z":"8a5aa323bb7f8435","name":"Motion 4","property":"#:(file)::motion4","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1100,"y":1100,"wires":[["0372d6914eba0f8a"]]},{"id":"21c436cf06ba4cad","type":"comment","z":"8a5aa323bb7f8435","name":"Simple Multi Motion Sensor Aggregated Light Control With Activity Buffer","info":"","x":310,"y":940,"wires":[]},{"id":"f1a59ba86f098f59","type":"switch","z":"8a5aa323bb7f8435","name":"Motion 2","property":"motion2","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":820,"y":1100,"wires":[["7eddcc012c09fa9b"]]},{"id":"7eddcc012c09fa9b","type":"switch","z":"8a5aa323bb7f8435","name":"Motion 3","property":"motion3","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":960,"y":1100,"wires":[["9ada2ae30437e64d"]]},{"id":"ece9cf60dc70b8c4","type":"comment","z":"8a5aa323bb7f8435","name":"Simple Single Motion Sensor Lighting Control","info":"","x":230,"y":540,"wires":[]},{"id":"2b9628a3870cf2db","type":"switch","z":"8a5aa323bb7f8435","name":"active?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":380,"y":580,"wires":[["f30b33b0385661a5"],["bb984bf4c27e1b65"]]},{"id":"bb984bf4c27e1b65","type":"change","z":"8a5aa323bb7f8435","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":620,"wires":[["a23fd90931fcc2d8"]]},{"id":"f30b33b0385661a5","type":"change","z":"8a5aa323bb7f8435","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":560,"wires":[["a23fd90931fcc2d8"]]},{"id":"a23fd90931fcc2d8","type":"Tasmota Light","z":"8a5aa323bb7f8435","broker":"fb8e22de96fd2cb7","device":"Lights/Bedroom/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":770,"y":580,"wires":[[]]},{"id":"c3431fae6277599a","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 1 (iL07_1)","device_id":"0xd0cf5efffe53f6f0","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":580,"wires":[["2b9628a3870cf2db"]]},{"id":"f713e9ebde1b53e8","type":"comment","z":"8a5aa323bb7f8435","name":"Single Motion Sensor Lighting Control With Activity Buffer","info":"","x":270,"y":720,"wires":[]},{"id":"7c256b6458efb44c","type":"switch","z":"8a5aa323bb7f8435","name":"active?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":380,"y":800,"wires":[["53cd93ab7e3fa222"],["2affe31d01efb3d4"]]},{"id":"b383137e0c486adb","type":"change","z":"8a5aa323bb7f8435","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":800,"wires":[["0845b77e5ffe2ff5"]]},{"id":"53cd93ab7e3fa222","type":"change","z":"8a5aa323bb7f8435","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":760,"wires":[["0845b77e5ffe2ff5","d86a6311030a17f6"]]},{"id":"0845b77e5ffe2ff5","type":"Tasmota Light","z":"8a5aa323bb7f8435","broker":"fb8e22de96fd2cb7","device":"Lights/Bedroom/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1310,"y":760,"wires":[[]]},{"id":"d3acce239b4acd3a","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 1 (iL07_1)","device_id":"0xd0cf5efffe53f6f0","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":800,"wires":[["7c256b6458efb44c"]]},{"id":"2affe31d01efb3d4","type":"stoptimer2","z":"8a5aa323bb7f8435","duration":"30","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"60 sec","x":910,"y":840,"wires":[["b383137e0c486adb"],[]]},{"id":"d86a6311030a17f6","type":"change","z":"8a5aa323bb7f8435","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":800,"wires":[["2affe31d01efb3d4"]]},{"id":"7e529f0433039895","type":"comment","z":"8a5aa323bb7f8435","name":"Stop timer waits until 60 seconds have passed without new motion detected before turning off lights","info":"","x":1340,"y":840,"wires":[]},{"id":"162f653178221e1f","type":"comment","z":"8a5aa323bb7f8435","name":"msg.payload of STOP stops the timer when activity is detected","info":"","x":840,"y":700,"wires":[]},{"id":"b5625b3a508972d6","type":"change","z":"8a5aa323bb7f8435","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1080,"wires":[["0c1ebee9c1c55b66"]]},{"id":"8da5b7b46b715ef5","type":"change","z":"8a5aa323bb7f8435","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1020,"wires":[["0c1ebee9c1c55b66"]]},{"id":"0c1ebee9c1c55b66","type":"Tasmota Light","z":"8a5aa323bb7f8435","broker":"fb8e22de96fd2cb7","device":"Lights/Bedroom/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1610,"y":1040,"wires":[[]]},{"id":"82a72785489584a6","type":"change","z":"8a5aa323bb7f8435","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":1040,"wires":[["0372d6914eba0f8a"]]},{"id":"701da3510edb971f","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 1 (iL07_1)","device_id":"0xd0cf5efffe53f6f0","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":980,"wires":[["8277c82b05724992"]]},{"id":"5759f6a79c2ac7c7","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 2 (iL07_1)","device_id":"0xd0cf5efffe85dd67","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":1020,"wires":[["3ddc24311e4917b1"]]},{"id":"dc191a080699ab79","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 1 (iL07_1)","device_id":"0xd0cf5efffe53f6f0","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":1060,"wires":[["f3c36a53aaa9ae70"]]},{"id":"181f23c644aa041d","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 2 (iL07_1)","device_id":"0xd0cf5efffe85dd67","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":170,"y":1100,"wires":[["9dabd5ded6f2d12d"]]},{"id":"7ba8fc3157050101","type":"comment","z":"8a5aa323bb7f8435","name":"Using change nodes we store the current state of each motion sensor on change to a context file","info":"","x":870,"y":980,"wires":[]},{"id":"d96d94d986e70f04","type":"comment","z":"8a5aa323bb7f8435","name":"Using a switch node we check the current status of each motion sensor when any sensor triggers inactive","info":"","x":860,"y":1140,"wires":[]},{"id":"86bd4024f57b8829","type":"comment","z":"8a5aa323bb7f8435","name":"Single Motion Sensor Lighting Control With Activity Buffer And Manual Over-Ride","info":"","x":400,"y":1240,"wires":[]},{"id":"20cfceb21a0bdea5","type":"switch","z":"8a5aa323bb7f8435","name":"active?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":1340,"wires":[["132ec2a14b185e0b"],["1907b3129a23df8d"]]},{"id":"8e1972d360245ac8","type":"change","z":"8a5aa323bb7f8435","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":1360,"wires":[["d8147647363bb53a"]]},{"id":"132ec2a14b185e0b","type":"change","z":"8a5aa323bb7f8435","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":1300,"wires":[["2ca60ad773a20f85","d8147647363bb53a"]]},{"id":"fa9a450392c7e4f8","type":"Tasmota Light","z":"8a5aa323bb7f8435","broker":"fb8e22de96fd2cb7","device":"Lights/Bedroom/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1610,"y":1300,"wires":[[]]},{"id":"5de12c34a6960114","type":"zigbee2mqtt-in","z":"8a5aa323bb7f8435","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Kitchen Motion 1 (iL07_1)","device_id":"0xd0cf5efffe53f6f0","state":"occupancy","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":190,"y":1340,"wires":[["20cfceb21a0bdea5"]]},{"id":"1907b3129a23df8d","type":"stoptimer2","z":"8a5aa323bb7f8435","duration":"30","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"60 sec","x":930,"y":1380,"wires":[["8e1972d360245ac8"],[]]},{"id":"2ca60ad773a20f85","type":"change","z":"8a5aa323bb7f8435","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":1340,"wires":[["1907b3129a23df8d"]]},{"id":"d8147647363bb53a","type":"switch","z":"8a5aa323bb7f8435","name":"Over-Ride","property":"override","propertyType":"flow","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":1390,"y":1300,"wires":[["fa9a450392c7e4f8"],[]]},{"id":"0aa15657565cc38d","type":"comment","z":"8a5aa323bb7f8435","name":"If over-ride context is false allows the command through, if true blocks them","info":"","x":1360,"y":1240,"wires":[]},{"id":"a978a668fd217ad3","type":"comment","z":"8a5aa323bb7f8435","name":"Over-Ride context can be set by any trigger you want","info":"","x":1450,"y":1380,"wires":[]},{"id":"fb8e22de96fd2cb7","type":"tasmota-mqtt-broker","name":"Pi","broker":"10.10.2.1","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"}]

Now let’s take a look at some simple contact sensors, these examples also double as templates for controlling Magic-Home Led strips :wink:


Click for the flow code[{"id":"58e7bdb7185fc146","type":"tab","label":"Magic Home Templates","disabled":false,"info":"","env":[]},{"id":"bf4ea44d12cdb861","type":"switch","z":"58e7bdb7185fc146","name":"Cosed/Open","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":200,"wires":[["e19b69c293125301"],["184cd0614edc18e1"]]},{"id":"2cf9c63517497cc9","type":"comment","z":"58e7bdb7185fc146","name":"Contact Sensor - Door Open = False, Door Closed = True","info":"","x":1270,"y":40,"wires":[]},{"id":"a436fe0b6634ef4a","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1130,"y":220,"wires":[[]]},{"id":"184cd0614edc18e1","type":"change","z":"58e7bdb7185fc146","name":"Magichome On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":240,"wires":[["fc51073b8a2ccc8c"]]},{"id":"e19b69c293125301","type":"change","z":"58e7bdb7185fc146","name":"Magichome Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": false }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":180,"wires":[["fc51073b8a2ccc8c"]]},{"id":"55da9925ffdd0959","type":"change","z":"58e7bdb7185fc146","name":"Magichome Color","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"color\": 99000000 }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":500,"wires":[["f745f83c51d9bcc1"]]},{"id":"35d3df5fdcb128ea","type":"zigbee2mqtt-in","z":"58e7bdb7185fc146","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Closet Contact (3320-L)","device_id":"0x000d6f00057cc7d8","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":180,"y":200,"wires":[["e290bd32923df4b5"]]},{"id":"e290bd32923df4b5","type":"switch","z":"58e7bdb7185fc146","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":200,"wires":[["bf4ea44d12cdb861"]]},{"id":"fc51073b8a2ccc8c","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":940,"y":220,"wires":[["a436fe0b6634ef4a"]]},{"id":"410969c84e375bba","type":"comment","z":"58e7bdb7185fc146","name":"To change brightness or color the lights must be turned on first","info":"","x":300,"y":320,"wires":[]},{"id":"4bdb011f482d3619","type":"change","z":"58e7bdb7185fc146","name":"Magichome Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": false }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":420,"wires":[["f745f83c51d9bcc1"]]},{"id":"a721037cd1a36740","type":"delay","z":"58e7bdb7185fc146","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":910,"y":500,"wires":[["55da9925ffdd0959"]]},{"id":"f57a7c3a176de8ca","type":"switch","z":"58e7bdb7185fc146","name":"Cosed/Open","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":460,"wires":[["4bdb011f482d3619"],["f2fd0a41ca512c8a"]]},{"id":"ad0555c9c4b76b52","type":"zigbee2mqtt-in","z":"58e7bdb7185fc146","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Closet Contact (3320-L)","device_id":"0x000d6f00057cc7d8","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":160,"y":460,"wires":[["ac148ec39ee7e770"]]},{"id":"ac148ec39ee7e770","type":"switch","z":"58e7bdb7185fc146","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":460,"wires":[["f57a7c3a176de8ca"]]},{"id":"a6153340961a8a1c","type":"comment","z":"58e7bdb7185fc146","name":"You can chain as many commands in a row as you want. Especially useful on nodes like MagicHome that don't allow some commands like color and brightness to be used together","info":"","x":710,"y":620,"wires":[]},{"id":"799940c55d43a7e3","type":"change","z":"58e7bdb7185fc146","name":"Magichome Brightness","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"brightness\": 10 }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":780,"wires":[["95110bcaa2833f48"]]},{"id":"8aa60fe2591b3f70","type":"delay","z":"58e7bdb7185fc146","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":970,"y":780,"wires":[["799940c55d43a7e3"]]},{"id":"48c24b4ad2f61176","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1510,"y":440,"wires":[[]]},{"id":"f745f83c51d9bcc1","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1320,"y":440,"wires":[["48c24b4ad2f61176"]]},{"id":"f2fd0a41ca512c8a","type":"change","z":"58e7bdb7185fc146","name":"Magichome On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":480,"wires":[["f745f83c51d9bcc1","a721037cd1a36740"]]},{"id":"8fe096be450a6254","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1550,"y":720,"wires":[[]]},{"id":"95110bcaa2833f48","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1380,"y":720,"wires":[["8fe096be450a6254"]]},{"id":"453268bf83b79952","type":"switch","z":"58e7bdb7185fc146","name":"Cosed/Open","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":740,"wires":[["b156c8c0dd79551d"],["c622f16111b4f6af"]]},{"id":"f9238cfd78468ffb","type":"zigbee2mqtt-in","z":"58e7bdb7185fc146","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Closet Contact (3320-L)","device_id":"0x000d6f00057cc7d8","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":140,"y":740,"wires":[["662f4b28903db79e"]]},{"id":"662f4b28903db79e","type":"switch","z":"58e7bdb7185fc146","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":740,"wires":[["453268bf83b79952"]]},{"id":"ab9cc7dde2dada40","type":"comment","z":"58e7bdb7185fc146","name":"Use delay nodes and tree branches to execute multiple commands in sequence","info":"","x":860,"y":320,"wires":[]},{"id":"3b56b44c0dd5dfbe","type":"comment","z":"58e7bdb7185fc146","name":"Magic Home Command Templates and examples","info":"","x":840,"y":40,"wires":[]},{"id":"2f0abb0d63c6aa1b","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1590,"y":1080,"wires":[[]]},{"id":"d40a2fea3f04c4e3","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1420,"y":1080,"wires":[["2f0abb0d63c6aa1b"]]},{"id":"32a0dd68c57c742d","type":"change","z":"58e7bdb7185fc146","name":"Magichome Blink","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"blink\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":1080,"wires":[["d40a2fea3f04c4e3","dc06778d740eb014"]]},{"id":"fcb91f365c122b93","type":"switch","z":"58e7bdb7185fc146","name":"Cosed/Open","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":1000,"wires":[["f859d9a99104bd5d"],["007e0961c2ad09c7"]]},{"id":"2670e92b9c75b0bd","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1470,"y":1000,"wires":[[]]},{"id":"007e0961c2ad09c7","type":"change","z":"58e7bdb7185fc146","name":"Magichome On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1040,"wires":[["c51b47a7c58df619","e55c8beda0e4908b"]]},{"id":"f859d9a99104bd5d","type":"change","z":"58e7bdb7185fc146","name":"Magichome Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": false }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":940,"wires":[["c51b47a7c58df619","ec82c59aa2456526"]]},{"id":"2d1cb83b2114ef4c","type":"zigbee2mqtt-in","z":"58e7bdb7185fc146","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Closet Contact (3320-L)","device_id":"0x000d6f00057cc7d8","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":180,"y":1000,"wires":[["b58d9faa60a05174"]]},{"id":"b58d9faa60a05174","type":"switch","z":"58e7bdb7185fc146","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":1000,"wires":[["fcb91f365c122b93"]]},{"id":"c51b47a7c58df619","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1300,"y":1000,"wires":[["2670e92b9c75b0bd"]]},{"id":"e55c8beda0e4908b","type":"stoptimer2","z":"58e7bdb7185fc146","duration":"3","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":980,"y":1080,"wires":[["32a0dd68c57c742d"],[]]},{"id":"c622f16111b4f6af","type":"change","z":"58e7bdb7185fc146","name":"Magichome On + Color","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": true, \"color\": 994000 }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":760,"wires":[["95110bcaa2833f48","8aa60fe2591b3f70"]]},{"id":"b156c8c0dd79551d","type":"change","z":"58e7bdb7185fc146","name":"Magichome Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": false }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":720,"wires":[["95110bcaa2833f48"]]},{"id":"c8e20c08b65eae10","type":"comment","z":"58e7bdb7185fc146","name":"Simple light on when door open, light off when it closes","info":"","x":480,"y":120,"wires":[]},{"id":"ec82c59aa2456526","type":"change","z":"58e7bdb7185fc146","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1000,"wires":[["e55c8beda0e4908b","dc06778d740eb014"]]},{"id":"2292af15dd47cbd2","type":"comment","z":"58e7bdb7185fc146","name":"Blink Command Flashes lights twice. ","info":"","x":240,"y":880,"wires":[]},{"id":"14d581abb1ce9a44","type":"comment","z":"58e7bdb7185fc146","name":"Timer starts when door opens, if the door hasn't closed after 3 minutes start blinking the lights every 15 seconds until the door is close","info":"","x":1160,"y":880,"wires":[]},{"id":"dc06778d740eb014","type":"stoptimer2","z":"58e7bdb7185fc146","duration":"15","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1230,"y":1160,"wires":[["32a0dd68c57c742d"],[]]},{"id":"a80961acde424c95","type":"comment","z":"58e7bdb7185fc146","name":"Looping timer with blink command causes the blink command to execute every 15 seconds until door closes","info":"","x":1240,"y":1200,"wires":[]},{"id":"c9cc8bdff9361ac0","type":"comment","z":"58e7bdb7185fc146","name":"Sending STOP as msg.payload when the door closes stops the timers and stops lights flashing","info":"","x":1220,"y":920,"wires":[]},{"id":"998d7c15b13ca5c3","type":"switch","z":"58e7bdb7185fc146","name":"Cosed/Open","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":1360,"wires":[["5108c453a69e98f6"],["5108c453a69e98f6"]]},{"id":"f605827fa4704826","type":"zigbee2mqtt-in","z":"58e7bdb7185fc146","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Closet Contact (3320-L)","device_id":"0x000d6f00057cc7d8","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":160,"y":1360,"wires":[["4dbc2be5dea4bd2c"]]},{"id":"4dbc2be5dea4bd2c","type":"switch","z":"58e7bdb7185fc146","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":1360,"wires":[["998d7c15b13ca5c3"]]},{"id":"83dbc6c31992e930","type":"function","z":"58e7bdb7185fc146","name":"cleanup","func":"var newMsg = { payload: msg.payload };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1360,"wires":[["69bc227d2f46cba0"]]},{"id":"69bc227d2f46cba0","type":"MagicHome UFO","z":"58e7bdb7185fc146","name":"CLoset Led","ip":"192.168.24.152","style":"RGBW","x":1050,"y":1360,"wires":[[]]},{"id":"5108c453a69e98f6","type":"change","z":"58e7bdb7185fc146","name":"Magichome Toggle","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"toggle\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":1360,"wires":[["83dbc6c31992e930"]]},{"id":"a9ef4e2796d0e14d","type":"comment","z":"58e7bdb7185fc146","name":"Cleanup nodes are used to remove all message data that isnt part of our command","info":"","x":1170,"y":120,"wires":[]},{"id":"0fb53110c0e2f798","type":"comment","z":"58e7bdb7185fc146","name":"This prevents the extra data from causing errors ","info":"","x":1160,"y":160,"wires":[]},{"id":"7ecfb2203085e621","type":"comment","z":"58e7bdb7185fc146","name":"Toggle Command toggles the state of the lights between on and off","info":"","x":400,"y":1280,"wires":[]},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"}]

Here we have a flow/template for controlling lights (on, off, brightness up and down, and CT) with a Pico Remote.


This one includes a bonus customizeable Subflow for controling the stepping of the brightness.

Click for the flow code[{"id":"8956dc3ee8fd243d","type":"subflow","name":"Brightness Control","info":"","category":"","in":[{"x":160,"y":300,"wires":[{"id":"51bbc4a533eb9ff4"}]}],"out":[{"x":1420,"y":300,"wires":[{"id":"8cbac896b3420b78","port":0},{"id":"a353695519864d83","port":0},{"id":"78b4dd59aa2ed05a","port":0},{"id":"03a3b553312220e1","port":0},{"id":"8614f51a51e143a2","port":0},{"id":"11333f292af40124","port":0},{"id":"55c3ddbaf6cd47de","port":0},{"id":"e0a129a5c7c13ce8","port":0},{"id":"87b5ae1277f0efac","port":0},{"id":"efa870d293a72444","port":0},{"id":"8b968c77b4d69309","port":0}]}],"env":[],"meta":{},"color":"#DDAA99"},{"id":"d7459434ff4a2a3a","type":"switch","z":"8956dc3ee8fd243d","name":"increase","property":"payload.bright","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"20","vt":"str"},{"t":"eq","v":"30","vt":"str"},{"t":"eq","v":"40","vt":"str"},{"t":"eq","v":"50","vt":"str"},{"t":"eq","v":"60","vt":"str"},{"t":"eq","v":"70","vt":"str"},{"t":"eq","v":"80","vt":"str"},{"t":"eq","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":680,"y":220,"wires":[["a353695519864d83"],["78b4dd59aa2ed05a"],["03a3b553312220e1"],["8614f51a51e143a2"],["11333f292af40124"],["55c3ddbaf6cd47de"],["e0a129a5c7c13ce8"],["87b5ae1277f0efac"],["efa870d293a72444"],["8b968c77b4d69309"]]},{"id":"09d96498cce79fbd","type":"switch","z":"8956dc3ee8fd243d","name":"decrease","property":"payload.bright","propertyType":"msg","rules":[{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"20","vt":"str"},{"t":"eq","v":"30","vt":"str"},{"t":"eq","v":"40","vt":"str"},{"t":"eq","v":"50","vt":"str"},{"t":"eq","v":"60","vt":"str"},{"t":"eq","v":"70","vt":"str"},{"t":"eq","v":"80","vt":"str"},{"t":"eq","v":"90","vt":"str"},{"t":"eq","v":"100","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":680,"y":420,"wires":[["8cbac896b3420b78"],["a353695519864d83"],["78b4dd59aa2ed05a"],["03a3b553312220e1"],["8614f51a51e143a2"],["11333f292af40124"],["55c3ddbaf6cd47de"],["e0a129a5c7c13ce8"],["87b5ae1277f0efac"],["efa870d293a72444"]]},{"id":"51bbc4a533eb9ff4","type":"switch","z":"8956dc3ee8fd243d","name":"","property":"payload.press","propertyType":"msg","rules":[{"t":"eq","v":"up","vt":"str"},{"t":"eq","v":"down","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":300,"wires":[["d7459434ff4a2a3a"],["09d96498cce79fbd"]]},{"id":"03a3b553312220e1","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 30%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"a353695519864d83","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 10%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"55c3ddbaf6cd47de","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 60%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":360,"wires":[[]]},{"id":"8b968c77b4d69309","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 100%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"100","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":520,"wires":[[]]},{"id":"78b4dd59aa2ed05a","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 20%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":200,"wires":[[]]},{"id":"8614f51a51e143a2","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 40%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":280,"wires":[[]]},{"id":"11333f292af40124","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 50%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"87b5ae1277f0efac","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 80%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":440,"wires":[[]]},{"id":"e0a129a5c7c13ce8","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 70%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"70","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":400,"wires":[[]]},{"id":"efa870d293a72444","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 90%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"90","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":480,"wires":[[]]},{"id":"8cbac896b3420b78","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]},{"id":"6ea7667bde439fa7","type":"tab","label":"Front Room","disabled":false,"info":""},{"id":"4f2402777abdf862","type":"group","z":"6ea7667bde439fa7","name":"Front Room Lights","style":{"stroke":"#ff0000","label":true,"label-position":"n","color":"#000000"},"nodes":["421cbdec3bee8e1c","6e750c2af8e9cff6","b87bf66c17215bb9","f15e1a9bdfabce60"],"x":1194,"y":99,"w":192,"h":202},{"id":"dd9098107d1f81e6","type":"delay","z":"6ea7667bde439fa7","name":"Relay","pauseType":"delay","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1130,"y":200,"wires":[["f15e1a9bdfabce60","6e750c2af8e9cff6","421cbdec3bee8e1c","b87bf66c17215bb9"]]},{"id":"421cbdec3bee8e1c","type":"Tasmota Light","z":"6ea7667bde439fa7","g":"4f2402777abdf862","broker":"fb8e22de96fd2cb7","device":"Lights/FrontRoom/FL","name":"Front Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":false,"havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1300,"y":180,"wires":[[]]},{"id":"6e750c2af8e9cff6","type":"Tasmota Light","z":"6ea7667bde439fa7","g":"4f2402777abdf862","broker":"fb8e22de96fd2cb7","device":"Lights/FrontRoom/BR","name":"Back Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":false,"havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1290,"y":260,"wires":[[]]},{"id":"b87bf66c17215bb9","type":"Tasmota Light","z":"6ea7667bde439fa7","g":"4f2402777abdf862","broker":"fb8e22de96fd2cb7","device":"Lights/FrontRoom/BL","name":"Back Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":false,"havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1300,"y":220,"wires":[[]]},{"id":"f15e1a9bdfabce60","type":"Tasmota Light","z":"6ea7667bde439fa7","g":"4f2402777abdf862","broker":"fb8e22de96fd2cb7","device":"Lights/FrontRoom/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"false","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1290,"y":140,"wires":[["17970d56035d2dcf"]]},{"id":"17970d56035d2dcf","type":"change","z":"6ea7667bde439fa7","name":"Set FR Status","rules":[{"t":"delete","p":"FRFRPower","pt":"global"},{"t":"set","p":"payload.col","pt":"msg","to":"(payload.colors[0])+(payload.colors[1])+(payload.colors[2])","tot":"jsonata"},{"t":"set","p":"FRFRPower","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":140,"wires":[[]]},{"id":"7acb5ef86fe1bf79","type":"switch","z":"6ea7667bde439fa7","name":"Button Click","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"up","vt":"str"},{"t":"eq","v":"down","vt":"str"},{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":390,"y":180,"wires":[["498aa7d041242980"],["92d157618330f55f"],["50716adeadb6fccc"],["50716adeadb6fccc"],["e6d21bded99643f6"]]},{"id":"92d157618330f55f","type":"change","z":"6ea7667bde439fa7","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Power off\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":160,"wires":[["dd9098107d1f81e6"]]},{"id":"498aa7d041242980","type":"change","z":"6ea7667bde439fa7","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Power On\", \"Dimmer 10\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":120,"wires":[["dd9098107d1f81e6"]]},{"id":"dba21f8541a522f1","type":"lutron-status","z":"6ea7667bde439fa7","confignode":"736823588286fc43","name":"FR Pico","x":290,"y":100,"wires":[["7acb5ef86fe1bf79"]]},{"id":"0138d2849d3d9da2","type":"change","z":"6ea7667bde439fa7","name":"Bright 100%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.ct","pt":"msg","to":"6453","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":280,"wires":[["dd9098107d1f81e6"]]},{"id":"e6d21bded99643f6","type":"change","z":"6ea7667bde439fa7","name":"Get FR ","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"FRFRPower","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":240,"wires":[["db217c5095a04827"]]},{"id":"db217c5095a04827","type":"switch","z":"6ea7667bde439fa7","name":"","property":"payload.colors[0]","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"gte","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":240,"wires":[["a1582b13ffc2a71f"],["0138d2849d3d9da2"]]},{"id":"a1582b13ffc2a71f","type":"change","z":"6ea7667bde439fa7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$round(payload.bright*2.55)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":240,"wires":[["4a6884b917178619"]]},{"id":"4a6884b917178619","type":"function","z":"6ea7667bde439fa7","name":"","func":"var x = msg.payload;\nvar y = `${x},${x},${x}`;\nmsg.payload = {'rgb': y};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":240,"wires":[["dd9098107d1f81e6"]]},{"id":"8643b3dbff468bc2","type":"subflow:8956dc3ee8fd243d","z":"6ea7667bde439fa7","name":"","x":770,"y":200,"wires":[["dd9098107d1f81e6"]]},{"id":"50716adeadb6fccc","type":"change","z":"6ea7667bde439fa7","name":"Get FR Status","rules":[{"t":"move","p":"payload","pt":"msg","to":"press","tot":"flow"},{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"FRFRPower","tot":"global"},{"t":"set","p":"payload.press","pt":"msg","to":"press","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":200,"wires":[["8643b3dbff468bc2"]]},{"id":"fb8e22de96fd2cb7","type":"tasmota-mqtt-broker","name":"Pi","broker":"10.10.2.1","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true},{"id":"736823588286fc43","type":"lutron-config","name":"main","ipaddress":"192.168.0.94","deviceMap":{"ALL":"0","Kitchen Pico":"2","Granny Pico":"3","FR Pico":"4","BedRoom":"5"},"timeout":"45000"}]

Subflow

Click for the flow code [{"id":"8956dc3ee8fd243d","type":"subflow","name":"Brightness Control","info":"","category":"","in":[{"x":160,"y":300,"wires":[{"id":"51bbc4a533eb9ff4"}]}],"out":[{"x":1420,"y":300,"wires":[{"id":"8cbac896b3420b78","port":0},{"id":"a353695519864d83","port":0},{"id":"78b4dd59aa2ed05a","port":0},{"id":"03a3b553312220e1","port":0},{"id":"8614f51a51e143a2","port":0},{"id":"11333f292af40124","port":0},{"id":"55c3ddbaf6cd47de","port":0},{"id":"e0a129a5c7c13ce8","port":0},{"id":"87b5ae1277f0efac","port":0},{"id":"efa870d293a72444","port":0},{"id":"8b968c77b4d69309","port":0}]}],"env":[],"meta":{},"color":"#DDAA99"},{"id":"dda0a4b9ab361a79","type":"group","z":"8956dc3ee8fd243d","name":"Tasmota Light Brightness","style":{"stroke":"#92d04f","fill":"#addb7b","label":true,"color":"#000000","label-position":"n"},"nodes":["03a3b553312220e1","a353695519864d83","55c3ddbaf6cd47de","8b968c77b4d69309","78b4dd59aa2ed05a","8614f51a51e143a2","11333f292af40124","87b5ae1277f0efac","e0a129a5c7c13ce8","efa870d293a72444","8cbac896b3420b78"],"x":954,"y":79,"w":192,"h":482},{"id":"d7459434ff4a2a3a","type":"switch","z":"8956dc3ee8fd243d","name":"increase","property":"payload.bright","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"20","vt":"str"},{"t":"eq","v":"30","vt":"str"},{"t":"eq","v":"40","vt":"str"},{"t":"eq","v":"50","vt":"str"},{"t":"eq","v":"60","vt":"str"},{"t":"eq","v":"70","vt":"str"},{"t":"eq","v":"80","vt":"str"},{"t":"eq","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":680,"y":220,"wires":[["a353695519864d83"],["78b4dd59aa2ed05a"],["03a3b553312220e1"],["8614f51a51e143a2"],["11333f292af40124"],["55c3ddbaf6cd47de"],["e0a129a5c7c13ce8"],["87b5ae1277f0efac"],["efa870d293a72444"],["8b968c77b4d69309"]]},{"id":"09d96498cce79fbd","type":"switch","z":"8956dc3ee8fd243d","name":"decrease","property":"payload.bright","propertyType":"msg","rules":[{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"20","vt":"str"},{"t":"eq","v":"30","vt":"str"},{"t":"eq","v":"40","vt":"str"},{"t":"eq","v":"50","vt":"str"},{"t":"eq","v":"60","vt":"str"},{"t":"eq","v":"70","vt":"str"},{"t":"eq","v":"80","vt":"str"},{"t":"eq","v":"90","vt":"str"},{"t":"eq","v":"100","vt":"str"}],"checkall":"true","repair":false,"outputs":10,"x":680,"y":420,"wires":[["8cbac896b3420b78"],["a353695519864d83"],["78b4dd59aa2ed05a"],["03a3b553312220e1"],["8614f51a51e143a2"],["11333f292af40124"],["55c3ddbaf6cd47de"],["e0a129a5c7c13ce8"],["87b5ae1277f0efac"],["efa870d293a72444"]]},{"id":"51bbc4a533eb9ff4","type":"switch","z":"8956dc3ee8fd243d","name":"","property":"payload.press","propertyType":"msg","rules":[{"t":"eq","v":"up","vt":"str"},{"t":"eq","v":"down","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":300,"wires":[["d7459434ff4a2a3a"],["09d96498cce79fbd"]]},{"id":"03a3b553312220e1","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 30%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"a353695519864d83","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 10%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"55c3ddbaf6cd47de","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 60%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":360,"wires":[[]]},{"id":"8b968c77b4d69309","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 100%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"100","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":520,"wires":[[]]},{"id":"78b4dd59aa2ed05a","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 20%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":200,"wires":[[]]},{"id":"8614f51a51e143a2","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 40%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":280,"wires":[[]]},{"id":"11333f292af40124","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 50%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"87b5ae1277f0efac","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 80%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":440,"wires":[[]]},{"id":"e0a129a5c7c13ce8","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 70%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"70","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":400,"wires":[[]]},{"id":"efa870d293a72444","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Bright 90%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"90","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":480,"wires":[[]]},{"id":"8cbac896b3420b78","type":"change","z":"8956dc3ee8fd243d","g":"dda0a4b9ab361a79","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.bright","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]}]

I’ll clean these up more and add some details explaining the pico later.

Now a simple flow to control room lighting using a motion sensor as a toggle. Using a bathroom shower as an example, When you enter the shower you pass a motion sensor directed across the shower doors opening. this turns on the shower lights and bathroom fan. When you get out of the shower it cuts off the lights and the fan after a set time. (I actually use a custom built IR Led and detector array across the door of my shower for detection, but that requires an entirely different write up to discuss)

Click for the flow [{"id":"fba09e41f46ea215","type":"tab","label":"Flow 7","disabled":false,"info":"","env":[]},{"id":"b4dbb28a53b36931","type":"switch","z":"fba09e41f46ea215","name":"Activated","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":120,"y":280,"wires":[["2e8f442bc54f07d4"]]},{"id":"cedb0e320f81e41c","type":"stoptimer2","z":"fba09e41f46ea215","duration":"5","durationType":"num","units":"Second","payloadtype":"str","payloadval":"0","name":"","x":840,"y":240,"wires":[["d0dd66e6040d553f"],[]]},{"id":"8d82e8f6030bd713","type":"Tasmota Light","z":"fba09e41f46ea215","broker":"fb8e22de96fd2cb7","device":"Lights/MasterBath/Fan","name":"Fan","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1730,"y":200,"wires":[[]]},{"id":"56a268b0b2078254","type":"change","z":"fba09e41f46ea215","name":"Lights On 30%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 30\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":260,"wires":[["8fad1daf8c22d5a7"]]},{"id":"2e8f442bc54f07d4","type":"change","z":"fba09e41f46ea215","name":"Occupied?","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"bathroom","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":280,"wires":[["cccec6e3141a07fe"]]},{"id":"cccec6e3141a07fe","type":"switch","z":"fba09e41f46ea215","name":"yes/no","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":" occupied","vt":"str"},{"t":"eq","v":" unoccupied","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":280,"wires":[["7f02e972513f70fc"],["574dd5eb3e648b01"]]},{"id":"7f02e972513f70fc","type":"change","z":"fba09e41f46ea215","name":"Set unoccupied","rules":[{"t":"delete","p":"bathroom","pt":"flow"},{"t":"set","p":"payload","pt":"msg","to":" unoccupied","tot":"str"},{"t":"set","p":"bathroom","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":260,"wires":[["cedb0e320f81e41c"]]},{"id":"574dd5eb3e648b01","type":"change","z":"fba09e41f46ea215","name":"Set occupied","rules":[{"t":"delete","p":"bathroom","pt":"flow"},{"t":"set","p":"payload","pt":"msg","to":" occupied","tot":"str"},{"t":"set","p":"bathroom","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":300,"wires":[["810428eb67f8f862"]]},{"id":"d0dd66e6040d553f","type":"change","z":"fba09e41f46ea215","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":220,"wires":[["7081abb418b0f23f","83a26d8f697aeda4"]]},{"id":"83a26d8f697aeda4","type":"Tasmota Light","z":"fba09e41f46ea215","broker":"fb8e22de96fd2cb7","device":"Lights/MasterBath/Shower","name":"Shower","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1740,"y":240,"wires":[[]]},{"id":"810428eb67f8f862","type":"time-range-switch","z":"fba09e41f46ea215","name":"Sleep?","lat":"38.443237","lon":"-75.478854","startTime":"00:00","endTime":"08:00","startOffset":0,"endOffset":0,"x":820,"y":280,"wires":[["56a268b0b2078254"],["c19450161171d416"]]},{"id":"c19450161171d416","type":"change","z":"fba09e41f46ea215","name":"Lights On 100%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 100\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":300,"wires":[["8fad1daf8c22d5a7"]]},{"id":"d9c4058b23f8ce6b","type":"zigbee2mqtt-in","z":"fba09e41f46ea215","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Bathroom Motion","device_id":"0x000d6f001099ed24","state":"occupancy","outputAtStartup":false,"x":100,"y":200,"wires":[["b4dbb28a53b36931"]]},{"id":"8fad1daf8c22d5a7","type":"function","z":"fba09e41f46ea215","name":"> msg.payload","func":"var newMsg = { payload: msg.payload, topic: msg.topic};\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1420,"y":300,"wires":[["83a26d8f697aeda4","8d82e8f6030bd713"]]},{"id":"7081abb418b0f23f","type":"stoptimer2","z":"fba09e41f46ea215","duration":"10","durationType":"num","units":"Minute","payloadtype":"str","payloadval":"0","name":"","x":1440,"y":160,"wires":[["8d82e8f6030bd713"],[]]},{"id":"fb8e22de96fd2cb7","type":"tasmota-mqtt-broker","name":"Pi","broker":"10.10.2.1","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"}]

Mail delivery alerts, repeating audio until retrieved, and a single text/pushover notification on delivery

Click for the flow[{"id":"66c6ac8b0d062392","type":"tab","label":"Flow 8","disabled":false,"info":"","env":[]},{"id":"283f60611a014418","type":"group","z":"66c6ac8b0d062392","name":"Pushover","style":{"stroke":"#92d04f","fill":"#92d04f","label":true,"color":"#000000"},"nodes":["b629fe7df0d3a416","424c3bcf6bab4fb8"],"x":1214,"y":439,"w":212,"h":122},{"id":"690bdad30f85cd4d","type":"switch","z":"66c6ac8b0d062392","name":"Activated","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":320,"y":100,"wires":[["f96daf938d5de42e"]]},{"id":"f96daf938d5de42e","type":"switch","z":"66c6ac8b0d062392","name":"status","property":"mail","propertyType":"flow","rules":[{"t":"eq","v":"retrieved","vt":"str"},{"t":"eq","v":"delivered","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":100,"wires":[["9c8e116a8d71e62f"],["dca91b44c26c6d6b"]]},{"id":"824b2a393c588453","type":"change","z":"66c6ac8b0d062392","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":180,"wires":[["39c33ff294dc9d55"]]},{"id":"39c33ff294dc9d55","type":"stoptimer2","z":"66c6ac8b0d062392","duration":"15","durationType":"num","units":"Minute","payloadtype":"str","payloadval":"0","name":"","x":1240,"y":140,"wires":[["8748f6a8fe64cd7f","bc66a6659cbdfa6d"],[]]},{"id":"9c8e116a8d71e62f","type":"change","z":"66c6ac8b0d062392","name":"Set delivered","rules":[{"t":"delete","p":"#:(file)::mail","pt":"flow"},{"t":"set","p":"payload","pt":"msg","to":"delivered","tot":"str"},{"t":"set","p":"#:(file)::mail","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":80,"wires":[["39c33ff294dc9d55","bc66a6659cbdfa6d","5cf5c683e03bd20f"]]},{"id":"dca91b44c26c6d6b","type":"change","z":"66c6ac8b0d062392","name":"Set Retrieved","rules":[{"t":"delete","p":"#:(file)::mail","pt":"flow"},{"t":"set","p":"payload","pt":"msg","to":"retrieved","tot":"str"},{"t":"set","p":"#:(file)::mail","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":140,"wires":[["824b2a393c588453"]]},{"id":"8748f6a8fe64cd7f","type":"delay","z":"66c6ac8b0d062392","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":1240,"y":200,"wires":[["39c33ff294dc9d55"]]},{"id":"ee7a17358f92cb2b","type":"cast-to-client","z":"66c6ac8b0d062392","name":"Got Mail","url":"http://r3iot.duckdns.org:81/public/oh-la/gotmail.mp3","contentType":"","message":"","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1500,"y":80,"wires":[[]]},{"id":"bc66a6659cbdfa6d","type":"change","z":"66c6ac8b0d062392","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"devicename","pt":"msg"},{"t":"delete","p":"device","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":80,"wires":[["ee7a17358f92cb2b"]]},{"id":"ab887463c1515e5f","type":"zigbee2mqtt-in","z":"66c6ac8b0d062392","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Mailbox Motion","device_id":"0x000d6f00056b4625","state":"0","outputAtStartup":false,"x":120,"y":100,"wires":[["690bdad30f85cd4d"]]},{"id":"ef89cb7a2a2254fd","type":"function","z":"66c6ac8b0d062392","name":"Compose Mail message","func":"var timeAsString = msg.mytimes;\n\nmsg.payload = ' Mail Delivered at ' + \n timeAsString + '.';\n \nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1070,"y":400,"wires":[["95aa03ca1ed23d6b","424c3bcf6bab4fb8","b629fe7df0d3a416"]]},{"id":"5cf5c683e03bd20f","type":"change","z":"66c6ac8b0d062392","name":"","rules":[{"t":"delete","p":"","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":340,"wires":[["b1f342b10aa3783c"]]},{"id":"b1f342b10aa3783c","type":"simpletime","z":"66c6ac8b0d062392","name":"","mydate":false,"myymd":false,"myyear":false,"mymonth":false,"mymonthn":false,"mydom":false,"mydoy":false,"myday":false,"myhourpm":false,"myhour":false,"mytime":false,"mytimes":true,"myminute":false,"myminutes":false,"mysecond":false,"mymillis":false,"myepoch":false,"myrawdate":false,"mypm":false,"x":1200,"y":340,"wires":[["ef89cb7a2a2254fd"]]},{"id":"95aa03ca1ed23d6b","type":"e-mail","z":"66c6ac8b0d062392","server":"smtp.gmail.com","port":"465","secure":true,"tls":false,"name":"[email protected]","dname":"","x":1370,"y":400,"wires":[]},{"id":"b629fe7df0d3a416","type":"pushbullet","z":"66c6ac8b0d062392","g":"283f60611a014418","config":"621272084c7c367f","pushtype":"note","title":"Test Alert","chan":"","name":"","x":1340,"y":520,"wires":[]},{"id":"424c3bcf6bab4fb8","type":"pushover api","z":"66c6ac8b0d062392","g":"283f60611a014418","keys":"20e16983c835c6e7","title":"","name":"","x":1300,"y":480,"wires":[]},{"id":"762d79eafaed70e9","type":"comment","z":"66c6ac8b0d062392","name":"Send alert on mail delivery. Text, or pushover","info":"","x":1250,"y":300,"wires":[]},{"id":"b94bb8a7777f3bae","type":"comment","z":"66c6ac8b0d062392","name":"when activity is detected check current status and toggle to the opposite","info":"","x":410,"y":40,"wires":[]},{"id":"d0b7c5e196db6880","type":"comment","z":"66c6ac8b0d062392","name":"Play audio alert that mail has been delivered, and repeat every 15 minutes until mail is retrieved","info":"","x":1290,"y":40,"wires":[]},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"},{"id":"621272084c7c367f","type":"pushbullet-config","name":"MAin"},{"id":"20e16983c835c6e7","type":"pushover-keys","name":"test"}]
4 Likes

RFID Card reading used to lock/unlock a door.

Click for the flow[{"id":"ba499b46380811aa","type":"mqtt in","z":"05bddb76890eb7d6","name":"","topic":"Wifi/frontdoor/Rfid/Tag/#","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":140,"y":620,"wires":[["84f836658bd1fe14"]]},{"id":"84f836658bd1fe14","type":"switch","z":"05bddb76890eb7d6","name":"Allowed Cards","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"209342026","vt":"str"},{"t":"eq","v":"1945369859","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":620,"wires":[["0eb6920186bb45c7"],["0eb6920186bb45c7"]]},{"id":"9694abfa3f5941e7","type":"zigbee2mqtt-out","z":"05bddb76890eb7d6","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Front Door Lock","device_id":"0x002446fffd038d6c","command":"state","commandType":"z2m_cmd","payload":"payload","payloadType":"msg","x":820,"y":620,"wires":[]},{"id":"641fb84cd55576b9","type":"change","z":"05bddb76890eb7d6","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"#:(file)::frontdoorlock","pt":"global","to":"unlocked","tot":"str"},{"t":"set","p":"payload.state","pt":"msg","to":"UNLOCK","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":600,"wires":[["9694abfa3f5941e7"]]},{"id":"d7d3455c3578810a","type":"change","z":"05bddb76890eb7d6","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"#:(file)::frontdoorlock","pt":"global","to":"locked","tot":"str"},{"t":"set","p":"payload.state","pt":"msg","to":"LOCK","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":640,"wires":[["9694abfa3f5941e7"]]},{"id":"0eb6920186bb45c7","type":"switch","z":"05bddb76890eb7d6","name":"","property":"#:(file)::frontdoorlock","propertyType":"global","rules":[{"t":"eq","v":"locked","vt":"str"},{"t":"eq","v":"unlocked","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":620,"wires":[["641fb84cd55576b9"],["d7d3455c3578810a"]]},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"}]

Using a sonar detector to tell if someone comes to the door. (automatic doorbell)

Click for the flow[{"id":"0e1551eafb680705","type":"mqtt in","z":"05bddb76890eb7d6","name":"","topic":"Wifi/frontdoor/Sonar/Distance","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":700,"wires":[["2b22ea03aed534e7"]]},{"id":"2b22ea03aed534e7","type":"switch","z":"05bddb76890eb7d6","name":"on porch","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"10","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":700,"wires":[["9eb82cb9390bd203"]]},{"id":"11db6e91d9e975fe","type":"delay","z":"05bddb76890eb7d6","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":660,"y":700,"wires":[["30f393bb8bec3f92"]]},{"id":"30f393bb8bec3f92","type":"cast-to-client","z":"05bddb76890eb7d6","name":"","url":"","contentType":"","message":"No need to knock friend, this is an automated doorbell!","language":"en","ip":"192.168.24.32","port":"","volume":"","x":850,"y":700,"wires":[[]]},{"id":"9eb82cb9390bd203","type":"change","z":"05bddb76890eb7d6","name":"cleanup","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":700,"wires":[["11db6e91d9e975fe"]]},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

Simple scheduled actions

Utilizing the Light scheduler node we can quickly and easily create complex scheduled triggers. Perfect for watering plants, grow lights, holiday lighting, pool pumps/filters/heaters, etc. This node allows time windows as small as 10 minutes. It also features an optional dusk feature, which can be used to prevent triggers before sunset, perfect for year round outdoor lighting

Click for the flow[{"id":"05bddb76890eb7d6","type":"tab","label":"Parlor Motion","disabled":false,"info":""},{"id":"483ab0be4d19ed9a","type":"group","z":"05bddb76890eb7d6","name":"Parlor Lights","style":{"stroke":"#ffC000","label":true,"label-position":"n","color":"#000000"},"nodes":["0838e73f842305df","d6941eb65d6741e8","b69434b4ea35d877","d4a489c929f8f253"],"x":1294,"y":19,"w":192,"h":202},{"id":"cc23dfce71140f27","type":"light-scheduler","z":"05bddb76890eb7d6","settings":"3c453e69b99289c8","events":"[{\"start\":{\"dow\":4,\"mod\":1140},\"end\":{\"dow\":4,\"mod\":1335}},{\"start\":{\"dow\":5,\"mod\":1140},\"end\":{\"dow\":5,\"mod\":1335}},{\"start\":{\"dow\":6,\"mod\":1140},\"end\":{\"dow\":6,\"mod\":1335}},{\"start\":{\"dow\":0,\"mod\":1140},\"end\":{\"dow\":0,\"mod\":1335}},{\"start\":{\"dow\":3,\"mod\":1140},\"end\":{\"dow\":3,\"mod\":1335}},{\"start\":{\"dow\":1,\"mod\":1140},\"end\":{\"dow\":1,\"mod\":1335}},{\"start\":{\"dow\":2,\"mod\":1140},\"end\":{\"dow\":2,\"mod\":1335}},{\"start\":{\"dow\":2,\"mod\":1080},\"end\":{\"dow\":2,\"mod\":1140}},{\"start\":{\"dow\":3,\"mod\":1080},\"end\":{\"dow\":3,\"mod\":1140}},{\"start\":{\"dow\":4,\"mod\":1080},\"end\":{\"dow\":4,\"mod\":1140}},{\"start\":{\"dow\":5,\"mod\":1080},\"end\":{\"dow\":5,\"mod\":1140}},{\"start\":{\"dow\":6,\"mod\":1080},\"end\":{\"dow\":6,\"mod\":1140}},{\"start\":{\"dow\":0,\"mod\":1080},\"end\":{\"dow\":0,\"mod\":1140}},{\"start\":{\"dow\":1,\"mod\":1050},\"end\":{\"dow\":1,\"mod\":1140}},{\"start\":{\"dow\":2,\"mod\":1050},\"end\":{\"dow\":2,\"mod\":1080}},{\"start\":{\"dow\":3,\"mod\":1050},\"end\":{\"dow\":3,\"mod\":1080}},{\"start\":{\"dow\":4,\"mod\":1050},\"end\":{\"dow\":4,\"mod\":1080}},{\"start\":{\"dow\":5,\"mod\":1050},\"end\":{\"dow\":5,\"mod\":1080}},{\"start\":{\"dow\":6,\"mod\":1050},\"end\":{\"dow\":6,\"mod\":1080}},{\"start\":{\"dow\":0,\"mod\":1050},\"end\":{\"dow\":0,\"mod\":1080}},{\"start\":{\"dow\":0,\"mod\":1035},\"end\":{\"dow\":0,\"mod\":1050}},{\"start\":{\"dow\":1,\"mod\":1335},\"end\":{\"dow\":1,\"mod\":1380}},{\"start\":{\"dow\":2,\"mod\":1335},\"end\":{\"dow\":2,\"mod\":1380}},{\"start\":{\"dow\":3,\"mod\":1335},\"end\":{\"dow\":3,\"mod\":1380}},{\"start\":{\"dow\":4,\"mod\":1335},\"end\":{\"dow\":4,\"mod\":1380}},{\"start\":{\"dow\":5,\"mod\":1335},\"end\":{\"dow\":5,\"mod\":1380}},{\"start\":{\"dow\":6,\"mod\":1335},\"end\":{\"dow\":6,\"mod\":1380}},{\"start\":{\"dow\":0,\"mod\":1335},\"end\":{\"dow\":0,\"mod\":1380}},{\"start\":{\"dow\":1,\"mod\":1380},\"end\":{\"dow\":1,\"mod\":1395}},{\"start\":{\"dow\":2,\"mod\":1380},\"end\":{\"dow\":2,\"mod\":1395}},{\"start\":{\"dow\":3,\"mod\":1380},\"end\":{\"dow\":3,\"mod\":1395}},{\"start\":{\"dow\":5,\"mod\":1380},\"end\":{\"dow\":5,\"mod\":1395}},{\"start\":{\"dow\":4,\"mod\":1380},\"end\":{\"dow\":4,\"mod\":1395}},{\"start\":{\"dow\":6,\"mod\":1380},\"end\":{\"dow\":6,\"mod\":1395}},{\"start\":{\"dow\":0,\"mod\":1380},\"end\":{\"dow\":0,\"mod\":1395}},{\"start\":{\"dow\":6,\"mod\":1035},\"end\":{\"dow\":6,\"mod\":1050}},{\"start\":{\"dow\":5,\"mod\":1035},\"end\":{\"dow\":5,\"mod\":1050}},{\"start\":{\"dow\":4,\"mod\":1035},\"end\":{\"dow\":4,\"mod\":1050}},{\"start\":{\"dow\":3,\"mod\":1035},\"end\":{\"dow\":3,\"mod\":1050}},{\"start\":{\"dow\":2,\"mod\":1035},\"end\":{\"dow\":2,\"mod\":1050}},{\"start\":{\"dow\":1,\"mod\":900},\"end\":{\"dow\":1,\"mod\":1050}},{\"start\":{\"dow\":2,\"mod\":900},\"end\":{\"dow\":2,\"mod\":1035}},{\"start\":{\"dow\":3,\"mod\":900},\"end\":{\"dow\":3,\"mod\":1035}},{\"start\":{\"dow\":4,\"mod\":900},\"end\":{\"dow\":4,\"mod\":1035}},{\"start\":{\"dow\":5,\"mod\":900},\"end\":{\"dow\":5,\"mod\":1035}},{\"start\":{\"dow\":6,\"mod\":900},\"end\":{\"dow\":6,\"mod\":1035}},{\"start\":{\"dow\":0,\"mod\":900},\"end\":{\"dow\":0,\"mod\":1035}}]","topic":"","name":"Power Schedule","onPayload":"on","onPayloadType":"str","offPayload":"off","offPayloadType":"str","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":140,"y":540,"wires":[["3b8cfc6896918827"]]},{"id":"a1589970036650eb","type":"switch","z":"05bddb76890eb7d6","name":"active?","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":640,"y":260,"wires":[["65de4449173ccd93","5fe744a110f5f4ba","407c46f95fa7e052"],["129786648bc7e8cd"]]},{"id":"65de4449173ccd93","type":"change","z":"05bddb76890eb7d6","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":220,"wires":[["129786648bc7e8cd"]]},{"id":"129786648bc7e8cd","type":"stoptimer2","z":"05bddb76890eb7d6","duration":"10","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1010,"y":240,"wires":[["f750a6f712771ef0","a8638af2d0d78ac4"],[]]},{"id":"5fe744a110f5f4ba","type":"time-range-switch","z":"05bddb76890eb7d6","name":"Sleep?","lat":"38.443237","lon":"-75.478854","startTime":"00:00","endTime":"08:00","startOffset":0,"endOffset":0,"x":840,"y":100,"wires":[["f7e30eb22cde7f8c"],["e4be968cf8c2b8bd"]]},{"id":"0838e73f842305df","type":"Tasmota Light","z":"05bddb76890eb7d6","g":"483ab0be4d19ed9a","broker":"fb8e22de96fd2cb7","device":"Lights/Parlor/FL","name":"Front Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1400,"y":100,"wires":[[]]},{"id":"d6941eb65d6741e8","type":"Tasmota Light","z":"05bddb76890eb7d6","g":"483ab0be4d19ed9a","broker":"fb8e22de96fd2cb7","device":"Lights/Parlor/BR","name":"Back Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1390,"y":180,"wires":[[]]},{"id":"b69434b4ea35d877","type":"Tasmota Light","z":"05bddb76890eb7d6","g":"483ab0be4d19ed9a","broker":"fb8e22de96fd2cb7","device":"Lights/Parlor/BL","name":"Back Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1400,"y":140,"wires":[[]]},{"id":"d4a489c929f8f253","type":"Tasmota Light","z":"05bddb76890eb7d6","g":"483ab0be4d19ed9a","broker":"fb8e22de96fd2cb7","device":"Lights/Parlor/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":1390,"y":60,"wires":[["5af109e6b1356705"]]},{"id":"be28f558f016e1aa","type":"delay","z":"05bddb76890eb7d6","name":"","pauseType":"delay","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1220,"y":100,"wires":[["d4a489c929f8f253","0838e73f842305df","b69434b4ea35d877","d6941eb65d6741e8"]]},{"id":"6fba609ca041cdad","type":"switch","z":"05bddb76890eb7d6","name":"Cosed/Open","property":"payload.contact","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":360,"wires":[["b2626ef9dded1a12"],["7a38bec7e8198412"]]},{"id":"df398f9635a7a3c8","type":"comment","z":"05bddb76890eb7d6","name":"Open = False Closed = True","info":"","x":180,"y":320,"wires":[]},{"id":"5af109e6b1356705","type":"change","z":"05bddb76890eb7d6","name":"Set Status","rules":[{"t":"delete","p":"#:(file)::FRPower","pt":"flow"},{"t":"set","p":"#:(file)::FRPower","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1550,"y":60,"wires":[[]]},{"id":"7a9debe05543e8b5","type":"switch","z":"05bddb76890eb7d6","name":"Off?","property":"payload.on","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":340,"wires":[["e054ad37572e5d34"],["93b37d1ecbd9bb1b"]]},{"id":"e054ad37572e5d34","type":"cast-to-client","z":"05bddb76890eb7d6","name":"front door","url":"http://r3iot.duckdns.org:81/public/oh-la/frontdoor.mp3","contentType":"","message":"","language":"en","ip":"192.168.24.22","port":"","volume":"75","x":800,"y":340,"wires":[[]]},{"id":"e4be968cf8c2b8bd","type":"change","z":"05bddb76890eb7d6","name":"Lights On 30%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 30\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":140,"wires":[["be28f558f016e1aa"]]},{"id":"f7e30eb22cde7f8c","type":"change","z":"05bddb76890eb7d6","name":"Lights On 10%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":60,"wires":[["be28f558f016e1aa"]]},{"id":"37fb63b13ac0b54b","type":"change","z":"05bddb76890eb7d6","name":"Lights On 20%","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 20\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":100,"wires":[["be28f558f016e1aa"]]},{"id":"f750a6f712771ef0","type":"change","z":"05bddb76890eb7d6","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":180,"wires":[["be28f558f016e1aa"]]},{"id":"d808917fd353ee01","type":"MagicHome UFO","z":"05bddb76890eb7d6","name":"Fishtank","ip":"192.168.24.156","style":"RGBW","x":1560,"y":260,"wires":[[]]},{"id":"4fb7848fa9e28868","type":"delay","z":"05bddb76890eb7d6","name":"","pauseType":"delay","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1420,"y":260,"wires":[["d808917fd353ee01"]]},{"id":"407c46f95fa7e052","type":"change","z":"05bddb76890eb7d6","name":"Magichome On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": true }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":280,"wires":[["4fb7848fa9e28868"]]},{"id":"a8638af2d0d78ac4","type":"change","z":"05bddb76890eb7d6","name":"Magichome Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ \"on\": false }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":240,"wires":[["4fb7848fa9e28868"]]},{"id":"3b8cfc6896918827","type":"delay","z":"05bddb76890eb7d6","name":"","pauseType":"delay","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":315,"y":540,"wires":[["97d6a02e57eca224"]]},{"id":"97d6a02e57eca224","type":"Tasmota Switch","z":"05bddb76890eb7d6","broker":"fb8e22de96fd2cb7","device":"Outlet/Parlor/Kindle","name":"Front Door Kindle Outlet","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":false,"x":525,"y":540,"wires":[[]]},{"id":"fbbf94abf4e4c1ab","type":"comment","z":"05bddb76890eb7d6","name":"Frontdoor Light Trigger Links --->","info":"","x":310,"y":460,"wires":[]},{"id":"93b37d1ecbd9bb1b","type":"link out","z":"05bddb76890eb7d6","name":"lights on","links":["d5150afecc5f5054"],"x":755,"y":380,"wires":[]},{"id":"7a38bec7e8198412","type":"link out","z":"05bddb76890eb7d6","name":"lights off","links":["4777c62.46a9538","3d2e985d1801b8af"],"x":555,"y":480,"wires":[]},{"id":"b2626ef9dded1a12","type":"change","z":"05bddb76890eb7d6","name":"Check Lights","rules":[{"t":"delete","p":"device","pt":"msg"},{"t":"delete","p":"deviceName","pt":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"#:(file)::FRPower","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":340,"wires":[["7a9debe05543e8b5"]]},{"id":"b8dc74eecab277df","type":"change","z":"05bddb76890eb7d6","name":"Set Motion Status","rules":[{"t":"delete","p":"motion1","pt":"flow"},{"t":"set","p":"motion1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":260,"wires":[["288849b765fbd3a5"]]},{"id":"288849b765fbd3a5","type":"change","z":"05bddb76890eb7d6","name":"Check Motion","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"motion1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":260,"wires":[["a1589970036650eb"]]},{"id":"ba499b46380811aa","type":"mqtt in","z":"05bddb76890eb7d6","name":"","topic":"Wifi/frontdoor/Rfid/Tag/#","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":140,"y":620,"wires":[["84f836658bd1fe14"]]},{"id":"84f836658bd1fe14","type":"switch","z":"05bddb76890eb7d6","name":"Allowed Cards","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"209342026","vt":"str"},{"t":"eq","v":"1945369859","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":620,"wires":[["0eb6920186bb45c7"],["0eb6920186bb45c7"]]},{"id":"9694abfa3f5941e7","type":"zigbee2mqtt-out","z":"05bddb76890eb7d6","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Front Door Lock","device_id":"0x002446fffd038d6c","command":"state","commandType":"z2m_cmd","payload":"payload","payloadType":"msg","x":820,"y":620,"wires":[]},{"id":"641fb84cd55576b9","type":"change","z":"05bddb76890eb7d6","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"#:(file)::frontdoorlock","pt":"global","to":"unlocked","tot":"str"},{"t":"set","p":"payload.state","pt":"msg","to":"UNLOCK","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":600,"wires":[["9694abfa3f5941e7"]]},{"id":"d7d3455c3578810a","type":"change","z":"05bddb76890eb7d6","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"#:(file)::frontdoorlock","pt":"global","to":"locked","tot":"str"},{"t":"set","p":"payload.state","pt":"msg","to":"LOCK","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":640,"wires":[["9694abfa3f5941e7"]]},{"id":"0eb6920186bb45c7","type":"switch","z":"05bddb76890eb7d6","name":"","property":"#:(file)::frontdoorlock","propertyType":"global","rules":[{"t":"eq","v":"locked","vt":"str"},{"t":"eq","v":"unlocked","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":620,"wires":[["641fb84cd55576b9"],["d7d3455c3578810a"]]},{"id":"0e1551eafb680705","type":"mqtt in","z":"05bddb76890eb7d6","name":"","topic":"Wifi/frontdoor/Sonar/Distance","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":700,"wires":[["2b22ea03aed534e7"]]},{"id":"2b22ea03aed534e7","type":"switch","z":"05bddb76890eb7d6","name":"on porch","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"10","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":700,"wires":[["9eb82cb9390bd203"]]},{"id":"11db6e91d9e975fe","type":"delay","z":"05bddb76890eb7d6","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":660,"y":700,"wires":[["30f393bb8bec3f92"]]},{"id":"30f393bb8bec3f92","type":"cast-to-client","z":"05bddb76890eb7d6","name":"","url":"","contentType":"","message":"No need to knock friend, this is an automated doorbell!","language":"en","ip":"192.168.24.32","port":"","volume":"","x":850,"y":700,"wires":[[]]},{"id":"9eb82cb9390bd203","type":"change","z":"05bddb76890eb7d6","name":"cleanup","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":700,"wires":[["11db6e91d9e975fe"]]},{"id":"301093f1580ddffc","type":"inject","z":"05bddb76890eb7d6","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":710,"y":300,"wires":[["e054ad37572e5d34"]]},{"id":"083093b4a6a46aad","type":"zigbee2mqtt-in","z":"05bddb76890eb7d6","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Parlor Motion","device_id":"0x000d6f00057d0e14","state":"occupancy","outputAtStartup":false,"x":90,"y":260,"wires":[["b8dc74eecab277df"]]},{"id":"4ed15f3653f982e0","type":"zigbee2mqtt-in","z":"05bddb76890eb7d6","name":"","server":"6c5abdd60ef1d8af","friendly_name":"Front Door Contact (IL06_1)","device_id":"0xd0cf5efffec8df3c","state":"contact","outputAtStartup":false,"filterChanges":true,"enableMultiple":false,"x":120,"y":360,"wires":[["6fba609ca041cdad"]]},{"id":"17b573bc92932a10","type":"inject","z":"05bddb76890eb7d6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":840,"y":180,"wires":[["f750a6f712771ef0"]]},{"id":"3c453e69b99289c8","type":"light-scheduler-settings","name":"my settings","latitude":"38.443035","longitude":"-75.478774"},{"id":"fb8e22de96fd2cb7","type":"tasmota-mqtt-broker","name":"Pi","broker":"10.10.2.1","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"6c5abdd60ef1d8af","type":"zigbee2mqtt-server","name":"zigbeemqtt","host":"10.10.2.1","mqtt_port":"1883","mqtt_username":"","mqtt_password":"","mqtt_qos":"0","tls":"","usetls":false,"base_topic":"zigbee2mqtt"}]
1 Like

Dual Presence tracking using Own tracks and wifi device detection via Unifi

Click for the flow[{"id":"1ab896a6bd959483","type":"tab","label":"Flow 9","disabled":false,"info":"","env":[]},{"id":"2292a1a0f4ee13a8","type":"mqtt in","z":"1ab896a6bd959483","name":"","topic":"owntracks/owntracks/rr/event","qos":"2","datatype":"json","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":180,"y":160,"wires":[["8ddd638c3e23df28"]]},{"id":"3047924e249337f8","type":"link out","z":"1ab896a6bd959483","name":"Rob Enters","links":["f65a5959.e31508","e1a897ebf6efdea6"],"x":915,"y":160,"wires":[]},{"id":"2ac294f78955e2c0","type":"function","z":"1ab896a6bd959483","name":".event->payload","func":"return {\n payload:msg.payload.event,\n }\n;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":160,"wires":[["3047924e249337f8"]]},{"id":"82512381254caabd","type":"comment","z":"1ab896a6bd959483","name":"Unifi","info":"","x":110,"y":240,"wires":[]},{"id":"dcab93b8ffeab6a4","type":"inject","z":"1ab896a6bd959483","name":"15sec","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":true,"onceDelay":"","topic":"","payload":"SiteStats","payloadType":"str","x":100,"y":340,"wires":[["77b7467dcc8ee947"]]},{"id":"77b7467dcc8ee947","type":"Unifi","z":"1ab896a6bd959483","name":"","ip":"192.168.0.1","port":"443","site":"default","command":"20","unifios":true,"x":330,"y":340,"wires":[["a8b6f0189402153a"]]},{"id":"a8b6f0189402153a","type":"function","z":"1ab896a6bd959483","name":"Determine device presence","func":"const lastSeenSeconds = 30;\nlet presenceCutoff = (new Date() - (lastSeenSeconds * 1000)) / 1000; \nconst people = {\n \"Unifi/Rob\": \"cc:0d:f2:47:0f:14\",\n \"test\": \"test\"\n};\n\nreturn Object.keys(people).map(function(topic) {\n let devices = msg.payload[0].filter(device => device.mac === people[topic] && device.last_seen > presenceCutoff);\n return {\n topic: topic,\n payload: devices.length > 0\n };\n});","outputs":"2","noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":340,"wires":[["532f07c85adff286"],[]],"outputLabels":["rob presence",""]},{"id":"532f07c85adff286","type":"rbe","z":"1ab896a6bd959483","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","x":810,"y":320,"wires":[["4cdeae6616ca51d1"]]},{"id":"4cdeae6616ca51d1","type":"link out","z":"1ab896a6bd959483","name":"unifi presence rob out","links":["c8f5458e.87fbd8","1ebd0c2c14364957"],"x":915,"y":320,"wires":[]},{"id":"8ddd638c3e23df28","type":"owntracks","z":"1ab896a6bd959483","x":410,"y":160,"wires":[["2ac294f78955e2c0","4fbc89504e09dd81"]]},{"id":"f670c9fa0e3dcc51","type":"change","z":"1ab896a6bd959483","name":"Set Rob OwnTracks ","rules":[{"t":"set","p":"#:(file)::RobOwnTracks","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":520,"wires":[["6a166cb955513963"]]},{"id":"f7bb69a98d0b9c5d","type":"change","z":"1ab896a6bd959483","name":"enter->home, leave->away","rules":[{"t":"change","p":"payload","pt":"msg","from":"enter","fromt":"str","to":"home","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"leave","fromt":"str","to":"away","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":520,"wires":[["f670c9fa0e3dcc51"]]},{"id":"fc1b9c6b563b4793","type":"comment","z":"1ab896a6bd959483","name":"OwnTracks Rob","info":"","x":160,"y":480,"wires":[]},{"id":"e1a897ebf6efdea6","type":"link in","z":"1ab896a6bd959483","name":"Rob Home Global ","links":["3047924e249337f8"],"x":95,"y":520,"wires":[["f7bb69a98d0b9c5d"]]},{"id":"1ebd0c2c14364957","type":"link in","z":"1ab896a6bd959483","name":"","links":["4cdeae6616ca51d1"],"x":95,"y":700,"wires":[["698ae1bf1588503b"]]},{"id":"e14bb00243fa4a9b","type":"comment","z":"1ab896a6bd959483","name":"Unifi Rob","info":"","x":120,"y":640,"wires":[]},{"id":"698ae1bf1588503b","type":"change","z":"1ab896a6bd959483","name":"false->away,true->home","rules":[{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"away","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"home","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":700,"wires":[["e8f403bcc39cc443"]]},{"id":"e8f403bcc39cc443","type":"change","z":"1ab896a6bd959483","name":"Rob Unifi Global","rules":[{"t":"set","p":"#:(file)::RobUnifi","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":700,"wires":[["aa413b92ed33f633"]]},{"id":"3bc957de1cdcb2e3","type":"switch","z":"1ab896a6bd959483","name":"Unifi home","property":"#:(file)::RobUnifi","propertyType":"global","rules":[{"t":"eq","v":"home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":930,"y":500,"wires":[["935b172a443ab3e0"]]},{"id":"6b13f6db93767073","type":"change","z":"1ab896a6bd959483","name":"Set Rob Home Status","rules":[{"t":"set","p":"#:(file)::RobHome","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1560,"y":580,"wires":[["312f5b37cae17c68"]]},{"id":"6a166cb955513963","type":"switch","z":"1ab896a6bd959483","name":"Owntracks Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":520,"wires":[["3bc957de1cdcb2e3"],["207b47d6e8a47544"]]},{"id":"207b47d6e8a47544","type":"switch","z":"1ab896a6bd959483","name":"Unifi away","property":"#:(file)::RobUnifi","propertyType":"global","rules":[{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":930,"y":540,"wires":[["4b100bb181e88e45"]]},{"id":"4b100bb181e88e45","type":"change","z":"1ab896a6bd959483","name":"set away","rules":[{"t":"set","p":"payload","pt":"msg","to":"away","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":600,"wires":[["db896122e972b6d9"]]},{"id":"935b172a443ab3e0","type":"change","z":"1ab896a6bd959483","name":"set home","rules":[{"t":"set","p":"payload","pt":"msg","to":"home","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":560,"wires":[["e5ae81709de05fcb"]]},{"id":"1b51552380761d75","type":"switch","z":"1ab896a6bd959483","name":"OwnTracks Home","property":"#:(file)::RobOwnTracks","propertyType":"global","rules":[{"t":"eq","v":"home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":680,"wires":[["935b172a443ab3e0"]]},{"id":"aa413b92ed33f633","type":"switch","z":"1ab896a6bd959483","name":"Unifi Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":700,"wires":[["1b51552380761d75"],["a18717c06b39a847"]]},{"id":"a18717c06b39a847","type":"switch","z":"1ab896a6bd959483","name":"OwnTracks Away","property":"#:(file)::RobOwnTracks","propertyType":"global","rules":[{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":850,"y":720,"wires":[["4b100bb181e88e45"]]},{"id":"1d80f78603ede2d7","type":"link out","z":"1ab896a6bd959483","name":"Rob has left","links":["595b84035321b8a3"],"x":1845,"y":620,"wires":[]},{"id":"ae8c660943febebf","type":"link out","z":"1ab896a6bd959483","name":"Rob is home","links":["4c54004af9ed8775","7f25955badaffa0e","4cc2d69d.aa7d68"],"x":1845,"y":520,"wires":[]},{"id":"312f5b37cae17c68","type":"switch","z":"1ab896a6bd959483","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1740,"y":580,"wires":[["ae8c660943febebf"],["1d80f78603ede2d7"]]},{"id":"6299dec0370c1d63","type":"rbe","z":"1ab896a6bd959483","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","x":1390,"y":580,"wires":[["6b13f6db93767073"]]},{"id":"e5ae81709de05fcb","type":"switch","z":"1ab896a6bd959483","name":"","property":"#:(file)::RobHome","propertyType":"global","rules":[{"t":"eq","v":"away","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1250,"y":560,"wires":[["6299dec0370c1d63"]]},{"id":"db896122e972b6d9","type":"switch","z":"1ab896a6bd959483","name":"","property":"#:(file)::RobHome","propertyType":"global","rules":[{"t":"eq","v":"home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1250,"y":600,"wires":[["6299dec0370c1d63"]]},{"id":"4fbc89504e09dd81","type":"debug","z":"1ab896a6bd959483","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":100,"wires":[]},{"id":"fb6df74cc8b591dd","type":"comment","z":"1ab896a6bd959483","name":"Link out nodes used to trigger automatons based on home/away status","info":"","x":1590,"y":480,"wires":[]},{"id":"36e7735bfd116a0b","type":"comment","z":"1ab896a6bd959483","name":"Owntracks Data arrives on MQTT server and is then decrypted, even status is moved to msg.payload","info":"","x":380,"y":40,"wires":[]},{"id":"f1b8f7f56006cc69","type":"comment","z":"1ab896a6bd959483","name":"link node sends current status to tracking flow below","info":"","x":1010,"y":120,"wires":[]},{"id":"80424278d6664364","type":"comment","z":"1ab896a6bd959483","name":"rbe node used to only allow data through if home status changes","info":"","x":910,"y":280,"wires":[]},{"id":"9da57daf2ece452b","type":"comment","z":"1ab896a6bd959483","name":"Check every 15 seconds for device wifi connection status","info":"","x":270,"y":300,"wires":[]},{"id":"ffd4ed9f04c49bcd","type":"comment","z":"1ab896a6bd959483","name":"If either changed compare status and require a match between both before changing home/away status","info":"","x":570,"y":620,"wires":[]},{"id":"3f121b945b76ba7c","type":"comment","z":"1ab896a6bd959483","name":"Set Master Home context to curent","info":"","x":1560,"y":620,"wires":[]},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
1 Like

This spot is reserved for more advanced/niche flows.

This first flow handles parsing my Tempest weather stations local UDP data, triggering audio alerts based on precip and wind speed, and also outputs all the data to a compact Node-Red Dashboard for quick visibility.

I have removed all nodes and flows related to climate control of my home, once I simplify all of that down into a single easy to follow flow I will share a flow for automatically adjusting your homes climate control based on outside temp and humidity as well as current room temps. :wink:


Click me for the flow! [{"id":"3da77520f154df13","type":"tab","label":"Weather","disabled":false,"info":""},{"id":"87e30ff7f2f99fbf","type":"udp in","z":"3da77520f154df13","name":"Tempest Listener","iface":"","port":"50222","ipv":"udp4","multicast":"false","group":"255.255.255.0","datatype":"utf8","x":120,"y":40,"wires":[["219af2eaecec6135"]]},{"id":"219af2eaecec6135","type":"json","z":"3da77520f154df13","name":"Convert","property":"payload","action":"obj","pretty":false,"x":330,"y":60,"wires":[["46c630f5dd2344e9"]]},{"id":"46c630f5dd2344e9","type":"switch","z":"3da77520f154df13","name":"Seperate data by udp type","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"hub_status","vt":"str"},{"t":"eq","v":"device_status","vt":"str"},{"t":"eq","v":"obs_st","vt":"str"},{"t":"eq","v":"evt_precip","vt":"str"},{"t":"eq","v":"evt_strike","vt":"str"},{"t":"eq","v":"rapid_wind","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":7,"x":195,"y":180,"wires":[[],[],["75f0c31d37f60e23","9de7b17e4dd5c742","15329b55eca1875e","34c8b33675e8ab45","0158676ad5d646b5"],["e160c3b4f95ca133"],[],["0ca4c6cee5ce0eb3","e09cb49a1da1723e"],[]]},{"id":"0ca4c6cee5ce0eb3","type":"change","z":"3da77520f154df13","name":"wind speed","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ob[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":380,"wires":[["096962957b847207"]]},{"id":"096962957b847207","type":"function","z":"3da77520f154df13","name":"mps->MPH","func":"msg.payload = msg.payload * 2.23694;\nmsg.payload = parseFloat(msg.payload. toFixed(0))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":380,"wires":[["7cc00870f493ac4f","3923f6c4867d081f"]]},{"id":"e160c3b4f95ca133","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"delete","p":"time","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":120,"wires":[["ee2dd60f0bdf692a","5a2b304f1e56332f","e4f44f4e8556e322"]]},{"id":"7cc00870f493ac4f","type":"switch","z":"3da77520f154df13","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"20","vt":"num","v2":"29","v2t":"num"},{"t":"btwn","v":"30","vt":"num","v2":"39","v2t":"num"},{"t":"btwn","v":"40","vt":"num","v2":"49","v2t":"num"},{"t":"btwn","v":"50","vt":"num","v2":"59","v2t":"num"},{"t":"btwn","v":"60","vt":"num","v2":"69","v2t":"num"},{"t":"btwn","v":"70","vt":"num","v2":"79","v2t":"num"},{"t":"btwn","v":"80","vt":"num","v2":"89","v2t":"num"},{"t":"btwn","v":"90","vt":"num","v2":"99","v2t":"num"},{"t":"gte","v":"100","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":470,"y":620,"wires":[["be51e4594edbb491"],["4968bd0624219c65"],["d07ab3b29be27b98"],["147fbf85673b295b"],["67e95c20b3832fbc"],["d9d80656eca11596"],["791d07cbf21c255e"],["b2e55fab776be891"],["4d363000e04354dc"]]},{"id":"58747dea1bbbc35d","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":800,"wires":[["9c4b4dcda75b6b0c"]]},{"id":"5d20b269a186e6e7","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":755,"wires":[["e097221da38a52fb"]]},{"id":"0850f56ea84f4464","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":710,"wires":[["05f1b9eb4480e49c"]]},{"id":"3035f68661e681de","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":665,"wires":[["bf5a1ddd8f5eab28"]]},{"id":"9558bc0b28199518","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":620,"wires":[["9a0dff6ea1855424"]]},{"id":"6505ec25010d242f","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":575,"wires":[["438f21c34d9a4a96"]]},{"id":"16d67273e63f50ae","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":530,"wires":[["a2307e48ea9d9c17"]]},{"id":"3496dafb0e086c1b","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":485,"wires":[["08074eb4c78335da"]]},{"id":"3567064d414ec51d","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"delete","p":"fromip","pt":"msg"},{"t":"delete","p":"ip","pt":"msg"},{"t":"delete","p":"port","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":440,"wires":[["a30e2afac20e79c2"]]},{"id":"be51e4594edbb491","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":440,"wires":[["3567064d414ec51d"]]},{"id":"4968bd0624219c65","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":485,"wires":[["3496dafb0e086c1b"]]},{"id":"d07ab3b29be27b98","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":530,"wires":[["16d67273e63f50ae"]]},{"id":"147fbf85673b295b","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":575,"wires":[["6505ec25010d242f"]]},{"id":"67e95c20b3832fbc","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":620,"wires":[["9558bc0b28199518"]]},{"id":"d9d80656eca11596","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":665,"wires":[["3035f68661e681de"]]},{"id":"791d07cbf21c255e","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":710,"wires":[["0850f56ea84f4464"]]},{"id":"b2e55fab776be891","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":755,"wires":[["5d20b269a186e6e7"]]},{"id":"4d363000e04354dc","type":"delay","z":"3da77520f154df13","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"outputs":1,"x":815,"y":800,"wires":[["58747dea1bbbc35d"]]},{"id":"ee2dd60f0bdf692a","type":"cast-to-client","z":"3da77520f154df13","name":"Rain","url":"http:/r3iot.duckdns.org:81/public/oh-la/rain.mp3","contentType":"","message":"","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1270,"y":60,"wires":[[]]},{"id":"a2307e48ea9d9c17","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +40","url":"","contentType":"","message":"Wind Speeds over 40 detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":530,"wires":[[]]},{"id":"438f21c34d9a4a96","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +50","url":"","contentType":"","message":"Take down the flag! Wind speeds over 50 detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":575,"wires":[[]]},{"id":"9a0dff6ea1855424","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +60","url":"","contentType":"","message":"Stuffs starting to blow away. 60 MPH winds detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":620,"wires":[[]]},{"id":"bf5a1ddd8f5eab28","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +70","url":"","contentType":"","message":"Shit winds exceeding 70 MPH","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":665,"wires":[[]]},{"id":"05f1b9eb4480e49c","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +80","url":"","contentType":"","message":"We are going to Oz! 80 Mile winds detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":710,"wires":[[]]},{"id":"e097221da38a52fb","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +90","url":"","contentType":"","message":"Batten down the hatches! 90 Mile winds detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":755,"wires":[[]]},{"id":"9c4b4dcda75b6b0c","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +100","url":"","contentType":"","message":"Holy Shit The towns blowing away! Wind speed over 100 detected!","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1195,"y":800,"wires":[[]]},{"id":"08074eb4c78335da","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +30","url":"","contentType":"","message":"Its a bit gusty... 30+ Winds detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1185,"y":485,"wires":[[]]},{"id":"a30e2afac20e79c2","type":"cast-to-client","z":"3da77520f154df13","name":"Wind +20","url":"","contentType":"","message":"20+ Breeze detected","language":"en","ip":"192.168.24.28","port":"32000","volume":"50","x":1180,"y":440,"wires":[[]]},{"id":"5a2b304f1e56332f","type":"cast-to-client","z":"3da77520f154df13","name":"Rain","url":"http:/r3iot.duckdns.org:81/public/oh-la/rain.mp3","contentType":"","message":"","language":"en","ip":"192.168.24.33","port":"8009","volume":"50","x":1410,"y":100,"wires":[[]]},{"id":"e4f44f4e8556e322","type":"cast-to-client","z":"3da77520f154df13","name":"Rain","url":"http:/r3iot.duckdns.org:81/public/oh-la/rain.mp3","contentType":"","message":"","language":"en","ip":"192.168.24.22","port":"8009","volume":"50","x":1550,"y":60,"wires":[[]]},{"id":"38597debc2296da8","type":"ui_text","z":"3da77520f154df13","group":"cd80a0392bd23876","order":8,"width":0,"height":0,"name":"","label":"Wind Speed","format":"{{msg.payload}} ","layout":"col-center","x":1590,"y":340,"wires":[]},{"id":"f47a65fd7c97ba9b","type":"unit-converter","z":"3da77520f154df13","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":true,"outputFieldDecimals":"2","name":"C->F","x":710,"y":260,"wires":[["6885476c3fe32ecf"]]},{"id":"6885476c3fe32ecf","type":"ui_text","z":"3da77520f154df13","group":"cd80a0392bd23876","order":8,"width":0,"height":0,"name":"","label":"Temperature","format":"{{msg.payload}} F","layout":"col-center","x":1070,"y":200,"wires":[]},{"id":"75f0c31d37f60e23","type":"change","z":"3da77520f154df13","name":"temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.obs[0][7]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":260,"wires":[["f47a65fd7c97ba9b","b7559102969bc9a5"]]},{"id":"9de7b17e4dd5c742","type":"change","z":"3da77520f154df13","name":"humidity","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.obs[0][8]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":240,"wires":[["b17519250ed899fc"]]},{"id":"b17519250ed899fc","type":"ui_gauge","z":"3da77520f154df13","name":"","group":"cd80a0392bd23876","order":9,"width":0,"height":0,"gtype":"gage","title":"Relative Humidity","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"60","seg2":"80","x":890,"y":200,"wires":[]},{"id":"15329b55eca1875e","type":"change","z":"3da77520f154df13","name":"Prcipitation","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.obs[0][13]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":220,"wires":[["0d01048c498bfed1"]]},{"id":"beeef1eb3516aa18","type":"ui_text","z":"3da77520f154df13","group":"cd80a0392bd23876","order":8,"width":0,"height":0,"name":"","label":"Precipitation","format":"{{msg.payload}}","layout":"col-center","x":990,"y":160,"wires":[]},{"id":"0d01048c498bfed1","type":"change","z":"3da77520f154df13","name":"# to type","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"none","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"rain","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"num","to":"hail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":200,"wires":[["beeef1eb3516aa18"]]},{"id":"34c8b33675e8ab45","type":"change","z":"3da77520f154df13","name":"UV","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.obs[0][10]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":200,"wires":[["3f0ac380e61d1a75"]]},{"id":"3f0ac380e61d1a75","type":"ui_text","z":"3da77520f154df13","group":"cd80a0392bd23876","order":8,"width":0,"height":0,"name":"","label":"UV Index","format":"{{msg.payload}}","layout":"col-center","x":820,"y":160,"wires":[]},{"id":"c7632a686f483f49","type":"ui_chart","z":"3da77520f154df13","name":"","group":"cd80a0392bd23876","order":12,"width":0,"height":0,"label":"Pressure Mb","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"990","ymax":"1020","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1190,"y":160,"wires":[[]]},{"id":"0158676ad5d646b5","type":"change","z":"3da77520f154df13","name":"Pressure","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.obs[0][6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":180,"wires":[["c7632a686f483f49"]]},{"id":"717d74274f730f02","type":"change","z":"3da77520f154df13","name":"Convert Wind Direction in Degrees To Cardinal points","rules":[{"t":"set","p":"directions","pt":"flow","to":"$exists($flowContext(\"directions\")) ? $flowContext(\"directions\") : [\"N\", \"NNE\", \"NE\", \"ENE\", \"E\", \"ESE\", \"SE\", \"SSE\", \"S\", \"SSW\", \"SW\", \"WSW\", \"W\", \"WNW\", \"NW\", \"NNW\"] ","tot":"jsonata"},{"t":"set","p":"index","pt":"msg","to":"$string($floor((payload / 22.5) + 0.5) % 16)","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"$flowContext(\"directions[\"&index&\"]\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":340,"wires":[["2942d61c9553b697"]]},{"id":"e09cb49a1da1723e","type":"change","z":"3da77520f154df13","name":"wind direction","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ob[2]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":340,"wires":[["717d74274f730f02"]]},{"id":"aa048c4751692fcc","type":"join","z":"3da77520f154df13","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1290,"y":340,"wires":[["e7b27072d9a0cfd6"]]},{"id":"2942d61c9553b697","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"set","p":"parts.index","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":340,"wires":[["aa048c4751692fcc"]]},{"id":"c819b0e6a8ae3dbb","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"set","p":"parts.index","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":380,"wires":[["aa048c4751692fcc"]]},{"id":"2b1472de71f8211d","type":"inject","z":"3da77520f154df13","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":970,"y":40,"wires":[["ee2dd60f0bdf692a"]]},{"id":"548c2a964349babc","type":"change","z":"3da77520f154df13","name":"","rules":[{"t":"set","p":"#:(file)::temp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":280,"wires":[[]]},{"id":"b7559102969bc9a5","type":"unit-converter","z":"3da77520f154df13","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":true,"outputFieldDecimals":"0","name":"C->F","x":690,"y":300,"wires":[["548c2a964349babc"]]},{"id":"6c1db46bc5ef81cc","type":"change","z":"3da77520f154df13","name":"global.wind","rules":[{"t":"set","p":"#:(file)::wind","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1590,"y":380,"wires":[[]]},{"id":"3923f6c4867d081f","type":"function","z":"3da77520f154df13","name":"","func":"msg.payload = `${msg.payload}~`;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":380,"wires":[["c819b0e6a8ae3dbb"]]},{"id":"e7b27072d9a0cfd6","type":"rbe","z":"3da77520f154df13","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","x":1410,"y":340,"wires":[["6c1db46bc5ef81cc","38597debc2296da8"]]},{"id":"cd80a0392bd23876","type":"ui_group","name":"Master","tab":"ed06e619.b234a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"ed06e619.b234a8","type":"ui_tab","name":"Master","icon":"dashboard","disabled":false,"hidden":false}]

Node Red Dashboard for Lighting with Color Control

This one is pretty straightforward if you have ever messed around with the node red UI nodes. I’ll add comments in soon to help explain for those who haven’t, as it can be a bit of a PITA to get the hang of.


Click for the flow[{"id":"671fe54f218e1cbf","type":"switch","z":"4ad0adca94938587","name":"","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":840,"wires":[["daeee2174060d7ec"],["33fd02cdf46ef865"]]},{"id":"daeee2174060d7ec","type":"change","z":"4ad0adca94938587","name":"true","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":820,"wires":[["f65508071b2bed93"]]},{"id":"33fd02cdf46ef865","type":"change","z":"4ad0adca94938587","name":"false","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":860,"wires":[["f65508071b2bed93"]]},{"id":"353370c0c3fda54c","type":"switch","z":"4ad0adca94938587","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1310,"y":840,"wires":[["054655bf97c1b0e0"],["dac27cf0e8a3c537"]]},{"id":"dac27cf0e8a3c537","type":"change","z":"4ad0adca94938587","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":860,"wires":[["4f7955b662b2edf9"]]},{"id":"054655bf97c1b0e0","type":"change","z":"4ad0adca94938587","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":820,"wires":[["4f7955b662b2edf9"]]},{"id":"4f7955b662b2edf9","type":"link out","z":"4ad0adca94938587","name":"","links":["4f1d9767d7987a5c"],"x":1585,"y":840,"wires":[]},{"id":"4f1d9767d7987a5c","type":"link in","z":"4ad0adca94938587","name":"","links":["4f7955b662b2edf9"],"x":255,"y":840,"wires":[["e055c8062b0cbfc0"]]},{"id":"bda8e06d014353f3","type":"switch","z":"4ad0adca94938587","name":"","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":940,"wires":[["cc2f637994621b36"],["277dc378e614c7fa"]]},{"id":"cc2f637994621b36","type":"change","z":"4ad0adca94938587","name":"true","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":920,"wires":[["61720e7293edfdc9"]]},{"id":"277dc378e614c7fa","type":"change","z":"4ad0adca94938587","name":"false","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":960,"wires":[["61720e7293edfdc9"]]},{"id":"dcf651ad28a641d7","type":"switch","z":"4ad0adca94938587","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1310,"y":940,"wires":[["ee24289fd9472f30"],["4cc0ac4e6b4e7ae6"]]},{"id":"4cc0ac4e6b4e7ae6","type":"change","z":"4ad0adca94938587","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":960,"wires":[["1159deddd1f520a1"]]},{"id":"ee24289fd9472f30","type":"change","z":"4ad0adca94938587","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":920,"wires":[["1159deddd1f520a1"]]},{"id":"1159deddd1f520a1","type":"link out","z":"4ad0adca94938587","name":"","links":["b7eb4752cc733c94"],"x":1585,"y":940,"wires":[]},{"id":"b7eb4752cc733c94","type":"link in","z":"4ad0adca94938587","name":"","links":["1159deddd1f520a1"],"x":255,"y":940,"wires":[["2fe228ac49d192c0"]]},{"id":"d34bc74c1d55a7c4","type":"switch","z":"4ad0adca94938587","name":"","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":1040,"wires":[["aa32acfa93aa95b8"],["7bdfe9760216dfdc"]]},{"id":"aa32acfa93aa95b8","type":"change","z":"4ad0adca94938587","name":"true","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1020,"wires":[["eef5e23e8adf2e00"]]},{"id":"7bdfe9760216dfdc","type":"change","z":"4ad0adca94938587","name":"false","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1060,"wires":[["eef5e23e8adf2e00"]]},{"id":"8c779922fe2b9018","type":"switch","z":"4ad0adca94938587","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1330,"y":1040,"wires":[["d75018e3424a801e"],["47fb6d830d1f4b99"]]},{"id":"47fb6d830d1f4b99","type":"change","z":"4ad0adca94938587","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":1060,"wires":[["ebe1741c020cb293"]]},{"id":"d75018e3424a801e","type":"change","z":"4ad0adca94938587","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":1020,"wires":[["ebe1741c020cb293"]]},{"id":"ebe1741c020cb293","type":"link out","z":"4ad0adca94938587","name":"","links":["04660cc5d3d5757d"],"x":1605,"y":1040,"wires":[]},{"id":"04660cc5d3d5757d","type":"link in","z":"4ad0adca94938587","name":"","links":["ebe1741c020cb293"],"x":255,"y":1040,"wires":[["a406201c5c0809aa"]]},{"id":"de9b16a82d02a6ee","type":"ui_slider","z":"4ad0adca94938587","name":"","label":"Brightness","tooltip":"","group":"27c7e6035a7d81b6","order":7,"width":0,"height":0,"passthru":false,"outs":"end","topic":"bright","topicType":"str","min":0,"max":"100","step":"5","x":570,"y":560,"wires":[["89dba4318ebd6de4"]]},{"id":"3ad879108114c1a3","type":"ui_colour_picker","z":"4ad0adca94938587","name":"","label":"color","group":"27c7e6035a7d81b6","format":"rgb","outformat":"string","showSwatch":true,"showPicker":true,"showValue":true,"showHue":true,"showAlpha":false,"showLightness":false,"square":"true","dynOutput":"false","order":8,"width":0,"height":0,"passthru":false,"topic":"rgb","topicType":"str","x":770,"y":500,"wires":[["6b4bce4ab9f32322"]]},{"id":"6b4bce4ab9f32322","type":"change","z":"4ad0adca94938587","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"rgb(","fromt":"str","to":"","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":")","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":560,"wires":[["89dba4318ebd6de4"]]},{"id":"c8cb79fdf714ba18","type":"link out","z":"4ad0adca94938587","name":"","links":["bce6768b06320230"],"x":1595,"y":740,"wires":[]},{"id":"bce6768b06320230","type":"link in","z":"4ad0adca94938587","name":"","links":["c8cb79fdf714ba18"],"x":255,"y":740,"wires":[["abb926856b3e5c0f"]]},{"id":"89dba4318ebd6de4","type":"delay","z":"4ad0adca94938587","name":"","pauseType":"delay","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":360,"y":680,"wires":[["abb926856b3e5c0f","e055c8062b0cbfc0","2fe228ac49d192c0","a406201c5c0809aa"]]},{"id":"d934e801807321cf","type":"switch","z":"4ad0adca94938587","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1310,"y":740,"wires":[["0d1f45c88594aef1"],["cf0a50611b9a2e04"]]},{"id":"cf0a50611b9a2e04","type":"change","z":"4ad0adca94938587","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":760,"wires":[["c8cb79fdf714ba18"]]},{"id":"0d1f45c88594aef1","type":"change","z":"4ad0adca94938587","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":720,"wires":[["c8cb79fdf714ba18"]]},{"id":"e3b9eac2b55dfdc1","type":"switch","z":"4ad0adca94938587","name":"","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":740,"wires":[["b447a20938576ef0"],["9b9fcce6503836e2"]]},{"id":"b447a20938576ef0","type":"change","z":"4ad0adca94938587","name":"true","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":720,"wires":[["aff8bac9944c1ac6","552103298da3b7a1","eb47a1c98f996d46"]]},{"id":"9b9fcce6503836e2","type":"change","z":"4ad0adca94938587","name":"false","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":760,"wires":[["aff8bac9944c1ac6","552103298da3b7a1","eb47a1c98f996d46"]]},{"id":"52da7f5520daadc8","type":"switch","z":"4ad0adca94938587","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1170,"y":600,"wires":[["68c6ae7a2b78b785"],["25b0bbabbdf09fe4"]]},{"id":"25b0bbabbdf09fe4","type":"change","z":"4ad0adca94938587","name":"Lights Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":620,"wires":[["89dba4318ebd6de4"]]},{"id":"68c6ae7a2b78b785","type":"change","z":"4ad0adca94938587","name":"Lights On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"[\"Dimmer 10\",\"Power On\",\"CT 154\"]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"command","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":580,"wires":[["89dba4318ebd6de4"]]},{"id":"8a1e87b9459af266","type":"change","z":"4ad0adca94938587","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.bright","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":500,"wires":[["de9b16a82d02a6ee"]]},{"id":"f65508071b2bed93","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"Front Left","tooltip":"","group":"27c7e6035a7d81b6","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"payload","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1080,"y":840,"wires":[["353370c0c3fda54c"]]},{"id":"61720e7293edfdc9","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"Back Left","tooltip":"","group":"27c7e6035a7d81b6","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"payload","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1080,"y":940,"wires":[["dcf651ad28a641d7"]]},{"id":"eef5e23e8adf2e00","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"Back Right","tooltip":"","group":"27c7e6035a7d81b6","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"payload","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1090,"y":1040,"wires":[["8c779922fe2b9018"]]},{"id":"aff8bac9944c1ac6","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"Front Right","tooltip":"","group":"27c7e6035a7d81b6","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"on","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1090,"y":740,"wires":[["d934e801807321cf"]]},{"id":"552103298da3b7a1","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"All Lights","tooltip":"","group":"27c7e6035a7d81b6","order":1,"width":"0","height":"0","passthru":false,"decouple":"false","topic":"on","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1259.449951171875,"y":514.8499755859375,"wires":[["52da7f5520daadc8"]]},{"id":"e055c8062b0cbfc0","type":"Tasmota Light","z":"4ad0adca94938587","broker":"fb8e22de96fd2cb7","device":"Lights/Guest/FL","name":"Front Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":520,"y":840,"wires":[["671fe54f218e1cbf"]]},{"id":"a406201c5c0809aa","type":"Tasmota Light","z":"4ad0adca94938587","broker":"fb8e22de96fd2cb7","device":"Lights/Guest/BR","name":"Back Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":510,"y":1040,"wires":[["d34bc74c1d55a7c4"]]},{"id":"2fe228ac49d192c0","type":"Tasmota Light","z":"4ad0adca94938587","broker":"fb8e22de96fd2cb7","device":"Lights/Guest/BL","name":"Back Left","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":500,"y":940,"wires":[["bda8e06d014353f3"]]},{"id":"abb926856b3e5c0f","type":"Tasmota Light","z":"4ad0adca94938587","broker":"fb8e22de96fd2cb7","device":"Lights/Guest/FR","name":"Front Right","outputs":1,"uidisabler":false,"fullTopic":"","cmndPrefix":"","statPrefix":"","telePrefix":"","qos":1,"retain":"true","havedimmer":true,"havetemp":true,"havecolors":true,"tempformat":"K","colorsformat":"RGB","x":510,"y":740,"wires":[["e3b9eac2b55dfdc1","8a1e87b9459af266"]]},{"id":"eb47a1c98f996d46","type":"ui_switch","z":"4ad0adca94938587","name":"","label":"Guest Room Lights","tooltip":"","group":"cd80a0392bd23876","order":1,"width":"0","height":"0","passthru":false,"decouple":"false","topic":"on","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":1290,"y":460,"wires":[["52da7f5520daadc8"]]},{"id":"27c7e6035a7d81b6","type":"ui_group","name":"Guest Room","tab":"5c20422e.cd4834","order":1,"disp":true,"width":"6","collapse":false},{"id":"fb8e22de96fd2cb7","type":"tasmota-mqtt-broker","name":"Pi","broker":"10.10.2.1","port":"1883","clientid":"","usetls":false,"keepalive":"60","cleansession":true},{"id":"cd80a0392bd23876","type":"ui_group","name":"Master","tab":"ed06e619.b234a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"5c20422e.cd4834","type":"ui_tab","name":"Guest Room","icon":"dashboard","disabled":false,"hidden":false},{"id":"ed06e619.b234a8","type":"ui_tab","name":"Master","icon":"dashboard","disabled":false,"hidden":false}]

VLC HTTP Control

This flow uses virtual switches, which are turned on via voice commands, to affect the playback of VLC on a local computer. As it would require dedicated threads to properly explain setting up voice assistants and virtual switches, I am cheating and using HE for the voice integration and trigering of the virtual swtiches and am only able to show from the virtual switch being triggered onward.

Click for flow code [{"id":"b74a871a2f11b2ec","type":"subflow","name":"VLC HTTP Remote","info":"","category":"","in":[{"x":50,"y":30,"wires":[{"id":"613a01238de03b55"}]}],"out":[],"env":[{"name":"vlc_url","type":"str","value":"192.168.0.61:8080"}],"meta":{},"color":"#DDAA99"},{"id":"aaac38ef6d2bc4f3","type":"http request","z":"b74a871a2f11b2ec","name":"VLC","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","senderr":false,"x":1250,"y":80,"wires":[[]]},{"id":"8e62226b2c5dccd8","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"volume&val=","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":40,"wires":[["968903f385f031ee"]]},{"id":"aec2e7a23f401fea","type":"function","z":"b74a871a2f11b2ec","name":"100->256","func":"msg.payload.volume = msg.payload.volume * 2.56;\nmsg.payload.volume = parseFloat(msg.payload.volume. toFixed(0))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":40,"wires":[["8e62226b2c5dccd8"]]},{"id":"613a01238de03b55","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"volume","vt":"str"},{"t":"neq","v":"volume","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":40,"wires":[["aec2e7a23f401fea"],["576db8db812be3a5"]]},{"id":"968903f385f031ee","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"method","pt":"msg","to":"get","tot":"str"},{"t":"set","p":"payload.baseurl","pt":"msg","to":"vlc_url","tot":"env"},{"t":"set","p":"url","pt":"msg","to":"\"http://\"&payload.baseurl&\"/requests/status.xml?command=\"&payload.command&payload.volume","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":100,"wires":[["aaac38ef6d2bc4f3"]]},{"id":"b4d5a712cddc3955","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"\"pl_\"&payload.command","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":160,"wires":[["968903f385f031ee"]]},{"id":"576db8db812be3a5","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"fullscreen","vt":"str"},{"t":"neq","v":"fullscreen","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":80,"wires":[["9534d5cfa32c47b7"],["b4d5a712cddc3955"]]},{"id":"9534d5cfa32c47b7","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"fullscreen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":100,"wires":[["968903f385f031ee"]]},{"id":"6e793d7a953ccc5d","type":"subflow:b74a871a2f11b2ec","z":"72c561e2e18d0838","name":"","x":1230,"y":180,"wires":[]},{"id":"63e978267ddddfd2","type":"inject","z":"72c561e2e18d0838","name":"pause","props":[{"p":"payload.command","v":"pause","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":220,"wires":[["6e793d7a953ccc5d"]]},{"id":"34738d762c9ab1eb","type":"inject","z":"72c561e2e18d0838","name":"next","props":[{"p":"payload.command","v":"next","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":260,"wires":[["6e793d7a953ccc5d"]]},{"id":"a71c3543c07dfd61","type":"inject","z":"72c561e2e18d0838","name":"previous","props":[{"p":"payload.comman","v":"previous","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":180,"wires":[["6e793d7a953ccc5d"]]},{"id":"aea13bc0c6e2e7f4","type":"inject","z":"72c561e2e18d0838","name":"play","props":[{"p":"payload.command","v":"play","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":140,"wires":[["6e793d7a953ccc5d"]]},{"id":"da401d0573319e51","type":"inject","z":"72c561e2e18d0838","name":"stop","props":[{"p":"payload.command","v":"stop","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":300,"wires":[["6e793d7a953ccc5d"]]},{"id":"d2d63582ec439f9e","type":"inject","z":"72c561e2e18d0838","name":"volume","props":[{"p":"payload.command","v":"volume","vt":"str"},{"p":"payload.volume","v":"50","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":100,"wires":[["6e793d7a953ccc5d"]]},{"id":"341a774dbfc65a04","type":"hubitat device","z":"72c561e2e18d0838","deviceLabel":"Pause","name":"","server":"2776a2ec4863d40e","deviceId":"1423","attribute":"switch","sendEvent":true,"x":610,"y":440,"wires":[["13db647702eda40a"]]},{"id":"6d9425527d9b0f11","type":"hubitat command","z":"72c561e2e18d0838","deviceLabel":"Pause","name":"","server":"2776a2ec4863d40e","deviceId":"1423","command":"off","commandArgs":"","x":1170,"y":360,"wires":[[]]},{"id":"ccea55d742119cce","type":"hubitat device","z":"72c561e2e18d0838","deviceLabel":"Play","name":"","server":"2776a2ec4863d40e","deviceId":"1422","attribute":"switch","sendEvent":true,"x":610,"y":360,"wires":[["9d7b67c21d28a0cb"]]},{"id":"2cbf2ec178ac2f4e","type":"hubitat command","z":"72c561e2e18d0838","deviceLabel":"Play","name":"","server":"2776a2ec4863d40e","deviceId":"1422","command":"off","commandArgs":"","x":1170,"y":440,"wires":[[]]},{"id":"9d7b67c21d28a0cb","type":"switch","z":"72c561e2e18d0838","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":360,"wires":[["ccaa7a2911029ff0"]]},{"id":"13db647702eda40a","type":"switch","z":"72c561e2e18d0838","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":440,"wires":[["e1fe86eaec5f39b6"]]},{"id":"ccaa7a2911029ff0","type":"change","z":"72c561e2e18d0838","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"play","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":360,"wires":[["6e793d7a953ccc5d","6d9425527d9b0f11"]]},{"id":"e1fe86eaec5f39b6","type":"change","z":"72c561e2e18d0838","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"pause","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":440,"wires":[["6e793d7a953ccc5d","2cbf2ec178ac2f4e"]]},{"id":"6f06c5e6e2ee012a","type":"inject","z":"72c561e2e18d0838","name":"clear playlist","props":[{"p":"payload.command","v":"empty","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":340,"wires":[["6e793d7a953ccc5d"]]},{"id":"c41664037bb6907a","type":"inject","z":"72c561e2e18d0838","name":"toggle fullscreen","props":[{"p":"payload.command","v":"fullscreen","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":380,"wires":[["6e793d7a953ccc5d"]]},{"id":"9939a197977203cd","type":"link in","z":"72c561e2e18d0838","name":"vlc remote _>","links":["4f43a9b31c534024","abf625d8c0bb559a","b673a02d842fae0a","c3be9fd4fb2ba078","2eccfded0a3e5d0f","ca201ae1b3417b37","a1cac04cdd2bd543","48c52ed4d2847630","6bf0243346329334","a73af427cc1d06bc","4a3c22c833ab627a","95ced257fb5a2d74","fbee287fe4cbe17a","1bfee42e9e927eed","b5c0172c1aa51e38","5e67fc744cc576b9","0a3aa68b9d67a41a"],"x":835,"y":100,"wires":[["6e793d7a953ccc5d"]]},{"id":"13d0673d6c7ba9b3","type":"hubitat device","z":"72c561e2e18d0838","deviceLabel":"Next","name":"","server":"2776a2ec4863d40e","deviceId":"1424","attribute":"switch","sendEvent":true,"x":610,"y":520,"wires":[["1882f99236768f5b"]]},{"id":"22562b2407a12a79","type":"hubitat command","z":"72c561e2e18d0838","deviceLabel":"Next","name":"","server":"2776a2ec4863d40e","deviceId":"1424","command":"off","commandArgs":"","x":1170,"y":520,"wires":[[]]},{"id":"1882f99236768f5b","type":"switch","z":"72c561e2e18d0838","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":520,"wires":[["e1d58a96072ac976"]]},{"id":"e1d58a96072ac976","type":"change","z":"72c561e2e18d0838","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"next","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":520,"wires":[["22562b2407a12a79","6e793d7a953ccc5d"]]},{"id":"508f0c2ad9508924","type":"hubitat device","z":"72c561e2e18d0838","deviceLabel":"Previous","name":"","server":"2776a2ec4863d40e","deviceId":"1425","attribute":"switch","sendEvent":true,"x":620,"y":580,"wires":[["a52879a7133f19d4"]]},{"id":"0d9d68383d6356af","type":"hubitat command","z":"72c561e2e18d0838","deviceLabel":"Previous","name":"","server":"2776a2ec4863d40e","deviceId":"1425","command":"off","commandArgs":"","x":1180,"y":580,"wires":[[]]},{"id":"a52879a7133f19d4","type":"switch","z":"72c561e2e18d0838","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":580,"wires":[["631e61da0f24e697"]]},{"id":"631e61da0f24e697","type":"change","z":"72c561e2e18d0838","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"previous","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":580,"wires":[["0d9d68383d6356af","6e793d7a953ccc5d"]]},{"id":"749aa2a588bfb4be","type":"comment","z":"72c561e2e18d0838","name":"Node Red VLC Control","info":"","x":740,"y":20,"wires":[]},{"id":"f6766c1ca4cde189","type":"comment","z":"72c561e2e18d0838","name":"Useful Commands","info":"","x":150,"y":60,"wires":[]},{"id":"4e7def96555c4e28","type":"comment","z":"72c561e2e18d0838","name":"Trigger command and turns virtual switch back off","info":"","x":900,"y":320,"wires":[]},{"id":"885cf9ae347e8155","type":"comment","z":"72c561e2e18d0838","name":"Configure with IP of VLC host","info":"","x":1260,"y":140,"wires":[]},{"id":"096c1f65f83b0e04","type":"comment","z":"72c561e2e18d0838","name":"VLC MUST have local web control enabled","info":"","x":1300,"y":220,"wires":[]},{"id":"2776a2ec4863d40e","type":"hubitat config","name":"hubitat","usetls":false,"host":"192.168.0.7","port":"80","appId":"1185","nodeRedServer":"https://192.168.0.11","webhookPath":"/pods/direct/node-red/webhook","autoRefresh":true,"useWebsocket":true,"colorEnabled":false,"color":"#ace043"}]

Included subflow that parses simple style commands into the needed html formats

Click for subflow [{"id":"b74a871a2f11b2ec","type":"subflow","name":"VLC HTTP Remote","info":"","category":"","in":[{"x":50,"y":30,"wires":[{"id":"613a01238de03b55"}]}],"out":[],"env":[{"name":"vlc_url","type":"str","value":"192.168.0.61:8080"}],"meta":{},"color":"#DDAA99"},{"id":"aaac38ef6d2bc4f3","type":"http request","z":"b74a871a2f11b2ec","name":"VLC","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","senderr":false,"x":1250,"y":80,"wires":[[]]},{"id":"8e62226b2c5dccd8","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"volume&val=","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":40,"wires":[["968903f385f031ee"]]},{"id":"aec2e7a23f401fea","type":"function","z":"b74a871a2f11b2ec","name":"100->256","func":"msg.payload.volume = msg.payload.volume * 2.56;\nmsg.payload.volume = parseFloat(msg.payload.volume. toFixed(0))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":40,"wires":[["8e62226b2c5dccd8"]]},{"id":"613a01238de03b55","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"volume","vt":"str"},{"t":"neq","v":"volume","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":40,"wires":[["aec2e7a23f401fea"],["576db8db812be3a5"]]},{"id":"968903f385f031ee","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"method","pt":"msg","to":"get","tot":"str"},{"t":"set","p":"payload.baseurl","pt":"msg","to":"vlc_url","tot":"env"},{"t":"set","p":"url","pt":"msg","to":"\"http://\"&payload.baseurl&\"/requests/status.xml?command=\"&payload.command&payload.volume","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":100,"wires":[["aaac38ef6d2bc4f3"]]},{"id":"b4d5a712cddc3955","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"\"pl_\"&payload.command","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":160,"wires":[["968903f385f031ee"]]},{"id":"576db8db812be3a5","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"fullscreen","vt":"str"},{"t":"neq","v":"fullscreen","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":80,"wires":[["9534d5cfa32c47b7"],["b4d5a712cddc3955"]]},{"id":"9534d5cfa32c47b7","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"fullscreen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":100,"wires":[["968903f385f031ee"]]}]

VLC Control using MQTT

In this next example we start off with the basic VLC playback commands we saw a moment ago, only this time being executed off of the data in a specified MQTT topic. All of the inject commands from the previous example are valid here as well

Click for flow, subflow is the same as in the last example [{"id":"b74a871a2f11b2ec","type":"subflow","name":"VLC HTTP Remote","info":"","category":"","in":[{"x":50,"y":30,"wires":[{"id":"613a01238de03b55"}]}],"out":[],"env":[{"name":"vlc_url","type":"str","value":"192.168.0.61:8080"}],"meta":{},"color":"#DDAA99"},{"id":"aaac38ef6d2bc4f3","type":"http request","z":"b74a871a2f11b2ec","name":"VLC","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","senderr":false,"x":1250,"y":80,"wires":[[]]},{"id":"8e62226b2c5dccd8","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"volume&val=","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":40,"wires":[["968903f385f031ee"]]},{"id":"aec2e7a23f401fea","type":"function","z":"b74a871a2f11b2ec","name":"100->256","func":"msg.payload.volume = msg.payload.volume * 2.56;\nmsg.payload.volume = parseFloat(msg.payload.volume. toFixed(0))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":40,"wires":[["8e62226b2c5dccd8"]]},{"id":"613a01238de03b55","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"volume","vt":"str"},{"t":"neq","v":"volume","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":40,"wires":[["aec2e7a23f401fea"],["576db8db812be3a5"]]},{"id":"968903f385f031ee","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"method","pt":"msg","to":"get","tot":"str"},{"t":"set","p":"payload.baseurl","pt":"msg","to":"vlc_url","tot":"env"},{"t":"set","p":"url","pt":"msg","to":"\"http://\"&payload.baseurl&\"/requests/status.xml?command=\"&payload.command&payload.volume","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":100,"wires":[["aaac38ef6d2bc4f3"]]},{"id":"b4d5a712cddc3955","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"\"pl_\"&payload.command","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":160,"wires":[["968903f385f031ee"]]},{"id":"576db8db812be3a5","type":"switch","z":"b74a871a2f11b2ec","name":"","property":"payload.command","propertyType":"msg","rules":[{"t":"eq","v":"fullscreen","vt":"str"},{"t":"neq","v":"fullscreen","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":80,"wires":[["9534d5cfa32c47b7"],["b4d5a712cddc3955"]]},{"id":"9534d5cfa32c47b7","type":"change","z":"b74a871a2f11b2ec","name":"","rules":[{"t":"set","p":"payload.command","pt":"msg","to":"fullscreen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":100,"wires":[["968903f385f031ee"]]},{"id":"2dedcbef068d0912","type":"mqtt in","z":"ad6538e94b7c13df","name":"","topic":"Media/Control/Playback","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":220,"y":100,"wires":[["906ab11b7530b512"]]},{"id":"906ab11b7530b512","type":"switch","z":"ad6538e94b7c13df","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"play","vt":"str"},{"t":"eq","v":"pause","vt":"str"},{"t":"eq","v":"next","vt":"str"},{"t":"eq","v":"previous","vt":"str"}],"checkall":"true","repair":true,"outputs":4,"x":470,"y":100,"wires":[["006833373b6c52f0"],["0829bd3ce286d5af"],["104c46e160a9f7a5"],["743a459d17957f95"]]},{"id":"92918c66b6f64ba1","type":"subflow:b74a871a2f11b2ec","z":"ad6538e94b7c13df","name":"","x":1110,"y":80,"wires":[]},{"id":"006833373b6c52f0","type":"change","z":"ad6538e94b7c13df","name":"play","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.command","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":60,"wires":[["92918c66b6f64ba1"]]},{"id":"0829bd3ce286d5af","type":"change","z":"ad6538e94b7c13df","name":"pause","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.command","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":100,"wires":[["92918c66b6f64ba1"]]},{"id":"104c46e160a9f7a5","type":"change","z":"ad6538e94b7c13df","name":"next","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.command","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":140,"wires":[["92918c66b6f64ba1"]]},{"id":"743a459d17957f95","type":"change","z":"ad6538e94b7c13df","name":"previous","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.command","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":180,"wires":[["92918c66b6f64ba1"]]},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

COMING SOON - Using NR with Push2Run to control your local PC(s)!

Nothing to see here

Ok for those of you who are impatient, here is a basic flow that is used in combination with a fire tablet that sends data to an mqtt topic to allow my grandmother to easily pick a tv show and load it into vlc on the pc in her room.

Click again for flow[{"id":"da1ba1d70d5d57f6","type":"mqtt out","z":"ad6538e94b7c13df","name":"","topic":"media/control/action","qos":"2","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"294fa8348e5e3a0f","x":1080,"y":640,"wires":[]},{"id":"ac0d36d6a0b6ea69","type":"change","z":"ad6538e94b7c13df","name":"AYBS Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"are you being served season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":340,"wires":[["da1ba1d70d5d57f6"]]},{"id":"a8cbf948aac1adab","type":"change","z":"ad6538e94b7c13df","name":"Bewitched Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"bewitched season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":380,"wires":[["da1ba1d70d5d57f6"]]},{"id":"5d9604cacf403532","type":"change","z":"ad6538e94b7c13df","name":"Gilligan Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"gilligan season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":460,"wires":[["da1ba1d70d5d57f6"]]},{"id":"77449b1ef3e8815e","type":"change","z":"ad6538e94b7c13df","name":"KUA Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"keeping up appearances season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":580,"wires":[["da1ba1d70d5d57f6"]]},{"id":"85510f3ac95414c7","type":"change","z":"ad6538e94b7c13df","name":"KOH Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"king of the hill season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":620,"wires":[["da1ba1d70d5d57f6"]]},{"id":"dfe6ecc345c558a5","type":"change","z":"ad6538e94b7c13df","name":"Waltons Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"waltons season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":780,"wires":[["da1ba1d70d5d57f6"]]},{"id":"a47d279519ced5da","type":"change","z":"ad6538e94b7c13df","name":"All Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"random","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":820,"wires":[["da1ba1d70d5d57f6"]]},{"id":"0938ce207348bbfa","type":"mqtt in","z":"ad6538e94b7c13df","name":"","topic":"Media/Control/NowPlaying","qos":"2","datatype":"auto","broker":"294fa8348e5e3a0f","nl":false,"rap":true,"rh":0,"inputs":0,"x":170,"y":320,"wires":[["60e4decce1559799","55920bd2a94cc06b"]]},{"id":"ead19230f184a20b","type":"switch","z":"ad6538e94b7c13df","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Being Served","vt":"str"},{"t":"eq","v":"Bewitched","vt":"str"},{"t":"eq","v":"Frasier","vt":"str"},{"t":"eq","v":"Gilligan","vt":"str"},{"t":"eq","v":"Golden Girls","vt":"str"},{"t":"eq","v":"Home Improvement","vt":"str"},{"t":"eq","v":"Keeping up","vt":"str"},{"t":"eq","v":"King Hill","vt":"str"},{"t":"eq","v":"Mash","vt":"str"},{"t":"eq","v":"Good Place","vt":"str"},{"t":"eq","v":"Reba","vt":"str"},{"t":"eq","v":"Waltons","vt":"str"},{"t":"eq","v":"Random","vt":"str"}],"checkall":"true","repair":false,"outputs":13,"x":490,"y":480,"wires":[["ac0d36d6a0b6ea69"],["a8cbf948aac1adab"],["a777d32ab66bffcd"],["5d9604cacf403532"],["a445505d9759deaf"],["0bb31f41eb22247f"],["77449b1ef3e8815e"],["85510f3ac95414c7"],["6fb440cb773227eb"],["d49f1d25d36461a0"],["5d633bac923e3a87"],["dfe6ecc345c558a5"],["a47d279519ced5da"]]},{"id":"a777d32ab66bffcd","type":"change","z":"ad6538e94b7c13df","name":"Frasier Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"frasier season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":420,"wires":[["da1ba1d70d5d57f6"]]},{"id":"a445505d9759deaf","type":"change","z":"ad6538e94b7c13df","name":"GG Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"golden girls season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":500,"wires":[["da1ba1d70d5d57f6"]]},{"id":"6fb440cb773227eb","type":"change","z":"ad6538e94b7c13df","name":"Mash Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"mash season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":660,"wires":[["da1ba1d70d5d57f6"]]},{"id":"5d633bac923e3a87","type":"change","z":"ad6538e94b7c13df","name":"Reba Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"reba season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":700,"wires":[["da1ba1d70d5d57f6"]]},{"id":"60e4decce1559799","type":"change","z":"ad6538e94b7c13df","name":"clear playlist","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.command","tot":"msg"},{"t":"set","p":"payload.command","pt":"msg","to":"empty","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":300,"wires":[["fbee287fe4cbe17a"]]},{"id":"fbee287fe4cbe17a","type":"link out","z":"ad6538e94b7c13df","name":"VLC Remote","mode":"link","links":["9939a197977203cd"],"x":505,"y":300,"wires":[]},{"id":"55920bd2a94cc06b","type":"delay","z":"ad6538e94b7c13df","name":".5","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":370,"y":340,"wires":[["ead19230f184a20b"]]},{"id":"bf7dd57549a41958","type":"debug","z":"ad6538e94b7c13df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1070,"y":440,"wires":[]},{"id":"0bb31f41eb22247f","type":"change","z":"ad6538e94b7c13df","name":"Home Improvement Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"home improvement season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":540,"wires":[["da1ba1d70d5d57f6"]]},{"id":"d49f1d25d36461a0","type":"change","z":"ad6538e94b7c13df","name":"Good Place Random","rules":[{"t":"set","p":"payload","pt":"msg","to":"good place season all","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":740,"wires":[[]]},{"id":"294fa8348e5e3a0f","type":"mqtt-broker","name":"core","broker":"10.10.2.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
1 Like

I was feeling left out, so how about a very different example. This polls the API of my power provider to get the current wholesale electricity price (which is what I pay) from the national energy market. If the price falls below 15c/kWh my Tesla is instructed to start charging. If it rises above 20c/kWh, the car is instructed to stop charging again.

The current price is also fed into a UI dashboard where it is displayed in a time series graph.

And the code (obviously with some API keys removed).

[{"id":"6a4eca4a7e3c8362","type":"tab","label":"Power dashboard","disabled":false,"info":""},{"id":"170f24374048efc8","type":"http request","z":"6a4eca4a7e3c8362","name":"Amber prices request","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.amber.com.au/v1/sites/01E8RD8PZXR3X9QN8PVT5VT233/prices/current","tls":"540f7221.202cdc","persist":false,"proxy":"","authType":"","x":260,"y":320,"wires":[["42d81ab7943b23fa"]]},{"id":"a89efd8b1e0a4b70","type":"inject","z":"6a4eca4a7e3c8362","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":200,"wires":[["f471c9932971e46c"]]},{"id":"f471c9932971e46c","type":"function","z":"6a4eca4a7e3c8362","name":"Set amber headers and body","func":"msg.headers = {};\nmsg.headers['Authorization'] = \"Bearer xxxxxxxx\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":200,"y":260,"wires":[["170f24374048efc8"]]},{"id":"42d81ab7943b23fa","type":"function","z":"6a4eca4a7e3c8362","name":"Process Amber result","func":"for (i = 0; i < msg.payload.length; i++)\n{\n    var entry = msg.payload[i];\n    if (entry.channelType == \"general\")\n    {\n        msg.currentGeneralUsagePrice = parseFloat(entry.perKwh)\n    }\n    else if (entry.channelType == \"feedIn\")\n    {\n        msg.currentSolarFeedPrice = -parseFloat(entry.perKwh);\n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":380,"wires":[["e5c97a76e9ce9eb5","d5caafc59cb8d0ad"]]},{"id":"ad35201b1e55b427","type":"ui_text","z":"6a4eca4a7e3c8362","group":"2e1c7098ef7f43e7","order":10,"width":0,"height":0,"name":"","label":"Feed in (KWh)","format":"{{msg.currentSolarFeedPrice}}","layout":"row-spread","className":"","x":650,"y":160,"wires":[]},{"id":"bd7a6da9bc5d0679","type":"ui_text","z":"6a4eca4a7e3c8362","group":"2e1c7098ef7f43e7","order":10,"width":0,"height":0,"name":"","label":"General Usage (KWh)","format":"{{msg.currentGeneralUsagePrice}}","layout":"row-spread","className":"","x":670,"y":100,"wires":[]},{"id":"e5c97a76e9ce9eb5","type":"debug","z":"6a4eca4a7e3c8362","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":440,"wires":[]},{"id":"d5caafc59cb8d0ad","type":"link out","z":"6a4eca4a7e3c8362","name":"Current Power Price","links":["1d9d0237f8d963cc"],"x":495,"y":340,"wires":[]},{"id":"1d9d0237f8d963cc","type":"link in","z":"6a4eca4a7e3c8362","name":"","links":["d5caafc59cb8d0ad"],"x":495,"y":140,"wires":[["bd7a6da9bc5d0679","ad35201b1e55b427","d6904581c33bd23c","27891d77c379b007"]]},{"id":"221223ae9431d58e","type":"ui_chart","z":"6a4eca4a7e3c8362","name":"Amber Power Price","group":"2e1c7098ef7f43e7","order":3,"width":0,"height":0,"label":"General usage (kWh)","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"Waiting for data","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":780,"y":280,"wires":[[]]},{"id":"d6904581c33bd23c","type":"change","z":"6a4eca4a7e3c8362","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"currentGeneralUsagePrice","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"General use","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":220,"wires":[["221223ae9431d58e"]]},{"id":"27891d77c379b007","type":"switch","z":"6a4eca4a7e3c8362","name":"Charge if price is low, stop charge if price is high","property":"currentGeneralUsagePrice","propertyType":"msg","rules":[{"t":"lt","v":"15","vt":"num"},{"t":"gte","v":"21","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":760,"y":340,"wires":[["3304b25118e5bf1e"],["0ed7343e5a4c656f"]]},{"id":"94f9552f9c3a881c","type":"debug","z":"6a4eca4a7e3c8362","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1290,"y":620,"wires":[]},{"id":"3304b25118e5bf1e","type":"change","z":"6a4eca4a7e3c8362","name":"Set startCharge command","rules":[{"t":"set","p":"command","pt":"msg","to":"startCharge","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":460,"wires":[["774497bcfd3b698c"]]},{"id":"0ed7343e5a4c656f","type":"change","z":"6a4eca4a7e3c8362","name":"Set stopCharge command","rules":[{"t":"set","p":"command","pt":"msg","to":"stopCharge","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":540,"wires":[["774497bcfd3b698c"]]},{"id":"d5236239f0437989","type":"tesla-api","z":"6a4eca4a7e3c8362","teslaConfig":"73b5fcb672e7fbda","command":"stopCharge","name":"Send charging message","vehicleID":"1492932281407760","autoWakeUp":true,"x":1210,"y":560,"wires":[["94f9552f9c3a881c"]]},{"id":"774497bcfd3b698c","type":"rbe","z":"6a4eca4a7e3c8362","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"command","topi":"topic","x":1100,"y":500,"wires":[["d5236239f0437989"]]},{"id":"68aa17d363a36199","type":"http request","z":"6a4eca4a7e3c8362","name":"Tesla product list","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://owner-api.teslamotors.com/api/1/products","tls":"540f7221.202cdc","persist":false,"proxy":"","authType":"bearer","x":310,"y":900,"wires":[["2cfec9eb5beff047"]]},{"id":"a284620c55b0543e","type":"inject","z":"6a4eca4a7e3c8362","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":820,"wires":[["68aa17d363a36199"]]},{"id":"2cfec9eb5beff047","type":"debug","z":"6a4eca4a7e3c8362","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":980,"wires":[]},{"id":"14a6148bbd76cc4d","type":"inject","z":"6a4eca4a7e3c8362","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":1000,"wires":[["9290714094792b62"]]},{"id":"6d2c6ba5e1b0d22e","type":"debug","z":"6a4eca4a7e3c8362","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":1120,"wires":[]},{"id":"9290714094792b62","type":"http request","z":"6a4eca4a7e3c8362","name":"Tesla battery status","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://owner-api.teslamotors.com/api/1/powerwalls/STE20200113-00001/status","tls":"540f7221.202cdc","persist":false,"proxy":"","authType":"bearer","x":300,"y":1060,"wires":[["6d2c6ba5e1b0d22e"]]},{"id":"540f7221.202cdc","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":true},{"id":"2e1c7098ef7f43e7","type":"ui_group","name":"Environment","tab":"4aaea196.ea00b","order":2,"disp":true,"width":"6","collapse":false},{"id":"73b5fcb672e7fbda","type":"tesla-config","email":"[email protected]"},{"id":"4aaea196.ea00b","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
3 Likes

I’m on a roll. Well hopefully. :wink:
I decided to try and write a flow to turn on a light when motion is active but only when a lux level switch is on.
It does seem to be working OK but if possible could someone sanity check this for me. If it’s good this will become my template for this sort of automation.
Feedback for different ways to do this or streamline much appreciated.
Above the ‘state’ box, motion is false. Below motion is true.
The ‘switch’ box is switch off, top flow, switch on, bottom flow.
Many thanks.

Screenshot

`

Flow

[{“id”:“a1d3fd2198adb62f”,“type”:“tab”,“label”:“:bulb:Downstairs Loo-Light <20”,“disabled”:false,“info”:“”,“env”:[]},{“id”:“5d74e2b6a8023039”,“type”:“hubitat command”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“Down Loo-Light on #3 C3”,“name”:“Loo Light”,“server”:“3b6080dc.a2527”,“deviceId”:“9543”,“command”:“on”,“commandArgs”:“”,“x”:180,“y”:380,“wires”:[[]]},{“id”:“55523cc5f6afa8b8”,“type”:“hubitat device”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“mZone-Downstairs Loo on #3 C3”,“name”:“Down Loo”,“server”:“3b6080dc.a2527”,“deviceId”:“9286”,“attribute”:“motion”,“sendEvent”:true,“x”:80,“y”:200,“wires”:[[“3dab1f75d2f238c3”]]},{“id”:“3dab1f75d2f238c3”,“type”:“switch”,“z”:“a1d3fd2198adb62f”,“name”:“State”,“property”:“payload.currentValue”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“inactive”,“vt”:“str”},{“t”:“eq”,“v”:“active”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:250,“y”:200,“wires”:[[“04d01a3f44d2cf55”],[“865eb38e1012fd34”]]},{“id”:“865eb38e1012fd34”,“type”:“hubitat device”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“Virt-Lux <20 Switch”,“name”:“Lux <20”,“server”:“3b6080dc.a2527”,“deviceId”:“1729”,“attribute”:“switch”,“sendEvent”:true,“x”:180,“y”:300,“wires”:[[“cba1e51d8f1b609d”]]},{“id”:“cba1e51d8f1b609d”,“type”:“switch”,“z”:“a1d3fd2198adb62f”,“name”:“”,“property”:“payload.currentValue”,“propertyType”:“msg”,“rules”:[{“t”:“cont”,“v”:“off”,“vt”:“str”},{“t”:“cont”,“v”:“on”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:370,“y”:300,“wires”:[[“04d01a3f44d2cf55”],[“5d74e2b6a8023039”,“5da41b78b2059f4f”]]},{“id”:“04d01a3f44d2cf55”,“type”:“delay”,“z”:“a1d3fd2198adb62f”,“name”:“”,“pauseType”:“delay”,“timeout”:“15”,“timeoutUnits”:“seconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“allowrate”:false,“outputs”:1,“x”:220,“y”:60,“wires”:[[“700d788b443ba1af”,“756a3b132caceccb”]]},{“id”:“700d788b443ba1af”,“type”:“hubitat command”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“Down Loo-Light on #3 C3”,“name”:“Loo Light”,“server”:“3b6080dc.a2527”,“deviceId”:“9543”,“command”:“off”,“commandArgs”:“”,“x”:400,“y”:40,“wires”:[[]]},{“id”:“5da41b78b2059f4f”,“type”:“hubitat command”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“5Downstairs Loo (V)”,“name”:“Down Loo (V)”,“server”:“3b6080dc.a2527”,“deviceId”:“2784”,“command”:“on”,“commandArgs”:“”,“x”:360,“y”:380,“wires”:[[]]},{“id”:“756a3b132caceccb”,“type”:“hubitat command”,“z”:“a1d3fd2198adb62f”,“deviceLabel”:“5Downstairs Loo (V)”,“name”:“Down Loo (V)”,“server”:“3b6080dc.a2527”,“deviceId”:“2784”,“command”:“off”,“commandArgs”:“”,“x”:420,“y”:100,“wires”:[[]]},{“id”:“3b6080dc.a2527”,“type”:“hubitat config”,“name”:“#1 C7”,“usetls”:false,“host”:“192.168.0.24”,“port”:“80”,“appId”:“2763”,“nodeRedServer”:“http://192.168.0.40:1880”,“webhookPath”:“/hubitat/webhook”,“autoRefresh”:true,“useWebsocket”:true,“colorEnabled”:false,“color”:“#000000”}]

`

If the code is not in Preformatted text all I get is errors.

you need to include use this icon around the code. image

How to Export NR for import on forums, step by step
  1. Export code in NR to clipboard
  2. click gear icon, hide details
  3. click delete while sample text is highlight to remove it
  4. click image
  5. Paste and overwrite highlighted text with you code

Example
image

You should get what you see at the bottom of this post with my examples. Either is fine as long as that gray background is there.


For motion activated lighting, with a delay, I highly recommended the “stop timer” node (you’ll have to add it to your palette). With this in place if motion returns to that area the “off” timer is canceled, and the light remains on. Without it the light will turn off when the delay ends, even if motion has returned.

Summary
[{"id":"639c9186069191cf","type":"tab","label":"Essential Lighting","disabled":false,"info":"","env":[]},{"id":"bbf2fc4383860e90","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["59c332c054f9ca62","606117114d3a6cf2","2fa845e0d69fd2c9","eb7fcea59ca03077","e126c25255b002a9","f848d675e3fa2105","cd79c40c087ce226","5b077b279c6ba213","5aafa2755bb0748b","4b1a767b47f0360e","d8fdeb64aafba614","d82b1f5c55bec74b","f8413db95b0284cd"],"x":12,"y":19,"w":794,"h":324.5},{"id":"3464d96f50a2a896","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["cfed47ebaa9a3164","fbc9d40d53ca402c","fe05e0322c116e13","843443ebcab63a21","e67532d1b1f19022","46ddbd0d2ecffbf8","6984d5be0483a252","e1f37940c857a398","5eb78cf9be36f403"],"x":14,"y":379,"w":652,"h":297},{"id":"94d9833bdd165f28","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["da89b6389e468206","c544ecf5582f2637","aa018df181ad26ec","b89658330a0def43","d94876c91a1f2728","63112d138b7e87ac"],"x":14,"y":699,"w":652,"h":242},{"id":"45a8d2ff3ec0e6b4","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["a105812125b5b0ec","29f3c9eb5836d1a6","f4ab256fdd14049f","bca9f9f1f42234c6","a78367936a0f7e37","8968f7b747d32938"],"x":14,"y":959,"w":652,"h":242},{"id":"3ae3d31c8a4c2f1f","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["ec8848ee288c1fbf","06d5ba823874c8e9","a73bf0d8a929a9dc","267baafb82473771","2682834243cce2e6","b1af1168f573e739"],"x":14,"y":1219,"w":652,"h":242},{"id":"732c4968d0704c9f","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["77cf8c536fdbf780","ace9b3277e754871","4ee014b9e696557a","306417917383d4ee","510968ff37887e74","f77db8e1adcdb649","f33bd40b1a4059cf","e03e257b83149a03","1e89cde8c6b8f4b1","a548b62db2a255d4","7f2441b50d3ce3ca","b2a1d74a54b45ba1","1ad50294fce297db","0116add683dd1b8d","8409550b3d82b4e9","fb4d7707e43d7375","ffbc88b06ae62785"],"x":14,"y":1479,"w":1172,"h":282},{"id":"56a1de63e7bffcac","type":"group","z":"639c9186069191cf","name":"","style":{"fill":"#ffefbf","label":true},"nodes":["484d71f61170a3a5","fb176af7b10aa816","30eabe623a28fe54","6873015206c2effa","bb72bc77b87d5e03","115ef094fb443168","ee6d9aeccb5f47e1","a035d793e9da3ea4","ca36ee306e17d843","ec5c13b388f2dca6","2b65ab989d0f371d","239f19bd81aa99fe","3f2e3b00b32ccf47","9af057d51cdacfd8","7ea88d48d7408d75","80a0ebc2a15490ed","e33bd74f545e4451","be8f7643c7db82cc","09e2fdfb6c7f1833"],"x":14,"y":1778,"w":1212,"h":323},{"id":"59c332c054f9ca62","type":"switch","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Present?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":220,"wires":[["eb7fcea59ca03077"],["d82b1f5c55bec74b"]]},{"id":"606117114d3a6cf2","type":"api-call-service","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.office_office_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":300,"wires":[[]]},{"id":"2fa845e0d69fd2c9","type":"server-state-changed","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Desk presence","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.occupancy1_presence","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":120,"y":220,"wires":[["59c332c054f9ca62"]]},{"id":"eb7fcea59ca03077","type":"api-call-service","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.office_office_light","light.office_lights"],"data":"{\"brightness\": 150}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":530,"y":100,"wires":[[]]},{"id":"e126c25255b002a9","type":"server-state-changed","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Desk movement","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.occupancy1_presence_event","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":120,"y":280,"wires":[["f848d675e3fa2105"]]},{"id":"f848d675e3fa2105","type":"switch","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Movement","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"approach","vt":"str"},{"t":"eq","v":"left_enter","vt":"str"},{"t":"eq","v":"right_enter","vt":"str"},{"t":"eq","v":"right_leave","vt":"str"},{"t":"eq","v":"left_leave","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":370,"y":280,"wires":[["eb7fcea59ca03077"],["eb7fcea59ca03077"],["eb7fcea59ca03077"],["d82b1f5c55bec74b"],["d82b1f5c55bec74b"]]},{"id":"cd79c40c087ce226","type":"server-state-changed","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Desk motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.desk_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"}],"x":108,"y":150,"wires":[["eb7fcea59ca03077"],["d8fdeb64aafba614"]]},{"id":"cfed47ebaa9a3164","type":"switch","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Present?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":540,"wires":[["843443ebcab63a21"],["fbc9d40d53ca402c"]]},{"id":"fbc9d40d53ca402c","type":"api-call-service","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.main_bath_main_bathroom_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":620,"wires":[[]]},{"id":"fe05e0322c116e13","type":"server-state-changed","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Main Bathroom presence","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.occupancy2_main_bath_presence","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":540,"wires":[["cfed47ebaa9a3164"]]},{"id":"843443ebcab63a21","type":"api-call-service","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.main_bath_main_bathroom_light"],"data":"{\"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":480,"wires":[[]]},{"id":"e67532d1b1f19022","type":"server-state-changed","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Main Bathroom event","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.occupancy2_main_bath_presence_event","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":620,"wires":[["46ddbd0d2ecffbf8"]]},{"id":"46ddbd0d2ecffbf8","type":"switch","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Movement","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"approach","vt":"str"},{"t":"eq","v":"right_enter","vt":"str"},{"t":"eq","v":"leave","vt":"str"},{"t":"eq","v":"left_leave","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":350,"y":620,"wires":[["843443ebcab63a21"],["843443ebcab63a21"],["fbc9d40d53ca402c"],["fbc9d40d53ca402c"]]},{"id":"6984d5be0483a252","type":"server-state-changed","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Main Bath Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.main_bath_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":440,"wires":[["843443ebcab63a21"],["e1f37940c857a398"]]},{"id":"5b077b279c6ba213","type":"inject","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":340,"y":60,"wires":[["eb7fcea59ca03077"]]},{"id":"5aafa2755bb0748b","type":"comment","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Desk Light","info":"","x":100,"y":60,"wires":[]},{"id":"e1f37940c857a398","type":"api-current-state","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Main Bath Presence","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.occupancy2_main_bath_presence","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":271,"y":478,"wires":[["cfed47ebaa9a3164"]]},{"id":"5eb78cf9be36f403","type":"comment","z":"639c9186069191cf","g":"3464d96f50a2a896","name":"Main Bathroom Light","info":"","x":450,"y":420,"wires":[]},{"id":"4b1a767b47f0360e","type":"server-state-changed","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Bench motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.bench_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"}],"x":110,"y":100,"wires":[["eb7fcea59ca03077"],["d8fdeb64aafba614"]]},{"id":"d8fdeb64aafba614","type":"api-current-state","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Desk Presence","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.occupancy1_presence","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":304,"y":160,"wires":[["59c332c054f9ca62"]]},{"id":"d82b1f5c55bec74b","type":"api-current-state","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Bench Presence","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.bench_motion_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":700,"y":180,"wires":[["f8413db95b0284cd"]]},{"id":"f8413db95b0284cd","type":"switch","z":"639c9186069191cf","g":"bbf2fc4383860e90","name":"Present?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":660,"y":240,"wires":[[],["606117114d3a6cf2"]]},{"id":"da89b6389e468206","type":"server-state-changed","z":"639c9186069191cf","g":"94d9833bdd165f28","name":"Basement Stairwell Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.basement_stairwell_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":780,"wires":[["c544ecf5582f2637"],["d94876c91a1f2728"]]},{"id":"c544ecf5582f2637","type":"api-call-service","z":"639c9186069191cf","g":"94d9833bdd165f28","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.basement_stairwell_bulb"],"data":"{\"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":760,"wires":[["63112d138b7e87ac"]]},{"id":"aa018df181ad26ec","type":"api-call-service","z":"639c9186069191cf","g":"94d9833bdd165f28","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.basement_stairwell_bulb"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":900,"wires":[[]]},{"id":"b89658330a0def43","type":"comment","z":"639c9186069191cf","g":"94d9833bdd165f28","name":"Basement Stairwell Light","info":"","x":150,"y":740,"wires":[]},{"id":"d94876c91a1f2728","type":"stoptimer","z":"639c9186069191cf","g":"94d9833bdd165f28","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":350,"y":900,"wires":[["aa018df181ad26ec"],[]]},{"id":"63112d138b7e87ac","type":"change","z":"639c9186069191cf","g":"94d9833bdd165f28","name":"send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":840,"wires":[["d94876c91a1f2728"]]},{"id":"a105812125b5b0ec","type":"server-state-changed","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","name":"Dawn Mart Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.dawn_mart_motion_rear_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":1040,"wires":[["29f3c9eb5836d1a6"],["a78367936a0f7e37"]]},{"id":"29f3c9eb5836d1a6","type":"api-call-service","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.dawn_mart_bulb"],"data":"{\"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":1020,"wires":[["8968f7b747d32938"]]},{"id":"f4ab256fdd14049f","type":"api-call-service","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.dawn_mart_bulb"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":1160,"wires":[[]]},{"id":"bca9f9f1f42234c6","type":"comment","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","name":"Dawn Mart Light","info":"","x":120,"y":1000,"wires":[]},{"id":"a78367936a0f7e37","type":"stoptimer","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":350,"y":1160,"wires":[["f4ab256fdd14049f"],[]]},{"id":"8968f7b747d32938","type":"change","z":"639c9186069191cf","g":"45a8d2ff3ec0e6b4","name":"send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1100,"wires":[["a78367936a0f7e37"]]},{"id":"ec8848ee288c1fbf","type":"server-state-changed","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","name":"Dawn Mart Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.rack_area_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":1300,"wires":[["06d5ba823874c8e9"],["2682834243cce2e6"]]},{"id":"06d5ba823874c8e9","type":"api-call-service","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.rack_area_bulb"],"data":"{\"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":1280,"wires":[["b1af1168f573e739"]]},{"id":"a73bf0d8a929a9dc","type":"api-call-service","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","name":"","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.rack_area_bulb"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":1420,"wires":[[]]},{"id":"267baafb82473771","type":"comment","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","name":"Rack Area Light","info":"","x":120,"y":1260,"wires":[]},{"id":"2682834243cce2e6","type":"stoptimer","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":350,"y":1420,"wires":[["a73bf0d8a929a9dc"],[]]},{"id":"b1af1168f573e739","type":"change","z":"639c9186069191cf","g":"3ae3d31c8a4c2f1f","name":"send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1360,"wires":[["2682834243cce2e6"]]},{"id":"77cf8c536fdbf780","type":"hubitat device","z":"639c9186069191cf","g":"732c4968d0704c9f","deviceLabel":"Porch - Multi Sensor ","name":"","server":"e03140c5.bed32","deviceId":"187","attribute":"illuminance","sendEvent":false,"x":480,"y":1600,"wires":[["fb4d7707e43d7375"]]},{"id":"ace9b3277e754871","type":"comment","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Under Cabinet Night Lighting","info":" - ","x":160,"y":1520,"wires":[]},{"id":"4ee014b9e696557a","type":"stoptimer","z":"639c9186069191cf","g":"732c4968d0704c9f","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":850,"y":1640,"wires":[["e03e257b83149a03"],[]]},{"id":"306417917383d4ee","type":"change","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1600,"wires":[["4ee014b9e696557a"]]},{"id":"510968ff37887e74","type":"change","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"global.currentLux","rules":[{"t":"set","p":"payload","pt":"msg","to":"currentLux","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1520,"wires":[[]]},{"id":"f77db8e1adcdb649","type":"switch","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Off? ","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":890,"y":1520,"wires":[["f33bd40b1a4059cf"]]},{"id":"f33bd40b1a4059cf","type":"api-call-service","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Under Cabient Lights","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.kitchen_under_cabinet_lights"],"data":"{\"brightness\": 200}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":1520,"wires":[["306417917383d4ee"]]},{"id":"e03e257b83149a03","type":"api-call-service","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Under Cabient Lights","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.kitchen_under_cabinet_lights"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":1680,"wires":[[]]},{"id":"1e89cde8c6b8f4b1","type":"server-state-changed","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Kitchen Beam Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.kitchen_beam_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":1580,"wires":[["77cf8c536fdbf780"],["8409550b3d82b4e9"]]},{"id":"a548b62db2a255d4","type":"server-state-changed","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Kitchen Wide Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.kitchen_wide_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1640,"wires":[["77cf8c536fdbf780"],["b2a1d74a54b45ba1"]]},{"id":"7f2441b50d3ce3ca","type":"api-current-state","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Island Light","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_island_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":1520,"wires":[["f77db8e1adcdb649"]]},{"id":"b2a1d74a54b45ba1","type":"api-current-state","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Kitchen Beam Motion","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.kitchen_beam_motion_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":1720,"wires":[["1ad50294fce297db"]]},{"id":"1ad50294fce297db","type":"switch","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Off? ","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":1720,"wires":[["4ee014b9e696557a"]]},{"id":"0116add683dd1b8d","type":"switch","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Off? ","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":1660,"wires":[["4ee014b9e696557a"]]},{"id":"8409550b3d82b4e9","type":"api-current-state","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"Kitchen Wide Motion","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.kitchen_wide_motion_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":1660,"wires":[["0116add683dd1b8d"]]},{"id":"fb4d7707e43d7375","type":"switch","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"lt","v":"333","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":1520,"wires":[["7f2441b50d3ce3ca"]]},{"id":"ffbc88b06ae62785","type":"inject","z":"639c9186069191cf","g":"732c4968d0704c9f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":840,"y":1720,"wires":[["e03e257b83149a03"]]},{"id":"484d71f61170a3a5","type":"change","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1940,"wires":[["a035d793e9da3ea4","bb72bc77b87d5e03"]]},{"id":"fb176af7b10aa816","type":"switch","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"<900 Lux?","property":"payload.value","propertyType":"msg","rules":[{"t":"lt","v":"900","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":668,"y":1946,"wires":[["80a0ebc2a15490ed"]]},{"id":"30eabe623a28fe54","type":"hubitat device","z":"639c9186069191cf","g":"56a1de63e7bffcac","deviceLabel":"","name":"Garage Multi","server":"e03140c5.bed32","deviceId":"288","attribute":"motion","sendEvent":true,"x":110,"y":1880,"wires":[["115ef094fb443168"]]},{"id":"6873015206c2effa","type":"comment","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Garage Light","info":" - ","x":117,"y":1819,"wires":[]},{"id":"bb72bc77b87d5e03","type":"stoptimer","z":"639c9186069191cf","g":"56a1de63e7bffcac","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":691,"y":1999,"wires":[["7ea88d48d7408d75"],[]]},{"id":"115ef094fb443168","type":"switch","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Active/Inactive","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":1880,"wires":[["2b65ab989d0f371d"],["239f19bd81aa99fe"]]},{"id":"ee6d9aeccb5f47e1","type":"switch","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"off?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":711,"y":1877.0001220703125,"wires":[["a035d793e9da3ea4"]]},{"id":"a035d793e9da3ea4","type":"stoptimer","z":"639c9186069191cf","g":"56a1de63e7bffcac","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":920,"y":1876.0000915527344,"wires":[["9af057d51cdacfd8"],[]]},{"id":"ca36ee306e17d843","type":"inject","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":711,"y":2039,"wires":[["7ea88d48d7408d75"]]},{"id":"ec5c13b388f2dca6","type":"server-state-changed","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Back Door Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.back_door_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":2060,"wires":[["2b65ab989d0f371d"],["e33bd74f545e4451"]]},{"id":"2b65ab989d0f371d","type":"hubitat device","z":"639c9186069191cf","g":"56a1de63e7bffcac","deviceLabel":"Porch - Multi Sensor ","name":"","server":"e03140c5.bed32","deviceId":"187","attribute":"illuminance","sendEvent":false,"x":420,"y":1960,"wires":[["fb176af7b10aa816"]]},{"id":"239f19bd81aa99fe","type":"api-current-state","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Back Door Motion","server":"1e8aa73b.d1f5b9","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.back_door_motion_occupancy","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":1880,"wires":[["ee6d9aeccb5f47e1"]]},{"id":"3f2e3b00b32ccf47","type":"server-state-changed","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Kitchen Door Contact","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.kitchen_door_contact_contact","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":2000,"wires":[["2b65ab989d0f371d"],[]]},{"id":"9af057d51cdacfd8","type":"api-call-service","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Garage Lights","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.kitchen_garage_lights"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1113,"y":1871,"wires":[[]]},{"id":"7ea88d48d7408d75","type":"api-call-service","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Garage Lights Off","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.kitchen_garage_lights"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":921,"y":1999,"wires":[[]]},{"id":"80a0ebc2a15490ed","type":"api-call-service","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Garage Lights On","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.kitchen_garage_lights"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":885,"y":1940,"wires":[["484d71f61170a3a5"]]},{"id":"e33bd74f545e4451","type":"hubitat device","z":"639c9186069191cf","g":"56a1de63e7bffcac","deviceLabel":"","name":"Garage Multi","server":"e03140c5.bed32","deviceId":"288","attribute":"motion","sendEvent":false,"x":350,"y":2060,"wires":[["be8f7643c7db82cc"]]},{"id":"be8f7643c7db82cc","type":"switch","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Inactive?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":520,"y":2060,"wires":[["bb72bc77b87d5e03"]]},{"id":"09e2fdfb6c7f1833","type":"server-state-changed","z":"639c9186069191cf","g":"56a1de63e7bffcac","name":"Back Door Contact","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.back_door_contact_contact","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":1940,"wires":[["2b65ab989d0f371d"],[]]},{"id":"e5681f80e7c9445e","type":"comment","z":"639c9186069191cf","name":"Mud Room","info":" - ","x":140,"y":2220,"wires":[]},{"id":"eefc1de7a45112b7","type":"hubitat command","z":"639c9186069191cf","name":"Off","server":"c0da6dea.8576a","deviceId":"2920","command":"off","commandArgs":"","x":590,"y":2340,"wires":[[]]},{"id":"e8e7b354e44244f0","type":"hubitat device","z":"639c9186069191cf","deviceLabel":"","name":"Mud Room Light","server":"c0da6dea.8576a","deviceId":"2919","attribute":"switch","sendEvent":false,"x":920,"y":2180,"wires":[[]]},{"id":"d214cc55d9e2b27d","type":"change","z":"639c9186069191cf","name":"Send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":2200,"wires":[["6eb0405312379087"]]},{"id":"6eb0405312379087","type":"stoptimer","z":"639c9186069191cf","duration":"30","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":910,"y":2240,"wires":[["581002f4942493f6"],[]]},{"id":"581002f4942493f6","type":"hubitat command","z":"639c9186069191cf","deviceLabel":"","name":"Mud Room Light Off","server":"c0da6dea.8576a","deviceId":"2919","command":"off","commandArgs":"","x":1140,"y":2240,"wires":[[]]},{"id":"603a0ee0c7486a98","type":"server-state-changed","z":"639c9186069191cf","name":"Mud Room Motion","server":"1e8aa73b.d1f5b9","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.mud_room_motion_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":2340,"wires":[["d214cc55d9e2b27d"],["6eb0405312379087"]]},{"id":"d63fe17e8b132089","type":"api-call-service","z":"639c9186069191cf","name":"Garage Lights","server":"1e8aa73b.d1f5b9","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.kitchen_garage_lights"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":480,"y":2280,"wires":[[]]},{"id":"1e8aa73b.d1f5b9","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"e03140c5.bed32","type":"hubitat config","name":"Zwave Plus Hub","usetls":false,"host":"10.20.1.23","port":"80","appId":"43","nodeRedServer":"http://10.13.9.136:1880","webhookPath":"/hubitat/webhook___","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#000000"},{"id":"c0da6dea.8576a","type":"hubitat config","name":"ZigBee Hub","usetls":false,"host":"10.20.1.21","port":"80","appId":"2532","nodeRedServer":"http://10.13.9.29:1880","webhookPath":"/hubitat/webhook__","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#000000"}]

Adding a second motion senor with check/balance doubles your fun!

Summary
[
    {
        "id": "912f72f887502444",
        "type": "group",
        "z": "ec870aa5a23fcf23",
        "name": "",
        "style": {
            "fill": "#e3f3d3",
            "label": true
        },
        "nodes": [
            "01939e8b372cd5c1",
            "7d97c88428623e54",
            "7647b163e7f1efa9",
            "f81d8348274c8ff5",
            "76439042460549be",
            "13a0fa08d976c8d3",
            "cd032ecafdd8521a",
            "87d606bc55343d73",
            "d428051d7597fa41",
            "d99d318cc8cdfdc2",
            "bbafdab71536eb72",
            "e6afd86f6b0e94b5",
            "cffa379131f434e6",
            "786eebc62313711d",
            "375d788f4918f0dc",
            "cb4f57f709af67f8",
            "67ce16eb0485fdeb"
        ],
        "x": 14,
        "y": 1279,
        "w": 1292,
        "h": 242
    },
    {
        "id": "01939e8b372cd5c1",
        "type": "hubitat device",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Rack Motion ",
        "server": "c0da6dea.8576a",
        "deviceId": "2252",
        "attribute": "motion",
        "sendEvent": true,
        "x": 190,
        "y": 1380,
        "wires": [
            [
                "76439042460549be",
                "bbafdab71536eb72"
            ]
        ]
    },
    {
        "id": "7d97c88428623e54",
        "type": "hubitat command",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "On",
        "server": "c0da6dea.8576a",
        "deviceId": "681",
        "command": "on",
        "commandArgs": "",
        "x": 770,
        "y": 1420,
        "wires": [
            [
                "67ce16eb0485fdeb"
            ]
        ]
    },
    {
        "id": "7647b163e7f1efa9",
        "type": "hubitat device",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Rack Area Motion ",
        "server": "c0da6dea.8576a",
        "deviceId": "1833",
        "attribute": "motion",
        "sendEvent": true,
        "x": 210,
        "y": 1440,
        "wires": [
            [
                "76439042460549be",
                "13a0fa08d976c8d3"
            ]
        ]
    },
    {
        "id": "f81d8348274c8ff5",
        "type": "hubitat command",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Off",
        "server": "c0da6dea.8576a",
        "deviceId": "681",
        "command": "off",
        "commandArgs": "",
        "x": 1230,
        "y": 1380,
        "wires": [
            []
        ]
    },
    {
        "id": "76439042460549be",
        "type": "switch",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Active/Inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 460,
        "y": 1420,
        "wires": [
            [
                "786eebc62313711d"
            ],
            []
        ]
    },
    {
        "id": "13a0fa08d976c8d3",
        "type": "switch",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Active/Inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 460,
        "y": 1480,
        "wires": [
            [],
            [
                "cd032ecafdd8521a"
            ]
        ]
    },
    {
        "id": "cd032ecafdd8521a",
        "type": "hubitat device",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Rack Motion",
        "server": "c0da6dea.8576a",
        "deviceId": "2252",
        "attribute": "motion",
        "sendEvent": false,
        "x": 670,
        "y": 1480,
        "wires": [
            [
                "87d606bc55343d73"
            ]
        ]
    },
    {
        "id": "87d606bc55343d73",
        "type": "switch",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Active/Inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 860,
        "y": 1480,
        "wires": [
            [],
            [
                "375d788f4918f0dc"
            ]
        ]
    },
    {
        "id": "d428051d7597fa41",
        "type": "hubitat device",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Rack Area Motion",
        "server": "c0da6dea.8576a",
        "deviceId": "1833",
        "attribute": "motion",
        "sendEvent": false,
        "x": 670,
        "y": 1360,
        "wires": [
            [
                "d99d318cc8cdfdc2"
            ]
        ]
    },
    {
        "id": "d99d318cc8cdfdc2",
        "type": "switch",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Active/Inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 860,
        "y": 1360,
        "wires": [
            [],
            [
                "cb4f57f709af67f8"
            ]
        ]
    },
    {
        "id": "bbafdab71536eb72",
        "type": "switch",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Active/Inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 460,
        "y": 1360,
        "wires": [
            [],
            [
                "d428051d7597fa41"
            ]
        ]
    },
    {
        "id": "e6afd86f6b0e94b5",
        "type": "hubitat command",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Off",
        "server": "c0da6dea.8576a",
        "deviceId": "681",
        "command": "off",
        "commandArgs": "",
        "x": 1230,
        "y": 1480,
        "wires": [
            []
        ]
    },
    {
        "id": "cffa379131f434e6",
        "type": "comment",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Rack Area",
        "info": " - ",
        "x": 100,
        "y": 1320,
        "wires": []
    },
    {
        "id": "786eebc62313711d",
        "type": "hubitat command",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Set to 100%",
        "server": "c0da6dea.8576a",
        "deviceId": "681",
        "command": "setLevel",
        "commandArgs": "100",
        "x": 630,
        "y": 1420,
        "wires": [
            [
                "7d97c88428623e54"
            ]
        ]
    },
    {
        "id": "375d788f4918f0dc",
        "type": "stoptimer",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "duration": "1",
        "units": "Minute",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "",
        "x": 1080,
        "y": 1480,
        "wires": [
            [
                "e6afd86f6b0e94b5"
            ],
            []
        ]
    },
    {
        "id": "cb4f57f709af67f8",
        "type": "stoptimer",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "duration": "1",
        "units": "Minute",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "",
        "x": 1080,
        "y": 1380,
        "wires": [
            [
                "f81d8348274c8ff5"
            ],
            []
        ]
    },
    {
        "id": "67ce16eb0485fdeb",
        "type": "change",
        "z": "ec870aa5a23fcf23",
        "g": "912f72f887502444",
        "name": "Send STOP",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "STOP",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 1420,
        "wires": [
            [
                "cb4f57f709af67f8",
                "375d788f4918f0dc"
            ]
        ]
    },
    {
        "id": "c0da6dea.8576a",
        "type": "hubitat config",
        "name": "ZigBee Hub",
        "usetls": false,
        "host": "10.20.1.21",
        "port": "80",
        "appId": "2532",
        "nodeRedServer": "http://10.13.9.29:1880",
        "webhookPath": "/hubitat/webhook__",
        "autoRefresh": true,
        "useWebsocket": false,
        "colorEnabled": false,
        "color": "#000000"
    }
]

How about now.

Thanks for the input BTW. I was wondering about whether it would cancel on the state changing to active again. Was going to test further this evening.
Thanks for the sanity check as well. :+1:

warmer.

I updated the “how to”. Start from nothing, and follow the clicks. Should look like “example” in the “how to” before putting your code in.

No screenshots or examples at this second, but I actually use node-red-contrib-multi-sensor to manage that, makes merging together multiple sensors very easy since you only have to deal with a single output

3 Likes

Going to check this one out!

Another good one is node-red-contrib-boolean-logic-ultimate but it isn’t purpose built like yours, so it is harder to use. I think it can be much more powerful though.

Isn’t it in the sauce already? It was on the last CORE update that I got.

Oh is boolean logic ultimate included by default? I haven’t gotten a chance to boot up CORE yet.

Screenshot

Unfortunately this doesn’t work as expected.
Down Loo going active OR Lux <20 turning on triggers the lights on.
I want Down Loo active AND Lux <20 on before the lights turn on.
I need some sort of AND expression to make it work.
Any ideas?

Can you show your two switch nodes logic and an example payload from Down Loo and Lux <20 (easiest way is to push those nodes via inject into a debug node)?

Also did you want a lux change to also be a trigger? Because if not you want to turn off send events (the filled green box should turn to an empty green box).

You look to be very close though.

AND’s are implied by wiring in series depending on the switch nodes you use.

2 Likes

Your Lux switch is “sending events” you need to turn that off since it’s just a “check gate”.

With HE node a filled in square means it will send (trigger) events starting where ever the node is.

image

The hole should be empty

image

2 Likes

BOOM!!! We have a winner!!!
Gosh this learning curve is steep.
Thank you.

1 Like

TBH you were fine on the core NR logic, your issue seems like it was just with interfacing with the HE nodes, which obviously won’t 1:1 translate to CORE, but getting the core NR logic down will.

2 Likes

Funny I think NR is simple and webcore was impossible for me! I gave up on it.

2 Likes