Node Red - Adding Illuminance level to a motion initiated flow

How long can one play the new-be card? Anyway, I have a motion flow to turn on my garage lights based on the mode. I would like to include a lux level into the mix for dark mornings. Below is what I have, I would eliminate the time range node. I have the illuminance device and the switch above the motion flow. Where and how would I plug them into the flow so that it turns on if there is motion and the lux is less than X during the daytime mode?

Thank you in advance!

@douglaspitman If you are eliminating the time range switch, the lux node and switch would take its place

Would I connect the (day) mode switch to the front of the illuminance sensor?

Assuming top output is day, that would connect to lux node then the less than 100 output connect to garage light switch node

I'm pretty sure I have a flow posted somewhere way above that has lux in the flow. If you want to find it
Otherwise when I'm back home I could post mine!

great, Id like to see other flows.

If you can't find a flow I've posted somewhere way up there way :point_up_2:
I'll post it tonight.
I'm sure others will have lux flows they could share!

I have LUX in all my light flows. This is my office lights, based on motion, and if LUX is less or greater than 350. It also brings Modes into it (which is a subflow).

[{"id":"a5be72f4.b867","type":"subflow","name":"GetMode","info":"","category":"","in":[{"x":120,"y":240,"wires":[{"id":"47f96bf1.d81e44"}]}],"out":[{"x":660,"y":120,"wires":[{"id":"4a08d4c2.db961c","port":0}]},{"x":660,"y":160,"wires":[{"id":"4a08d4c2.db961c","port":1}]},{"x":660,"y":200,"wires":[{"id":"4a08d4c2.db961c","port":2}]},{"x":660,"y":240,"wires":[{"id":"4a08d4c2.db961c","port":3}]},{"x":660,"y":280,"wires":[{"id":"4a08d4c2.db961c","port":4}]},{"x":660,"y":320,"wires":[{"id":"4a08d4c2.db961c","port":5}]},{"x":660,"y":360,"wires":[{"id":"4a08d4c2.db961c","port":6}]}],"env":[],"color":"#DDAA99","outputLabels":["Home","Night","Away","Roy_Home_Alone","Holiday","Cleaning_in_Progress","Evening"]},{"id":"47f96bf1.d81e44","type":"hubitat mode","z":"a5be72f4.b867","name":"Mode","server":"1100d0ca.ab596f","sendEvent":false,"x":360,"y":240,"wires":[["4a08d4c2.db961c"]]},{"id":"4a08d4c2.db961c","type":"switch","z":"a5be72f4.b867","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Home","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Away","vt":"str"},{"t":"eq","v":"Roy_Home_Alone","vt":"str"},{"t":"eq","v":"Holiday","vt":"str"},{"t":"eq","v":"Cleaning_in_Progress","vt":"str"},{"t":"eq","v":"Evening","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":510,"y":240,"wires":[[],[],[],[],[],[],[]]},{"id":"1100d0ca.ab596f","type":"hubitat config","z":"","name":"Hub_2","usetls":false,"host":"192.168.1.26","port":"80","appId":"9112","nodeRedServer":"http://192.168.1.10:1880","webhookPath":"/hubitat/webhook_","autoRefresh":true,"useWebsocket":false},{"id":"809d663d.27f438","type":"switch","z":"5f2605eb.0069ec","name":"","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":170,"y":2160,"wires":[["89b95fd9.ed92f"],["10df10e.10b3eef"]]},{"id":"4c512b5b.d019a4","type":"comment","z":"5f2605eb.0069ec","name":"Office","info":"","x":90,"y":2040,"wires":[]},{"id":"89b95fd9.ed92f","type":"hubitat device","z":"5f2605eb.0069ec","name":"LUX Sensor","server":"56b69ca1.36f034","deviceId":"64","attribute":"illuminance","sendEvent":false,"x":390,"y":2100,"wires":[["32dc3bef.357f34"]]},{"id":"32dc3bef.357f34","type":"switch","z":"5f2605eb.0069ec","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"lt","v":"350","vt":"str"},{"t":"gte","v":"350","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":2100,"wires":[["2d79572d.0b63e8","d00b1a2.3b015e8"],["5e5559e4.ab1a88"]]},{"id":"2d79572d.0b63e8","type":"subflow:a5be72f4.b867","z":"5f2605eb.0069ec","name":"","x":800,"y":2120,"wires":[["990d90ca.2f892"],["83f75e51.a0969"],[],[],[],["990d90ca.2f892"],["83f75e51.a0969"]]},{"id":"d00b1a2.3b015e8","type":"change","z":"5f2605eb.0069ec","name":"stop the timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":2160,"wires":[["10df10e.10b3eef"]]},{"id":"10df10e.10b3eef","type":"stoptimer-varidelay","z":"5f2605eb.0069ec","duration":"5","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","persist":true,"x":380,"y":2220,"wires":[["5e5559e4.ab1a88"],[],[]]},{"id":"28fdb2c9.6c67ee","type":"hubitat device","z":"5f2605eb.0069ec","name":"Office Motion Sensor","server":"56b69ca1.36f034","deviceId":"1075","attribute":"motion","sendEvent":true,"x":160,"y":2100,"wires":[["809d663d.27f438"]]},{"id":"5e5559e4.ab1a88","type":"template","z":"5f2605eb.0069ec","name":"Off","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n    \"on\": false\n}","output":"json","x":570,"y":2220,"wires":[["1480cbe.2785234"]]},{"id":"1480cbe.2785234","type":"hue-light","z":"5f2605eb.0069ec","name":"Office Spots","bridge":"1b5168ed.108067","lightid":"46","colornamer":false,"skipevents":false,"x":730,"y":2220,"wires":[[]]},{"id":"990d90ca.2f892","type":"template","z":"5f2605eb.0069ec","name":"100%","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n    \"brightness\": 100\n}","output":"json","x":990,"y":2100,"wires":[["63b1d4f3.327c8c"]]},{"id":"83f75e51.a0969","type":"template","z":"5f2605eb.0069ec","name":"50%","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n    \"brightness\": 50\n}","output":"json","x":990,"y":2140,"wires":[["63b1d4f3.327c8c"]]},{"id":"63b1d4f3.327c8c","type":"hue-light","z":"5f2605eb.0069ec","name":"Office Spots","bridge":"1b5168ed.108067","lightid":"46","colornamer":false,"skipevents":false,"x":1150,"y":2120,"wires":[[]]},{"id":"56b69ca1.36f034","type":"hubitat config","z":"","name":"Hub_1","usetls":false,"host":"192.168.1.25","port":"80","appId":"40","nodeRedServer":"http://192.168.1.10:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false},{"id":"1b5168ed.108067","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.99","key":"f0hrZKKy8DMirr2ZTCRlBjL6PZcHP8p-AXynonj1","interval":"3000","disableupdates":false}]

Modes Subflow

[{"id":"16d98ec7.0f1cc1","type":"subflow","name":"Mode","info":"","category":"","in":[{"x":60,"y":240,"wires":[{"id":"c60bf7fc.c3d8f8"}]}],"out":[{"x":740,"y":100,"wires":[{"id":"7dec3c67.53b3d4","port":0}]},{"x":740,"y":140,"wires":[{"id":"fd0452a0.76eca","port":0}]},{"x":740,"y":180,"wires":[{"id":"69996fd3.78e94","port":0}]},{"x":740,"y":220,"wires":[{"id":"a195aa6a.7024e8","port":0}]},{"x":740,"y":260,"wires":[{"id":"74b82d79.f461a4","port":0}]},{"x":740,"y":300,"wires":[{"id":"b1e9fbd.5bc5a08","port":0}]},{"x":740,"y":340,"wires":[{"id":"fa49250b.e50708","port":0}]}],"env":[{"name":"Home","type":"str","value":""},{"name":"Night","type":"str","value":""},{"name":"Away","type":"str","value":""},{"name":"Home Alone","type":"str","value":""},{"name":"Holiday","type":"str","value":""},{"name":"Cleaning","type":"str","value":""},{"name":"Evening","type":"str","value":""}],"color":"#DDAA99"},{"id":"c60bf7fc.c3d8f8","type":"http request","z":"16d98ec7.0f1cc1","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.26/apps/api/9112/modes?access_token=75f004f2-f52e-4c9c-9806-2d73f792ce3f","tls":"","persist":false,"proxy":"","authType":"","x":190,"y":240,"wires":[["7602246e.aa02bc","482eddf1.067e14","eb9d8fab.7734d","29132316.172e2c","a471dcce.59b09","37eea375.e045bc","4cd1b7bf.5031c8"]]},{"id":"7602246e.aa02bc","type":"string","z":"16d98ec7.0f1cc1","name":"Home","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.0.active","propout":"payload","object":"msg","objectout":"msg","x":390,"y":100,"wires":[["7dec3c67.53b3d4"]],"outputLabels":["Home"]},{"id":"482eddf1.067e14","type":"string","z":"16d98ec7.0f1cc1","name":"Night","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.1.active","propout":"payload","object":"msg","objectout":"msg","x":390,"y":140,"wires":[["fd0452a0.76eca"]],"outputLabels":["Night"]},{"id":"eb9d8fab.7734d","type":"string","z":"16d98ec7.0f1cc1","name":"Away","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.2.active","propout":"payload","object":"msg","objectout":"msg","x":390,"y":180,"wires":[["69996fd3.78e94"]],"outputLabels":["Away"]},{"id":"29132316.172e2c","type":"string","z":"16d98ec7.0f1cc1","name":"Evening","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.6.active","propout":"payload","object":"msg","objectout":"msg","x":400,"y":340,"wires":[["fa49250b.e50708"]],"outputLabels":["Evening"]},{"id":"a471dcce.59b09","type":"string","z":"16d98ec7.0f1cc1","name":"Roy_Home_Alone","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.3.active","propout":"payload","object":"msg","objectout":"msg","x":430,"y":220,"wires":[["a195aa6a.7024e8"]],"outputLabels":["Home Alone"]},{"id":"37eea375.e045bc","type":"string","z":"16d98ec7.0f1cc1","name":"Cleaning","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.5.active","propout":"payload","object":"msg","objectout":"msg","x":400,"y":300,"wires":[["b1e9fbd.5bc5a08"]],"outputLabels":["Cleaning"]},{"id":"4cd1b7bf.5031c8","type":"string","z":"16d98ec7.0f1cc1","name":"Holiday","methods":[{"name":"delLeftMost","params":[{"type":"str","value":""}]}],"prop":"payload.4.active","propout":"payload","object":"msg","objectout":"msg","x":400,"y":260,"wires":[["74b82d79.f461a4"]],"outputLabels":["Holiday"]},{"id":"7dec3c67.53b3d4","type":"switch","z":"16d98ec7.0f1cc1","name":"Home","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":100,"wires":[[]],"outputLabels":["Home"]},{"id":"fd0452a0.76eca","type":"switch","z":"16d98ec7.0f1cc1","name":"Night","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":140,"wires":[[]],"outputLabels":["Night"]},{"id":"69996fd3.78e94","type":"switch","z":"16d98ec7.0f1cc1","name":"Away","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":180,"wires":[[]],"outputLabels":["Away"]},{"id":"a195aa6a.7024e8","type":"switch","z":"16d98ec7.0f1cc1","name":"Home Alone","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":220,"wires":[[]],"outputLabels":["Home Alone"]},{"id":"74b82d79.f461a4","type":"switch","z":"16d98ec7.0f1cc1","name":"Holiday","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":260,"wires":[[]],"outputLabels":["Holiday"]},{"id":"b1e9fbd.5bc5a08","type":"switch","z":"16d98ec7.0f1cc1","name":"Cleaning","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":300,"wires":[[]],"outputLabels":["Cleaning"]},{"id":"fa49250b.e50708","type":"switch","z":"16d98ec7.0f1cc1","name":"Evening","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":620,"y":340,"wires":[[]],"outputLabels":["Evening"]}]
2 Likes

Starting simple here is my front walk that is just motion on one sensor with lux check point.

Front Walk Sequence
[{"id":"91048c9e.d2b68","type":"switch","z":"a0d5236f.7d257","name":"<50?","property":"payload.value","propertyType":"msg","rules":[{"t":"lt","v":"50","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":770,"y":2720,"wires":[["a39622dc.cd067"]]},{"id":"a39622dc.cd067","type":"hubitat command","z":"a0d5236f.7d257","name":"Front Path Lights On","server":"e56053d2.c7d11","deviceId":"842","command":"on","commandArgs":"","x":960,"y":2720,"wires":[["f61eba15.86bcf8"]]},{"id":"1b7a6854.b64478","type":"hubitat device","z":"a0d5236f.7d257","name":"Lux","server":"e56053d2.c7d11","deviceId":"2503","attribute":"illuminance","sendEvent":false,"x":630,"y":2720,"wires":[["91048c9e.d2b68"]]},{"id":"33a87517.551f5a","type":"hubitat device","z":"a0d5236f.7d257","name":"Front Walkway Motion","server":"e56053d2.c7d11","deviceId":"1448","attribute":"motion","sendEvent":true,"x":240,"y":2760,"wires":[["b3dfb336.67947"]]},{"id":"b3dfb336.67947","type":"switch","z":"a0d5236f.7d257","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":2760,"wires":[["1b7a6854.b64478"],["9fc35f77.9a96b"]]},{"id":"a3856448.423f78","type":"hubitat command","z":"a0d5236f.7d257","name":"Front Path Lights Off","server":"e56053d2.c7d11","deviceId":"842","command":"off","commandArgs":"","x":920,"y":2820,"wires":[[]]},{"id":"46aebacb.c65a64","type":"comment","z":"a0d5236f.7d257","name":"Front Walk","info":" - ","x":140,"y":2640,"wires":[]},{"id":"9fc35f77.9a96b","type":"stoptimer","z":"a0d5236f.7d257","duration":"3","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":720,"y":2820,"wires":[["a3856448.423f78"],[]]},{"id":"f61eba15.86bcf8","type":"change","z":"a0d5236f.7d257","name":"Send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":2720,"wires":[["9fc35f77.9a96b"]]},{"id":"e56053d2.c7d11","type":"hubitat config","z":"","name":"Devices Hub","usetls":false,"host":"10.13.9.11","port":"80","appId":"2532","nodeRedServer":"http://10.13.9.28:1880","webhookPath":"/hubitat/webhook__","autoRefresh":true,"useWebsocket":false}]

My garage setup is more complex. I like to use contacts since they trigger faster than motion on door openings. However we also want the light to stay on if we are in the garage for an extended time (trash day, holiday decoration setup/put away)

Garage Sequence
[{"id":"5361f687.22f1e8","type":"switch","z":"a0d5236f.7d257","name":"- 500 Lux?","property":"payload.value","propertyType":"msg","rules":[{"t":"lt","v":"500","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":3100,"wires":[["ede9b63a.2ccf78"]]},{"id":"ede9b63a.2ccf78","type":"hubitat command","z":"a0d5236f.7d257","name":"Garage Lights On","server":"e56053d2.c7d11","deviceId":"595","command":"on","commandArgs":"","x":910,"y":3100,"wires":[["3b6f4f9c.a632e"]]},{"id":"e818ecad.39cde","type":"hubitat device","z":"a0d5236f.7d257","name":"Lux","server":"e56053d2.c7d11","deviceId":"2503","attribute":"illuminance","sendEvent":false,"x":590,"y":3100,"wires":[["5361f687.22f1e8"]]},{"id":"ae4c7f57.cc018","type":"hubitat device","z":"a0d5236f.7d257","name":"Garage Multi","server":"e56053d2.c7d11","deviceId":"390","attribute":"motion","sendEvent":true,"x":190,"y":3100,"wires":[["8a9bd59a.142ee8","22a2b713.4dc2a8"]]},{"id":"8a9bd59a.142ee8","type":"switch","z":"a0d5236f.7d257","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":400,"y":3080,"wires":[[],["1464d868.21be78"]]},{"id":"fd35a1b3.c6fcc","type":"hubitat command","z":"a0d5236f.7d257","name":"Garage Lights Off","server":"e56053d2.c7d11","deviceId":"595","command":"off","commandArgs":"","x":1270,"y":3160,"wires":[[]]},{"id":"e0ae372e.204398","type":"hubitat device","z":"a0d5236f.7d257","name":"Back Door Motion ","server":"e56053d2.c7d11","deviceId":"524","attribute":"motion","sendEvent":true,"x":210,"y":3160,"wires":[["22a2b713.4dc2a8","ebd60529.f5f988"]]},{"id":"b330255d.a44a38","type":"hubitat device","z":"a0d5236f.7d257","name":"Kitchen Door Contact","server":"e56053d2.c7d11","deviceId":"453","attribute":"contact","sendEvent":true,"x":220,"y":3040,"wires":[["32635ec4.c86742"]]},{"id":"32635ec4.c86742","type":"switch","z":"a0d5236f.7d257","name":"Opened? ","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":3000,"wires":[["e818ecad.39cde"]]},{"id":"43b47afd.183624","type":"comment","z":"a0d5236f.7d257","name":"Garage","info":" - ","x":130,"y":2920,"wires":[]},{"id":"5d846a69.55f344","type":"stoptimer","z":"a0d5236f.7d257","duration":"3","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":1060,"y":3160,"wires":[["fd35a1b3.c6fcc"],[]]},{"id":"22a2b713.4dc2a8","type":"switch","z":"a0d5236f.7d257","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":400,"y":3120,"wires":[["e818ecad.39cde"],[]]},{"id":"ebd60529.f5f988","type":"switch","z":"a0d5236f.7d257","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":400,"y":3180,"wires":[[],["e2fb3d90.bd133"]]},{"id":"19302da1.70c602","type":"switch","z":"a0d5236f.7d257","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":840,"y":3040,"wires":[[],["88435e29.10576"]]},{"id":"3ecff799.147cc8","type":"switch","z":"a0d5236f.7d257","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":820,"y":3160,"wires":[[],["5d846a69.55f344"]]},{"id":"1464d868.21be78","type":"hubitat device","z":"a0d5236f.7d257","name":"Back Door Motion ","server":"e56053d2.c7d11","deviceId":"524","attribute":"motion","sendEvent":false,"x":650,"y":3040,"wires":[["19302da1.70c602"]]},{"id":"e2fb3d90.bd133","type":"hubitat device","z":"a0d5236f.7d257","name":"Garage Multi","server":"e56053d2.c7d11","deviceId":"390","attribute":"motion","sendEvent":false,"x":630,"y":3160,"wires":[["3ecff799.147cc8"]]},{"id":"3b6f4f9c.a632e","type":"change","z":"a0d5236f.7d257","name":"Send STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":3100,"wires":[["5d846a69.55f344","88435e29.10576","476ed98a.f40de8"]]},{"id":"a76012fe.40b85","type":"hubitat command","z":"a0d5236f.7d257","name":"Garage Lights Off","server":"e56053d2.c7d11","deviceId":"595","command":"off","commandArgs":"","x":1270,"y":3040,"wires":[[]]},{"id":"88435e29.10576","type":"stoptimer","z":"a0d5236f.7d257","duration":"3","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":1060,"y":3040,"wires":[["a76012fe.40b85"],[]]},{"id":"e2e2843.0cb8178","type":"hubitat device","z":"a0d5236f.7d257","name":"Back Door Contact","server":"e56053d2.c7d11","deviceId":"1479","attribute":"contact","sendEvent":true,"x":210,"y":2980,"wires":[["32635ec4.c86742"]]},{"id":"7de5d9f7.93f378","type":"hubitat device","z":"a0d5236f.7d257","name":"Garage Light","server":"e56053d2.c7d11","deviceId":"595","attribute":"switch","sendEvent":true,"x":190,"y":3240,"wires":[["ff96ff18.bad7a"]]},{"id":"ff96ff18.bad7a","type":"switch","z":"a0d5236f.7d257","name":"Left On? ","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":3240,"wires":[["476ed98a.f40de8"]]},{"id":"476ed98a.f40de8","type":"stoptimer","z":"a0d5236f.7d257","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":640,"y":3240,"wires":[["29661724.137598"],[]]},{"id":"29661724.137598","type":"hubitat command","z":"a0d5236f.7d257","name":"Garage Lights Off","server":"e56053d2.c7d11","deviceId":"595","command":"off","commandArgs":"","x":850,"y":3240,"wires":[[]]},{"id":"e56053d2.c7d11","type":"hubitat config","z":"","name":"Devices Hub","usetls":false,"host":"10.13.9.11","port":"80","appId":"2532","nodeRedServer":"http://10.13.9.28:1880","webhookPath":"/hubitat/webhook__","autoRefresh":true,"useWebsocket":false}]
2 Likes

Excellent! Thanks.

Another example for you. Didnt get a chance to post this yesterday

When I add illuminance as a condition it turns on erratically and doesn't shut off. I'm using Aeotec MultiSensor 6's for the sensor. The Switch is configured like this:

What am I missing?

Well, does the LUX reading ever go <400 or >650 (not sure which is your OFF condition) after the lights are on? If not, then you can't use that as the off condition.

Most of the time I see people using LUX as a condition to decide whether to turn ON a light, but not to turn it off (that is usually based on a contact or motion sensor timeout).

Numbers not alphanumeric in the conditions.

2 Likes

Good thought, but it's javascript so will auto cast it to a number. So that's not the problem.

I don't use the second output for anything, not sure why I have it. Is this the change you are suggesting when you say numbers?


I have so much to learn...

1 Like

Yes, that's it. I had so much to learn 6 months ago. Now I'm really happy with Node Red.

Are you sure that the lux gets to >625 in the garage?

It doesn't hurt (is a good idea) to specify it as a number instead of string... But I can all but guarantee you that is not the issue (I just tested every combination of string and numbers in a switch node compare and they all work, since js will cast the value).

That said, without seeing the flow I can't guess any further what the issue might be.

So I cheated, I used a similar flow for a porch shade in my screen shots that has the same issues. I just don't have a consistent experience when I use LUX for a factor. The Luxsettings in the garage that I have turning on the light is 0.

The flow is at the top of this topic, I switched the time range node with the lux sensor and switch as suggested.