Node-Red Flow Samples/Sharing

Always room for improvements! If you do please update us, or if someone finds a 'smoother flow' using your idea hopefully they will give back.

I just edited post #2 with some additions that were made. All changes may not be for everyone, but this way we can see and share ideas. Great bonus feature of NR.

In time I hope to organize post #1 index, still pondering the best way to do that.

Figured I'd add an example of a boolean usage, two contacts and one motion sensor control the garage light.

code

[{"id":"b06e26.d529e1d8","type":"hubitat device","z":"3cc9813d.7dcf4e","name":"Garage: Light","server":"f17566a9.c052b8","deviceId":"1043","attribute":"motion","sendEvent":true,"x":100,"y":400,"wires":[["ceeb1404.3c1c48"]]},{"id":"d7ab6ca8.ff371","type":"hubitat device","z":"3cc9813d.7dcf4e","name":"Laundry: Garage door","server":"f17566a9.c052b8","deviceId":"1234","attribute":"contact","sendEvent":true,"x":120,"y":280,"wires":[["fc75782.8dbf888"]]},{"id":"8b6a319.69fdbd","type":"change","z":"3cc9813d.7dcf4e","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":320,"wires":[["744954f2.a1080c","d536d92f.bc83b8"]]},{"id":"f634bb21.8e6a48","type":"hubitat command","z":"3cc9813d.7dcf4e","name":"Garage: Light","server":"f17566a9.c052b8","deviceId":"1043","command":"off","commandArgs":"","x":1440,"y":380,"wires":[[]]},{"id":"b0cfe18d.ed17a","type":"switch","z":"3cc9813d.7dcf4e","name":"Check on","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1280,"y":380,"wires":[["f634bb21.8e6a48"]]},{"id":"306406ee.0e9a1a","type":"hubitat device","z":"3cc9813d.7dcf4e","name":"Garage: Light","server":"f17566a9.c052b8","deviceId":"1043","attribute":"switch","sendEvent":false,"x":1120,"y":380,"wires":[["b0cfe18d.ed17a"]]},{"id":"744954f2.a1080c","type":"stoptimer-varidelay","z":"3cc9813d.7dcf4e","duration":"3","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"last_minute_seconds","x":940,"y":380,"wires":[["306406ee.0e9a1a"],[],[]]},{"id":"b0dc2387.ed01e","type":"hubitat device","z":"3cc9813d.7dcf4e","name":"Garage: Garage door","server":"f17566a9.c052b8","deviceId":"179","attribute":"contact","sendEvent":true,"x":120,"y":340,"wires":[["fc75782.8dbf888"]]},{"id":"ceeb1404.3c1c48","type":"change","z":"3cc9813d.7dcf4e","name":"Motion to Bool","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.value = "active" ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":400,"wires":[["105677ac.b02e58"]]},{"id":"105677ac.b02e58","type":"BooleanLogicUltimate","z":"3cc9813d.7dcf4e","name":"","filtertrue":"both","persist":true,"sInitializeWith":"false","triggertopic":"trigger","outputtriggeredby":"all","inputCount":"3","topic":"result","x":540,"y":360,"wires":[[],["68f1c340.9f16dc"],[]]},{"id":"fc75782.8dbf888","type":"change","z":"3cc9813d.7dcf4e","name":"Contact to Bool","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.value = "open" ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":320,"wires":[["105677ac.b02e58"]]},{"id":"2aa141e9.6a8ebe","type":"hubitat command","z":"3cc9813d.7dcf4e","name":"Garage: Light","server":"f17566a9.c052b8","deviceId":"1043","command":"on","commandArgs":"","x":1440,"y":320,"wires":[[]]},{"id":"685f64ec.e603dc","type":"switch","z":"3cc9813d.7dcf4e","name":"Check on","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1280,"y":320,"wires":[["2aa141e9.6a8ebe"]]},{"id":"d536d92f.bc83b8","type":"hubitat device","z":"3cc9813d.7dcf4e","name":"Garage: Light","server":"f17566a9.c052b8","deviceId":"1043","attribute":"switch","sendEvent":false,"x":1120,"y":320,"wires":[["685f64ec.e603dc"]]},{"id":"68f1c340.9f16dc","type":"switch","z":"3cc9813d.7dcf4e","name":"True/False","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":360,"wires":[["8b6a319.69fdbd"],["744954f2.a1080c"]]},{"id":"f17566a9.c052b8","type":"hubitat config","z":"","name":"","usetls":false,"host":"192.168.2.3","port":"80","appId":"3424","nodeRedServer":"http://192.168.2.9:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]

5 Likes

Here's my spin on motion lighting with dim level adjust. Notice the unconnected (lower left) node. I tried to use actual hall illuminance but the :face_with_symbols_over_mouth: device I was using is so crappy with it's light range and very slow to update so I went back to my previous idea of using the outside light level and assume it means something about the hall light level. When I get a better device installed (like Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor which are excellent BTW) I'll go back to using hall light level.

[{"id":"28cea37b.04605c","type":"tab","label":"Upstairs Hall Motion Lighting with Dim","disabled":false,"info":""},{"id":"1e9560fd.a0617f","type":"hubitat device","z":"28cea37b.04605c","name":"Front Porch Illuminance","server":"5780d46e.3640ac","deviceId":"98","attribute":"illuminance","sendEvent":true,"x":130,"y":80,"wires":[["b61f8098.f0d67","e2f8252c.0f3678"]]},{"id":"b61f8098.f0d67","type":"range","z":"28cea37b.04605c","minin":"0","maxin":"800","minout":"15","maxout":"80","action":"clamp","round":true,"property":"payload.value","name":"Scale Luminance to Dimmer Level","x":460,"y":80,"wires":[["5b42e22d.974abc"]]},{"id":"5b42e22d.974abc","type":"function","z":"28cea37b.04605c","name":"Save Dimmer Level","func":"flow.set(\"dimmer_level\", msg.payload.value);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":750,"y":80,"wires":[[]]},{"id":"f6b51b14.d16968","type":"hubitat device","z":"28cea37b.04605c","name":"Upstairs Hall Motion","server":"7e632c0e.cc9424","deviceId":"642","attribute":"motion","sendEvent":true,"x":120,"y":240,"wires":[["9671e0c5.21f79","ec2c8101.c6e84"]]},{"id":"ea0899ad.01a438","type":"hubitat device","z":"28cea37b.04605c","name":"Upstairs Hall Illuminace","server":"5780d46e.3640ac","deviceId":"514","attribute":"illuminance","sendEvent":true,"x":130,"y":320,"wires":[[]]},{"id":"ec2c8101.c6e84","type":"gate","z":"28cea37b.04605c","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":true,"x":410,"y":160,"wires":[["25c4f2da.c6bc9e","25d61660.1e0fba"]]},{"id":"d99561fa.01f7","type":"hubitat command","z":"28cea37b.04605c","name":"Set Dim Level","server":"7e632c0e.cc9424","deviceId":"194","command":"setLevel","commandArgs":"","x":760,"y":160,"wires":[[]]},{"id":"afa9ebd6.eb5608","type":"hubitat command","z":"28cea37b.04605c","name":"Turn Off","server":"5780d46e.3640ac","deviceId":"194","command":"off","commandArgs":"","x":540,"y":260,"wires":[[]]},{"id":"25c4f2da.c6bc9e","type":"function","z":"28cea37b.04605c","name":"Get Dimmer Level","func":"msg.arguments=flow.get(\"dimmer_level\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":160,"wires":[["d99561fa.01f7"]]},{"id":"a0b1b4e2.7e4d58","type":"change","z":"28cea37b.04605c","name":"Open Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":140,"wires":[["ec2c8101.c6e84"]]},{"id":"e2f8252c.0f3678","type":"switch","z":"28cea37b.04605c","name":"<= 775","property":"payload.value","propertyType":"msg","rules":[{"t":"lte","v":"775","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":90,"y":160,"wires":[["a0b1b4e2.7e4d58"],["43a7d485.35c3bc"]]},{"id":"43a7d485.35c3bc","type":"change","z":"28cea37b.04605c","name":"Close Gate","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":180,"wires":[["ec2c8101.c6e84"]]},{"id":"9671e0c5.21f79","type":"trigger","z":"28cea37b.04605c","name":"Delay Off","op1":"","op2":"false","op1type":"nul","op2type":"bool","duration":"2","extend":true,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":340,"y":240,"wires":[[],["afa9ebd6.eb5608"]]},{"id":"25d61660.1e0fba","type":"hubitat command","z":"28cea37b.04605c","name":"Turn On","server":"7e632c0e.cc9424","deviceId":"194","command":"on","commandArgs":"","x":540,"y":220,"wires":[[]]},{"id":"5780d46e.3640ac","type":"hubitat config","z":"","name":"Steve's Hubitat - webhook","usetls":false,"host":"192.168.1.12","port":"80","appId":"545","nodeRedServer":"http://pvr.localdomain:1880","webhookPath":"/hubitat/webhook_","autoRefresh":true,"useWebsocket":false},{"id":"7e632c0e.cc9424","type":"hubitat config","z":"","name":"Steve's Hubitat - websocket","usetls":false,"host":"hubitat.localdomain","port":"80","appId":"545","nodeRedServer":"http://pvr.localdomain:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":true}]
1 Like

Need to go find the delay off node!

It's a trigger node which, if I remember right, is one of the standard nodes that comes with NR.

EDIT: Just checked and it does indeed come with NR so you should already have it. :slightly_smiling_face:

Just looked, and it can be just like a stoppable timer, nice!

Here's a quick snippet to reformat Plex webhook posts to a usable payload object.

image

Summary

[{"id":"f14f1bdb.dfc4f8","type":"http in","z":"bf2927e5.5af798","name":"Plex","url":"/plex","method":"post","upload":false,"swaggerDoc":"","x":190,"y":1320,"wires":[["dab826b7.e0ffb8"]]},{"id":"b435eec3.0a2e1","type":"debug","z":"bf2927e5.5af798","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":1320,"wires":[]},{"id":"dab826b7.e0ffb8","type":"function","z":"bf2927e5.5af798","name":"Reformat Multipart Plex Message","func":"msg.payload = msg.payload.toString();\nmsg.payload = msg.payload.replace(/.*\\r\\n.*\\r\\n.*application\\/json\\r\\n\\r\\n/g,\"\");\nmsg.payload = msg.payload.match(/{.*/g);\nmsg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":420,"y":1320,"wires":[["d573edcd.cb138"]]},{"id":"d573edcd.cb138","type":"json","z":"bf2927e5.5af798","name":"","property":"payload","action":"","pretty":true,"x":650,"y":1320,"wires":[["b435eec3.0a2e1"]]}]

2 Likes

Here's my circadian lighting routine, and an example motion/auto lighting on/off which takes account of the circadian lighting and various other settings/switches to control lighting nicely.

Main routine to calculate the circadian level and temp. Having coded this in HE RM I can tell you that this is significantly easier here in NR once I figured it out. Basically there are 2 entry points - one that kicks off at sunrise to start adjusting the temp and levels up, and one that kicks off at golden hour (I have no idea when that is, but it sounded cool and works fine after a negative adjustment). The nodes automatically know these times because you put in the lat/long for your location (I'm in Thailand as most of you know already). Now, for the evening calculation, I wanted the routine to start to dim the lights around golden-hour or sunset-ish, and then continue doing this until 11pm at night. So to achieve this the trick was simply to rotate my location back around the globe by (if I recall correctly) 90 degrees in order to move the dimming to be completed at around 11pm instead of sunset. This is easy by just negatively adjusting the latitude. Maybe there's a better way, but this works perfectly :smile:

export

[{"id":"5922aeac.ae77d","type":"tab","label":"Circadian Lighting","disabled":false,"info":""},{"id":"eaf3ab0e.341f98","type":"group","z":"5922aeac.ae77d","name":"Set CIrcadian Level & Temp based on time","style":{"stroke":"#a4a4a4","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["b4d298f.a97b368","803cb2f.f15a95","e5d00af3.2f7198","1a3938ca.1ebd47","6274d1fb.0fe6","3dda5d7f.ac3af2","9529d7f6.349d08","8165af44.0c5dd","45023eb7.f2946","bf55ca34.dd67a8","3e6b4de9.1c9912","38f1a174.65dace","e8f609dc.f0d5f8","3f1e19fe.3a2996","5f91c9f6.b08ec8","76007c2d.a93864","b9722122.0d8e3","cf604400.559ce8","314aeeb.0acd312","6a98a34e.6dc68c","3b36eca6.3a74c4","365edf68.072c3","d2ee3b3a.a3eef8","fe4817df.1011e8"],"x":34,"y":319,"w":1128,"h":449},{"id":"b9a20a5c.d622c8","type":"suncron","z":"5922aeac.ae77d","name":"sunrise","lat":"12.809222","lon":"100.914550","replay":false,"ejectScheduleOnUpdate":false,"sunrisePayload":"sunrise","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":160,"y":200,"wires":[["8fae56de.34be88"]]},{"id":"18a3bbd7.690224","type":"suncron","z":"5922aeac.ae77d","name":"noon","lat":"12.809222","lon":"100.914550","replay":true,"ejectScheduleOnUpdate":false,"sunrisePayload":"","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"noon","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":170,"y":280,"wires":[["39b4d8e6.cffd98"]]},{"id":"97b7b4ea.44f528","type":"suncron","z":"5922aeac.ae77d","name":"sunset","lat":"12.809222","lon":"100.914550","replay":false,"ejectScheduleOnUpdate":false,"sunrisePayload":"","sunrisePayloadType":"str","sunriseTopic":"","sunriseOffsetType":1,"sunriseOffsetHours":0,"sunriseOffsetMinutes":0,"sunriseOffset":0,"sunriseEndPayload":"","sunriseEndPayloadType":"str","sunriseEndTopic":"","sunriseEndOffsetType":1,"sunriseEndOffsetHours":0,"sunriseEndOffsetMinutes":0,"sunriseEndOffset":0,"goldenHourEndPayload":"","goldenHourEndPayloadType":"str","goldenHourEndTopic":"","goldenHourEndOffsetType":1,"goldenHourEndOffsetHours":0,"goldenHourEndOffsetMinutes":0,"goldenHourEndOffset":0,"solarNoonPayload":"","solarNoonPayloadType":"str","solarNoonTopic":"","solarNoonOffsetType":1,"solarNoonOffsetHours":0,"solarNoonOffsetMinutes":0,"solarNoonOffset":0,"goldenHourPayload":"","goldenHourPayloadType":"str","goldenHourTopic":"","goldenHourOffsetType":1,"goldenHourOffsetHours":0,"goldenHourOffsetMinutes":0,"goldenHourOffset":0,"sunsetStartPayload":"","sunsetStartPayloadType":"str","sunsetStartTopic":"","sunsetStartOffsetType":1,"sunsetStartOffsetHours":0,"sunsetStartOffsetMinutes":0,"sunsetStartOffset":0,"sunsetPayload":"sunset","sunsetPayloadType":"str","sunsetTopic":"","sunsetOffsetType":1,"sunsetOffsetHours":0,"sunsetOffsetMinutes":0,"sunsetOffset":0,"duskPayload":"","duskPayloadType":"str","duskTopic":"","duskOffsetType":1,"duskOffsetHours":0,"duskOffsetMinutes":0,"duskOffset":0,"nauticalDuskPayload":"","nauticalDuskPayloadType":"str","nauticalDuskTopic":"","nauticalDuskOffsetType":1,"nauticalDuskOffsetHours":0,"nauticalDuskOffsetMinutes":0,"nauticalDuskOffset":0,"nightPayload":"","nightPayloadType":"str","nightTopic":"","nightOffsetType":1,"nightOffsetHours":0,"nightOffsetMinutes":0,"nightOffset":0,"nadirPayload":"","nadirPayloadType":"str","nadirTopic":"","nadirOffsetType":1,"nadirOffsetHours":0,"nadirOffsetMinutes":0,"nadirOffset":0,"nightEndPayload":"","nightEndPayloadType":"str","nightEndTopic":"","nightEndOffsetType":1,"nightEndOffsetHours":0,"nightEndOffsetMinutes":0,"nightEndOffset":0,"nauticalDawnPayload":"","nauticalDawnPayloadType":"str","nauticalDawnTopic":"","nauticalDawnOffsetType":1,"nauticalDawnOffsetHours":0,"nauticalDawnOffsetMinutes":0,"nauticalDawnOffset":0,"dawnPayload":"","dawnPayloadType":"str","dawnTopic":"","dawnOffsetType":1,"dawnOffsetHours":0,"dawnOffsetMinutes":0,"dawnOffset":0,"x":170,"y":120,"wires":[["3f953327.35fb4c"]]},{"id":"8fae56de.34be88","type":"change","z":"5922aeac.ae77d","name":"Set Circadian Temp/Level","rules":[{"t":"set","p":"circadianTemp","pt":"global","to":"2000","tot":"num"},{"t":"set","p":"circadianLevel","pt":"global","to":"8","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":200,"wires":[[]]},{"id":"b4d298f.a97b368","type":"Circadian Light","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","lat":"12.809222","lon":"100.914550","period":"2","topic":"","name":"","x":120,"y":360,"wires":[["e5d00af3.2f7198"]]},{"id":"803cb2f.f15a95","type":"function","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Calculate Circadian Values","func":"var percentCircadian = msg.payload.percent;\nglobal.set("circadianTemp",500-(3.46percentCircadian));\nglobal.set("circadianLevel",(0.70percentCircadian)+8);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":360,"wires":[["fe4817df.1011e8"]]},{"id":"e5d00af3.2f7198","type":"time-range-switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Morning Circadian Cycle","lat":"12.809222","lon":"100.914550","startTime":"sunrise","endTime":"solarNoon","startOffset":0,"endOffset":0,"x":330,"y":360,"wires":[["803cb2f.f15a95"],[]]},{"id":"1a3938ca.1ebd47","type":"function","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Calculate Circadian Values","func":"var percentCircadian = msg.payload.percent;\nglobal.set("circadianTemp",500-(3.46percentCircadian));\nglobal.set("circadianLevel",(0.70percentCircadian)+8);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":420,"wires":[["fe4817df.1011e8"]]},{"id":"6274d1fb.0fe6","type":"time-range-switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Evening Circadian Cycle","lat":"12.809222","lon":"100.914550","startTime":"goldenHour","endTime":"night","startOffset":0,"endOffset":"180","x":330,"y":436,"wires":[["1a3938ca.1ebd47"],[]]},{"id":"3f953327.35fb4c","type":"change","z":"5922aeac.ae77d","d":true,"name":"Set Circadian Temp/Level","rules":[{"t":"set","p":"circadianTemp","pt":"global","to":"6000","tot":"num"},{"t":"set","p":"circadianLevel","pt":"global","to":"75","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":120,"wires":[[]]},{"id":"39b4d8e6.cffd98","type":"change","z":"5922aeac.ae77d","d":true,"name":"Set Circadian Temp/Level","rules":[{"t":"set","p":"circadianTemp","pt":"global","to":"6000","tot":"num"},{"t":"set","p":"circadianLevel","pt":"global","to":"75","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":280,"wires":[[]]},{"id":"3dda5d7f.ac3af2","type":"switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"on/off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":726,"wires":[["8165af44.0c5dd"],[]]},{"id":"9529d7f6.349d08","type":"hubitat device","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Kitchen Lights","server":"a626e778.3c46e8","deviceId":"1825","attribute":"switch","sendEvent":true,"x":460,"y":726,"wires":[["3dda5d7f.ac3af2"]]},{"id":"8165af44.0c5dd","type":"change","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload,colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":847,"y":727,"wires":[["45023eb7.f2946"]]},{"id":"45023eb7.f2946","type":"hue-group","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Kitchen","bridge":"74cddefe.a3a54","groupid":"8","colornamer":true,"skipevents":false,"x":1027,"y":727,"wires":[[]]},{"id":"bf55ca34.dd67a8","type":"switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"on/off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":546,"wires":[["38f1a174.65dace"],[]]},{"id":"3e6b4de9.1c9912","type":"hubitat device","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Landing Lights","server":"a626e778.3c46e8","deviceId":"1828","attribute":"switch","sendEvent":true,"x":460,"y":546,"wires":[["bf55ca34.dd67a8"]]},{"id":"38f1a174.65dace","type":"change","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload,colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":847,"y":547,"wires":[["e8f609dc.f0d5f8","365edf68.072c3"]]},{"id":"e8f609dc.f0d5f8","type":"hue-group","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Landing","bridge":"74cddefe.a3a54","groupid":"7","colornamer":true,"skipevents":false,"x":1027,"y":547,"wires":[[]]},{"id":"3f1e19fe.3a2996","type":"switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"on/off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":666,"wires":[["76007c2d.a93864"],[]]},{"id":"5f91c9f6.b08ec8","type":"hubitat device","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Living Room Lights","server":"a626e778.3c46e8","deviceId":"1826","attribute":"switch","sendEvent":true,"x":471,"y":667,"wires":[["3f1e19fe.3a2996"]]},{"id":"76007c2d.a93864","type":"change","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload,colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":847,"y":667,"wires":[["b9722122.0d8e3"]]},{"id":"b9722122.0d8e3","type":"hue-group","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Living room","bridge":"74cddefe.a3a54","groupid":"2","colornamer":true,"skipevents":false,"x":1037,"y":667,"wires":[[]]},{"id":"cf604400.559ce8","type":"switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"on/off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":606,"wires":[["6a98a34e.6dc68c"],[]]},{"id":"314aeeb.0acd312","type":"hubitat device","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Master Bedroom Lights","server":"a626e778.3c46e8","deviceId":"1827","attribute":"switch","sendEvent":true,"x":489,"y":606,"wires":[["cf604400.559ce8"]]},{"id":"6a98a34e.6dc68c","type":"change","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload,colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":846,"y":607,"wires":[["3b36eca6.3a74c4"]]},{"id":"3b36eca6.3a74c4","type":"hue-group","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Master Bedroom","bridge":"74cddefe.a3a54","groupid":"1","colornamer":true,"skipevents":false,"x":1046,"y":607,"wires":[[]]},{"id":"365edf68.072c3","type":"hue-group","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"Stairwell","bridge":"74cddefe.a3a54","groupid":"10","colornamer":true,"skipevents":false,"x":1029,"y":491,"wires":[[]]},{"id":"2b9b1c3a.31f404","type":"inject","z":"5922aeac.ae77d","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":170,"y":60,"wires":[["6efce393.512cec"]]},{"id":"d2ee3b3a.a3eef8","type":"Circadian Light","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","lat":"12.809222","lon":"35.914550","period":"2","topic":"","name":"","x":120,"y":436,"wires":[["6274d1fb.0fe6"]]},{"id":"fe4817df.1011e8","type":"switch","z":"5922aeac.ae77d","g":"eaf3ab0e.341f98","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":190,"y":646,"wires":[["3e6b4de9.1c9912","314aeeb.0acd312","5f91c9f6.b08ec8","9529d7f6.349d08"]]},{"id":"6efce393.512cec","type":"change","z":"5922aeac.ae77d","name":"Set Circadian Temp/Level","rules":[{"t":"set","p":"circadianTemp","pt":"global","to":"153","tot":"num"},{"t":"set","p":"circadianLevel","pt":"global","to":"78","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":60,"wires":[[]]},{"id":"a626e778.3c46e8","type":"hubitat config","z":"","name":"myHubitat","usetls":false,"host":"192.168.0.167","port":"80","appId":"2628","nodeRedServer":"http://192.168.0.185:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":true},{"id":"74cddefe.a3a54","type":"hue-bridge","z":"","name":"Ban Amphur Home","bridge":"192.168.0.147","key":"DtEvS2kGBQEoqFOuhWANUh0R2ZpEVmd-Qocp14mi","interval":"1000","disableupdates":false}]

Then here's the motion/auto on/off lighting routine. I've created one of these for each room/area of the house. It will automatically update the room's lighting to the appropriate temp/level based on the global context variables set in the circadian routine above and the time of day. It does this every 2 minutes and the change is imperceptible which is perfect for a smooth lighting change. But also it will respond to switches set in HE to control:

  • circadian lighting - on/off
  • lights auto off - on/off (useful if you dont want the light to automatically time out)
  • lights on in the daytime - on/off (sometimes we want the lights on during the day automatically too - I do also have a lux sensor for this which works through modes)
  • mode (lights automatically come on in Evening/Night)

In this example, I have 2 motion sensors to trigger the lights on/off, and in addition I'm using 3 virtual motion sensors connected to a Samsung Camera for cancelling the lights off (on recognition of motion, person, or face using tinyCAM AI motion/object tracking app)

export

[{"id":"26b8e1d1.fffdfe","type":"tab","label":"Auto Lighting","disabled":false,"info":""},{"id":"2f685de9.9ff732","type":"group","z":"26b8e1d1.fffdfe","name":"Auto Lighting - Master Bedroom","style":{"stroke":"#999999","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["85cff0c1.55c1e","4a5d77c2.aac1b8","3dacbfe5.3f11b","713ac00e.252cf","328182fc.fd34fe","a7bcb3c8.67e52","180b1ada.c0a095","98ffcca7.c5eae","4693478d.891008","51642b1e.c039f4","e028a3ef.df608","81be9462.62c978","7da0cc38.eff5e4","cb673c74.f16ce","5135042d.1c45cc","68022d28.fd07b4","91fe57b4.0f4128","42666aaa.62db84","d193ea54.c30af8","445bb241.48ce0c","bf826a9f.824848","9cd6baba.fe8428","c9eb1442.2b4f68","c2641fc.322cbe","cf591ecd.012a2","3ee00e59.6b4a62","600a3a5c.2bb5d4","c7d9bc76.4bb86","4bdc3801.ad46b8","61ba0c5.dbab7f4"],"x":34,"y":1639,"w":2052,"h":402},{"id":"8f6a0022.0dc0c","type":"group","z":"26b8e1d1.fffdfe","name":"Auto Lighting - Kitchen","style":{"stroke":"#999999","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["418722aa.50bc6c","76d6c89d.605c18","aa5fccaf.bf14f","41bd25d6.e8f9fc","309366e4.82750a","3123c79e.f05688","797958ae.2f36c8","6a8f2585.4e11ec","5fd992ff.6a723c","ef0a9631.a669d8","a819c53a.84afc8","c7318036.156f1","e8f0e15c.2279a","c2ac8589.4be998","78cd4451.e7536c","f2150808.bba258","cfa9b114.148f4","7927c2ae.368abc"],"x":34,"y":79,"w":1632,"h":322},{"id":"a9f8eb5d.d40eb8","type":"group","z":"26b8e1d1.fffdfe","name":"Auto Lighting - Landing & Stairwell","style":{"stroke":"#999999","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["cff30ea9.5fb2f","50397691.1a3228","1aa57c74.f70964","f7fd6c63.a2333","8c54694e.eca328","14d60f6.c762ef1","2080d1f.207c42e","cee8a59b.8caaf8","df7d2027.5c60a","5e31e29.e743b1c","6c255d6e.09f6f4","76412e3f.9871d","aaaf5361.ebaae","af66954a.6bef48","3d1bf81d.435f78","5b0b3a48.50dbe4","43c16a96.d36124","4db43a8a.1a3f84"],"x":34,"y":459,"w":1632,"h":302},{"id":"e0d832d5.9667d","type":"group","z":"26b8e1d1.fffdfe","name":"Auto Lighting - Terrace","style":{"stroke":"#999999","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["24807790.259448","7d18af53.9f74b","ed68388e.a89f28","d83f6ca2.dfafe","9a0e3b5f.18dd98","f06f8364.cd7bc","39d1f0a8.27293","7e314e85.f9daa","c93fe564.db27b8","f0d8655b.646538","19ee008b.38ae7f","dc31c880.38a178","85d5ef90.c9d18","c44bdf70.8dac1"],"x":34,"y":819,"w":1632,"h":322},{"id":"f7d687c1.f15668","type":"group","z":"26b8e1d1.fffdfe","name":"Auto Lighting - Living Room","style":{"stroke":"#999999","fill":"#bfdbef","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["ad58b78.b0a4148","adc864a1.e864b8","85ec4646.5e0818","9411e778.d79168","92c28706.eb9b38","61c6354f.89790c","b63e76c0.db1eb8","f4364047.a899f","19eef6b8.b3d319","4a089150.569a1","5ce76a1e.a56094","2acb6479.1e5d2c","f7c9b703.d33b38","b37c2cdd.49a6","82d2878b.400558","ef0b25a6.d76848","5ee9b5fc.75521c","acf828cf.a4fc28","37a191f3.7e0a3e"],"x":34,"y":1159,"w":1712,"h":422},{"id":"418722aa.50bc6c","type":"switch","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"active/inactive","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":260,"wires":[["aa5fccaf.bf14f","f2150808.bba258"],["76d6c89d.605c18"]]},{"id":"76d6c89d.605c18","type":"stoptimer-varidelay","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","duration":"5","durationType":"num","units":"Minute","payloadtype":"str","payloadval":"","name":"","reporting":"every_second","persist":true,"x":660,"y":300,"wires":[["3123c79e.f05688"],[],[]]},{"id":"aa5fccaf.bf14f","type":"change","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Stop Timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":360,"wires":[["76d6c89d.605c18"]]},{"id":"41bd25d6.e8f9fc","type":"switch","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Evening/Night/Day","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Day","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":870,"y":180,"wires":[["5fd992ff.6a723c"],["5fd992ff.6a723c"],["309366e4.82750a"]]},{"id":"309366e4.82750a","type":"switch","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Daytime Lights","property":"daytimeLights","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1040,"y":240,"wires":[["5fd992ff.6a723c"]]},{"id":"3123c79e.f05688","type":"switch","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Motion Lights Auto Off","property":"lightsMotionOff","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":900,"y":300,"wires":[["c7318036.156f1"]]},{"id":"797958ae.2f36c8","type":"hue-group","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Kitchen","bridge":"74cddefe.a3a54","groupid":"8","colornamer":true,"skipevents":false,"x":1580,"y":160,"wires":[[]]},{"id":"6a8f2585.4e11ec","type":"hue-group","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Kitchen","bridge":"74cddefe.a3a54","groupid":"8","colornamer":true,"skipevents":false,"x":1340,"y":300,"wires":[[]]},{"id":"cff30ea9.5fb2f","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Xiaomi Motion - Landing 2","server":"a626e778.3c46e8","deviceId":"868","attribute":"motion","sendEvent":true,"x":170,"y":660,"wires":[["50397691.1a3228"]]},{"id":"50397691.1a3228","type":"switch","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"active/inactive","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":420,"y":600,"wires":[["8c54694e.eca328","14d60f6.c762ef1"],["f7fd6c63.a2333"]]},{"id":"1aa57c74.f70964","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Xiaomi Motion - Stairs","server":"a626e778.3c46e8","deviceId":"801","attribute":"motion","sendEvent":true,"x":160,"y":540,"wires":[["50397691.1a3228"]]},{"id":"f7fd6c63.a2333","type":"stoptimer-varidelay","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","duration":"5","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","persist":true,"x":660,"y":660,"wires":[["5e31e29.e743b1c"],[],[]]},{"id":"8c54694e.eca328","type":"change","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Stop Timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":720,"wires":[["f7fd6c63.a2333"]]},{"id":"14d60f6.c762ef1","type":"hubitat mode","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Evening/Night","server":"a626e778.3c46e8","sendEvent":false,"x":660,"y":540,"wires":[["2080d1f.207c42e"]]},{"id":"2080d1f.207c42e","type":"switch","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Evening/Night/Day","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Day","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":850,"y":540,"wires":[["5b0b3a48.50dbe4"],["5b0b3a48.50dbe4"],["cee8a59b.8caaf8"]]},{"id":"cee8a59b.8caaf8","type":"switch","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Daytime Lights","property":"daytimeLights","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1020,"y":600,"wires":[["5b0b3a48.50dbe4"]]},{"id":"df7d2027.5c60a","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Xiaomi Motion - Landing 1","server":"a626e778.3c46e8","deviceId":"802","attribute":"motion","sendEvent":true,"x":170,"y":600,"wires":[["50397691.1a3228"]]},{"id":"5e31e29.e743b1c","type":"switch","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Motion Lights Auto Off","property":"lightsMotionOff","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":900,"y":660,"wires":[["4db43a8a.1a3f84"]]},{"id":"6c255d6e.09f6f4","type":"hue-group","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Landing","bridge":"74cddefe.a3a54","groupid":"7","colornamer":true,"skipevents":false,"x":1580,"y":560,"wires":[[]]},{"id":"76412e3f.9871d","type":"change","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":540,"wires":[["6c255d6e.09f6f4","af66954a.6bef48"]]},{"id":"aaaf5361.ebaae","type":"hue-group","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Landing","bridge":"74cddefe.a3a54","groupid":"7","colornamer":true,"skipevents":false,"x":1360,"y":680,"wires":[[]]},{"id":"af66954a.6bef48","type":"hue-group","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Stairwell","bridge":"74cddefe.a3a54","groupid":"10","colornamer":true,"skipevents":false,"x":1580,"y":500,"wires":[[]]},{"id":"3d1bf81d.435f78","type":"hue-group","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"Stairwell","bridge":"74cddefe.a3a54","groupid":"10","colornamer":true,"skipevents":false,"x":1360,"y":620,"wires":[[]]},{"id":"24807790.259448","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Xiaomi Motion - Terrace","server":"a626e778.3c46e8","deviceId":"1672","attribute":"motion","sendEvent":true,"x":170,"y":1000,"wires":[["7d18af53.9f74b"]]},{"id":"7d18af53.9f74b","type":"switch","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"active/inactive","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":1000,"wires":[["d83f6ca2.dfafe","9a0e3b5f.18dd98"],["ed68388e.a89f28"]]},{"id":"ed68388e.a89f28","type":"stoptimer-varidelay","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","duration":"10","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","persist":true,"x":640,"y":1040,"wires":[["7e314e85.f9daa"],[],[]]},{"id":"d83f6ca2.dfafe","type":"change","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Stop Timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":1100,"wires":[["ed68388e.a89f28"]]},{"id":"9a0e3b5f.18dd98","type":"hubitat mode","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Evening/Night","server":"a626e778.3c46e8","sendEvent":false,"x":640,"y":940,"wires":[["f06f8364.cd7bc"]]},{"id":"f06f8364.cd7bc","type":"switch","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Evening/Night/Day","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Day","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":870,"y":920,"wires":[["19ee008b.38ae7f"],["19ee008b.38ae7f"],["39d1f0a8.27293"]]},{"id":"39d1f0a8.27293","type":"switch","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Daytime Lights","property":"daytimeLights","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1060,"y":980,"wires":[["19ee008b.38ae7f"]]},{"id":"7e314e85.f9daa","type":"switch","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Motion Lights Auto Off","property":"lightsMotionOff","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":880,"y":1040,"wires":[["c44bdf70.8dac1"]]},{"id":"c93fe564.db27b8","type":"hue-group","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Terrace","bridge":"74cddefe.a3a54","groupid":"4","colornamer":true,"skipevents":false,"x":1580,"y":900,"wires":[[]]},{"id":"f0d8655b.646538","type":"hue-group","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"Terrace","bridge":"74cddefe.a3a54","groupid":"4","colornamer":true,"skipevents":false,"x":1360,"y":1040,"wires":[[]]},{"id":"43c16a96.d36124","type":"change","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":500,"wires":[["af66954a.6bef48","6c255d6e.09f6f4"]]},{"id":"5b0b3a48.50dbe4","type":"switch","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1150,"y":520,"wires":[["43c16a96.d36124"],["76412e3f.9871d"]]},{"id":"5fd992ff.6a723c","type":"switch","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1170,"y":160,"wires":[["a819c53a.84afc8"],["ef0a9631.a669d8"]]},{"id":"a819c53a.84afc8","type":"change","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":120,"wires":[["797958ae.2f36c8"]]},{"id":"ef0a9631.a669d8","type":"change","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":180,"wires":[["797958ae.2f36c8"]]},{"id":"19ee008b.38ae7f","type":"switch","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1170,"y":900,"wires":[["85d5ef90.c9d18"],["dc31c880.38a178"]]},{"id":"85d5ef90.c9d18","type":"change","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":860,"wires":[["c93fe564.db27b8"]]},{"id":"dc31c880.38a178","type":"change","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":920,"wires":[["c93fe564.db27b8"]]},{"id":"c7318036.156f1","type":"change","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"set off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":300,"wires":[["6a8f2585.4e11ec"]]},{"id":"4db43a8a.1a3f84","type":"change","z":"26b8e1d1.fffdfe","g":"a9f8eb5d.d40eb8","name":"set off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":660,"wires":[["3d1bf81d.435f78","aaaf5361.ebaae"]]},{"id":"c44bdf70.8dac1","type":"change","z":"26b8e1d1.fffdfe","g":"e0d832d5.9667d","name":"set off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1127,"y":1040,"wires":[["f0d8655b.646538"]]},{"id":"e8f0e15c.2279a","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Xiaomi Motion - Kitchen","server":"a626e778.3c46e8","deviceId":"867","attribute":"motion","sendEvent":true,"x":170,"y":300,"wires":[["418722aa.50bc6c"]]},{"id":"c2ac8589.4be998","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Xiaomi Motion - Kitchen table","server":"a626e778.3c46e8","deviceId":"1601","attribute":"motion","sendEvent":true,"x":180,"y":240,"wires":[["418722aa.50bc6c"]]},{"id":"78cd4451.e7536c","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Xiaomi Motion - Front Door (inside)","server":"a626e778.3c46e8","deviceId":"804","attribute":"motion","sendEvent":true,"x":200,"y":180,"wires":[["418722aa.50bc6c"]]},{"id":"f2150808.bba258","type":"hubitat mode","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"Evening/Night","server":"a626e778.3c46e8","sendEvent":false,"x":670,"y":180,"wires":[["41bd25d6.e8f9fc"]]},{"id":"ad58b78.b0a4148","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Xiaomi Motion - Living Room 1","server":"a626e778.3c46e8","deviceId":"865","attribute":"motion","sendEvent":true,"x":190,"y":1240,"wires":[["adc864a1.e864b8"]]},{"id":"adc864a1.e864b8","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"active/inactive","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":460,"y":1260,"wires":[["9411e778.d79168","92c28706.eb9b38"],["85ec4646.5e0818"]]},{"id":"85ec4646.5e0818","type":"stoptimer-varidelay","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","duration":"5","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","persist":true,"x":700,"y":1380,"wires":[["f4364047.a899f"],[],[]]},{"id":"9411e778.d79168","type":"change","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Stop Timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":1420,"wires":[["85ec4646.5e0818"]]},{"id":"92c28706.eb9b38","type":"hubitat mode","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Evening/Night","server":"a626e778.3c46e8","sendEvent":false,"x":700,"y":1280,"wires":[["61c6354f.89790c"]]},{"id":"61c6354f.89790c","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Evening/Night/Day","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Day","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":930,"y":1260,"wires":[["5ce76a1e.a56094"],["5ce76a1e.a56094"],["b63e76c0.db1eb8"]]},{"id":"b63e76c0.db1eb8","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Daytime Lights","property":"daytimeLights","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1120,"y":1320,"wires":[["5ce76a1e.a56094"]]},{"id":"f4364047.a899f","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Motion Lights Auto Off","property":"lightsMotionOff","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":940,"y":1380,"wires":[["b37c2cdd.49a6"]]},{"id":"19eef6b8.b3d319","type":"hue-group","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Living room","bridge":"74cddefe.a3a54","groupid":"2","colornamer":true,"skipevents":false,"x":1650,"y":1240,"wires":[[]]},{"id":"4a089150.569a1","type":"hue-group","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Living room","bridge":"74cddefe.a3a54","groupid":"2","colornamer":true,"skipevents":false,"x":1430,"y":1380,"wires":[[]]},{"id":"5ce76a1e.a56094","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1230,"y":1240,"wires":[["f7c9b703.d33b38"],["2acb6479.1e5d2c"]]},{"id":"2acb6479.1e5d2c","type":"change","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1260,"wires":[["19eef6b8.b3d319"]]},{"id":"f7c9b703.d33b38","type":"change","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":1200,"wires":[["19eef6b8.b3d319"]]},{"id":"b37c2cdd.49a6","type":"change","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"set off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1187,"y":1380,"wires":[["4a089150.569a1"]]},{"id":"ef0b25a6.d76848","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Xiaomi Motion - Living Room 2","server":"a626e778.3c46e8","deviceId":"866","attribute":"motion","sendEvent":true,"x":190,"y":1300,"wires":[["adc864a1.e864b8"]]},{"id":"82d2878b.400558","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Samsung Camera - Motion","server":"a626e778.3c46e8","deviceId":"2307","attribute":"motion","sendEvent":true,"x":180,"y":1420,"wires":[["acf828cf.a4fc28"]]},{"id":"37a191f3.7e0a3e","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Samsung Camera - Person","server":"a626e778.3c46e8","deviceId":"2446","attribute":"motion","sendEvent":true,"x":180,"y":1480,"wires":[["acf828cf.a4fc28"]]},{"id":"5ee9b5fc.75521c","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"Samsung Camera - Face","server":"a626e778.3c46e8","deviceId":"2448","attribute":"motion","sendEvent":true,"x":170,"y":1540,"wires":[["acf828cf.a4fc28"]]},{"id":"acf828cf.a4fc28","type":"switch","z":"26b8e1d1.fffdfe","g":"f7d687c1.f15668","name":"active","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":1500,"wires":[["9411e778.d79168"]]},{"id":"cfa9b114.148f4","type":"inject","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"on","props":[{"p":"payload.on","v":"true","vt":"bool"},{"p":"payload.brightness","v":"circadianLevel","vt":"global"},{"p":"payload.colorTemp","v":"circadianTemp","vt":"global"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1510,"y":280,"wires":[["797958ae.2f36c8"]]},{"id":"85cff0c1.55c1e","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"active/inactive","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":460,"y":1900,"wires":[["3dacbfe5.3f11b","cb673c74.f16ce"],["4a5d77c2.aac1b8"]]},{"id":"4a5d77c2.aac1b8","type":"stoptimer-varidelay","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","duration":"5","durationType":"num","units":"Minute","payloadtype":"str","payloadval":"","name":"","reporting":"every_second","persist":true,"x":680,"y":1940,"wires":[["a7bcb3c8.67e52"],[],[]]},{"id":"3dacbfe5.3f11b","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Stop Timer","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":2000,"wires":[["4a5d77c2.aac1b8"]]},{"id":"713ac00e.252cf","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Evening/Night/Day","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Day","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":890,"y":1820,"wires":[["98ffcca7.c5eae"],["98ffcca7.c5eae"],["328182fc.fd34fe"]]},{"id":"328182fc.fd34fe","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Daytime Lights","property":"daytimeLights","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1060,"y":1880,"wires":[["98ffcca7.c5eae"]]},{"id":"a7bcb3c8.67e52","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Motion Lights Auto Off","property":"lightsMotionOff","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":920,"y":1940,"wires":[["e028a3ef.df608"]]},{"id":"180b1ada.c0a095","type":"hue-group","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Master Bedroom","bridge":"74cddefe.a3a54","groupid":"1","colornamer":true,"skipevents":false,"x":1380,"y":1940,"wires":[[]]},{"id":"98ffcca7.c5eae","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"CIrcadian LIghting on/off","property":"circadianLighting","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":1800,"wires":[["3ee00e59.6b4a62","c2641fc.322cbe"],["5135042d.1c45cc","91fe57b4.0f4128"]]},{"id":"4693478d.891008","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1670,"y":1720,"wires":[["445bb241.48ce0c","bf826a9f.824848"]]},{"id":"51642b1e.c039f4","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":1680,"wires":[["445bb241.48ce0c","bf826a9f.824848"]]},{"id":"e028a3ef.df608","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"set off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.on","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1940,"wires":[["180b1ada.c0a095"]]},{"id":"81be9462.62c978","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Xiaomi Motion - Master Bedroom 2","server":"a626e778.3c46e8","deviceId":"1633","attribute":"motion","sendEvent":true,"x":200,"y":1940,"wires":[["85cff0c1.55c1e"]]},{"id":"7da0cc38.eff5e4","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Xiaomi Motion - Master Bedroom 1","server":"a626e778.3c46e8","deviceId":"803","attribute":"motion","sendEvent":true,"x":200,"y":1860,"wires":[["85cff0c1.55c1e"]]},{"id":"cb673c74.f16ce","type":"hubitat mode","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Evening/Night","server":"a626e778.3c46e8","sendEvent":false,"x":690,"y":1820,"wires":[["713ac00e.252cf","c7d9bc76.4bb86"]]},{"id":"5135042d.1c45cc","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Angus in bed","server":"a626e778.3c46e8","deviceId":"6","attribute":"switch","sendEvent":false,"x":1410,"y":1820,"wires":[["68022d28.fd07b4"]]},{"id":"68022d28.fd07b4","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"off","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1550,"y":1820,"wires":[["61ba0c5.dbab7f4"]]},{"id":"91fe57b4.0f4128","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Rein in bed","server":"a626e778.3c46e8","deviceId":"7","attribute":"switch","sendEvent":false,"x":1410,"y":1720,"wires":[["42666aaa.62db84"]]},{"id":"42666aaa.62db84","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"off","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1550,"y":1720,"wires":[["4693478d.891008"]]},{"id":"d193ea54.c30af8","type":"hue-light","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Master Bedroom Light 4","bridge":"74cddefe.a3a54","lightid":"27","colornamer":true,"skipevents":false,"x":1950,"y":1828,"wires":[[]]},{"id":"445bb241.48ce0c","type":"hue-light","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Master Bedroom Light 1","bridge":"74cddefe.a3a54","lightid":"29","colornamer":true,"skipevents":false,"x":1950,"y":1680,"wires":[[]]},{"id":"bf826a9f.824848","type":"hue-light","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Master Bedroom Light 3","bridge":"74cddefe.a3a54","lightid":"28","colornamer":true,"skipevents":false,"x":1950,"y":1727,"wires":[[]]},{"id":"9cd6baba.fe8428","type":"hue-light","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Master Bedroom Light 2","bridge":"74cddefe.a3a54","lightid":"30","colornamer":true,"skipevents":false,"x":1950,"y":1780,"wires":[[]]},{"id":"c9eb1442.2b4f68","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"off","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1550,"y":1680,"wires":[["51642b1e.c039f4"]]},{"id":"c2641fc.322cbe","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Rein in bed","server":"a626e778.3c46e8","deviceId":"7","attribute":"switch","sendEvent":false,"x":1410,"y":1680,"wires":[["c9eb1442.2b4f68"]]},{"id":"cf591ecd.012a2","type":"switch","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"off","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1550,"y":1780,"wires":[["4bdc3801.ad46b8"]]},{"id":"3ee00e59.6b4a62","type":"hubitat device","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"Angus in bed","server":"a626e778.3c46e8","deviceId":"6","attribute":"switch","sendEvent":false,"x":1410,"y":1780,"wires":[["cf591ecd.012a2"]]},{"id":"600a3a5c.2bb5d4","type":"inject","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"","props":[{"p":"payload.currentValue","v":"active","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":260,"y":1800,"wires":[["85cff0c1.55c1e"]]},{"id":"c7d9bc76.4bb86","type":"debug","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":1760,"wires":[]},{"id":"61ba0c5.dbab7f4","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"set on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1670,"y":1820,"wires":[["9cd6baba.fe8428","d193ea54.c30af8"]]},{"id":"4bdc3801.ad46b8","type":"change","z":"26b8e1d1.fffdfe","g":"2f685de9.9ff732","name":"set level & on","rules":[{"t":"set","p":"payload.on","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.brightness","pt":"msg","to":"circadianLevel","tot":"global"},{"t":"set","p":"payload.colorTemp","pt":"msg","to":"circadianTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":1780,"wires":[["9cd6baba.fe8428","d193ea54.c30af8"]]},{"id":"7927c2ae.368abc","type":"inject","z":"26b8e1d1.fffdfe","g":"8f6a0022.0dc0c","name":"off","props":[{"p":"payload.on","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1500,"y":340,"wires":[["797958ae.2f36c8"]]},{"id":"74cddefe.a3a54","type":"hue-bridge","z":"","name":"Ban Amphur Home","bridge":"192.168.0.147","key":"DtEvS2kGBQEoqFOuhWANUh0R2ZpEVmd-Qocp14mi","interval":"1000","disableupdates":false},{"id":"a626e778.3c46e8","type":"hubitat config","z":"","name":"myHubitat","usetls":false,"host":"192.168.0.167","port":"80","appId":"2628","nodeRedServer":"http://192.168.0.185:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":true}]

FInally, I've found this set-up (image below) helpful to synchronise my lighting switches (this way I can adjust them either in ND or in HE). Not perfectly happy with this yet, I'm sure there must be a better way but anyway it works for me and might be useful as an idea for others.

All of this together has completely transformed the motion lighting at my property from sluggish at best on HE to instant on NR. Instead of going via HE I'm actioning the lighting directly now from NR to Hue and it is instantaneous. I then have the groups in Hue connected to HE so that dashboards there get updated fairly quickly with the polling mechanism and I can still adjust the lighting from an HE dashboard if I want (or indeed from the Hue app). So this is a really flexible set-up.

I use websocket and it's been working very fine (although I do see some errors in NR as posted elsewhere, but the flows continue to work).

4 Likes

this is very cool and honestly something I never thought of thanks for sharing

1 Like

Hi All,

Does anyone have a flow where the status of devices in a room can be reported, and if any devices are on, it can show a indicator of some sort? (Could be number or the turning on of a device etc).

In webCoRE I have a variable set for each room, and should any device in that room be on, the variable is updated. This switches on a Virtual device like "Lounge Status". below I use this on my Dash to show that something in that room is on. I can flick the virtual switch, and turn off all devices in that room. But what I cant figure out is how to have NR know that at least one device in that room is on.

Dash example.

I hope this makes sense (to someone at least :joy:) TIA

Title - Log Internet Performance to Influxdb

Summary - Simple flow inspired by @aaiyar flow Periodic Internet speed test Runs Speed test once and hour and loads results into InfluxDB. I then display this data in Grafana like so
image

Picture -

Flow -

Flow

[
{
"id": "a62ad2e7.fd269",
"type": "group",
"z": "1eaaefad.e170d",
"name": "Log Internet Performace",
"style": {
"fill": "#bfdbef",
"label": true,
"color": "#0070c0"
},
"nodes": [
"a490996e.db3f48",
"8e2464a.269b298",
"20de07a5.c70fe8",
"c5e8e8e6.e3cd88",
"5aa9c929.cf6938",
"6f0d77a5.ca1a98",
"e8ee45b1.728598",
"c5a5a41.688cd58",
"25fbc818.5c1ed8"
],
"x": 114,
"y": 1279,
"w": 982,
"h": 242
},
{
"id": "a490996e.db3f48",
"type": "cronplus",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "15 minutes past the hour",
"outputField": "payload",
"timeZone": "America/New_York",
"persistDynamic": false,
"commandResponseMsgOutput": "output1",
"outputs": 1,
"options": [
{
"name": "15 past every hour",
"topic": "15 past every hour",
"payloadType": "str",
"payload": "start",
"expressionType": "cron",
"expression": "15 * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 270,
"y": 1480,
"wires": [
[
"8e2464a.269b298"
]
]
},
{
"id": "8e2464a.269b298",
"type": "speedtest",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "Speedtest",
"maxTime": "120000",
"x": 520,
"y": 1440,
"wires": [
[
"5aa9c929.cf6938",
"6f0d77a5.ca1a98",
"e8ee45b1.728598"
]
]
},
{
"id": "20de07a5.c70fe8",
"type": "inject",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 330,
"y": 1340,
"wires": [
[
"8e2464a.269b298"
]
]
},
{
"id": "c5e8e8e6.e3cd88",
"type": "influxdb out",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"influxdb": "4bcce287.69402c",
"name": "Influxdb Upload",
"measurement": "Upload",
"precision": "",
"retentionPolicy": "",
"x": 970,
"y": 1320,
"wires": []
},
{
"id": "5aa9c929.cf6938",
"type": "change",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "Upload",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.speeds.upload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 760,
"y": 1320,
"wires": [
[
"c5e8e8e6.e3cd88"
]
]
},
{
"id": "6f0d77a5.ca1a98",
"type": "change",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "Download",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.speeds.download",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 760,
"y": 1380,
"wires": [
[
"c5a5a41.688cd58"
]
]
},
{
"id": "e8ee45b1.728598",
"type": "change",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"name": "Ping",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.server.ping",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 1440,
"wires": [
[
"25fbc818.5c1ed8"
]
]
},
{
"id": "c5a5a41.688cd58",
"type": "influxdb out",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"influxdb": "4bcce287.69402c",
"name": "Influxdb Download",
"measurement": "Download",
"precision": "",
"retentionPolicy": "",
"x": 980,
"y": 1380,
"wires": []
},
{
"id": "25fbc818.5c1ed8",
"type": "influxdb out",
"z": "1eaaefad.e170d",
"g": "a62ad2e7.fd269",
"influxdb": "4bcce287.69402c",
"name": "Influxdb Ping",
"measurement": "Ping",
"precision": "",
"retentionPolicy": "",
"x": 960,
"y": 1440,
"wires": []
},
{
"id": "4bcce287.69402c",
"type": "influxdb",
"z": "",
"hostname": "192.168.1.183",
"port": "8086",
"protocol": "http",
"database": "hubitat",
"name": "",
"usetls": false,
"tls": ""
}
]

6 Likes

I don't have a flow, but ganging all of the switches into an ultimate Boolean and using the or output should work. I can build something up later.

2 Likes

Yeah I tried this way, not much success. It could be due to the devices coming from different systems, and maybe I messed the payloads up, but could have sworn I got them right though.

This one was easy, as the group is in deCONZ, my issue starts when some come from deCONZ and some from Hue.

Something like this, you can keep adding and increasing the number of inputs in the Boolean:

Flow
[{"id":"b613616f.b4ed1","type":"hubitat device","z":"52fd730a.4bc1bc","name":"Great Room: Light","server":"f17566a9.c052b8","deviceId":"15","attribute":"switch","sendEvent":true,"x":440,"y":760,"wires":[["b18ab94d.18e598"]]},{"id":"426f8dde.d920f4","type":"hubitat device","z":"52fd730a.4bc1bc","name":"Great Room: Fan","server":"f17566a9.c052b8","deviceId":"16","attribute":"switch","sendEvent":true,"x":440,"y":820,"wires":[["b18ab94d.18e598"]]},{"id":"b18ab94d.18e598","type":"change","z":"52fd730a.4bc1bc","name":"Switch to Bool","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.value = \"on\" ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":800,"wires":[["2e4675da.428dea"]]},{"id":"2e4675da.428dea","type":"BooleanLogicUltimate","z":"52fd730a.4bc1bc","name":"","filtertrue":"both","persist":true,"sInitializeWith":"false","triggertopic":"trigger","outputtriggeredby":"all","inputCount":"2","topic":"Ocupancy","x":900,"y":800,"wires":[[],["98c38683.65c4b8"],[]]},{"id":"98c38683.65c4b8","type":"hubitat command","z":"52fd730a.4bc1bc","name":"Fake switch for migrating apps","server":"f17566a9.c052b8","deviceId":"2106","command":"on","commandArgs":"","x":1220,"y":800,"wires":[[]]},{"id":"f17566a9.c052b8","type":"hubitat config","z":"","name":"","usetls":false,"host":"192.168.2.3","port":"80","appId":"3424","nodeRedServer":"http://192.168.2.9:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]
3 Likes

Cheers for this, but getting an error on import.
image

1 Like

@napalmcsr fyi one work around we found to this problem was to post the code in a code block

1 Like

For people posting flows - use the Preformatted Text (</>) option to avoid formatting errors.

2 Likes

fixed in original post with preformatted text as recommended.

2 Likes

Thank you for letting us know. I will update post 1 (and any of mine) to include this as well!

Thanks again for this, for HE devices this works :wink: I think my issue is, I then have deCONZ devices and Hue. But I'll look at modifying the payload sections. Is there anyway to add to them to keep it in one node, do you think?

Hue is using true and false already as is deCONZ, it appears only to be HE which is passing a payload.value of on/off etc.

Cheers
Roy