Node-RED nodes for hubitat

You mean like this thread? :grinning:

1 Like

Exactly, actually. After 5-10 people all post flows there, you still won't be able to find anything.

Better to just have people ask for specific help if they need it.

But I'm not the gatekeeper of new threads. No one needs MY permission. :slight_smile:

1 Like

I think @aaron and @danfox52 have a good point as does @JasonJoel. At 2700 posts, this thread is unwieldy for someone to go through and find examples.

Simplest solution is for anyone who needs a flow to describe what they want to do and others can chip in.

Yeah kinda like the thread I tried to start earlier... not specifically for flows though.

1 Like

Hey -

This post is prompted by someone asking me how I did gradual level changes for lights. So far, I've been using the easing node that @JasonJoel pointed out to me in this thread.

Today, I found a new node that's been added more recently to NR - the dynamic dimming node;

node-red-contrib-dynamic-dimmer (node) - Node-RED

The biggest advantage of this node over the easing node is that it supports RESET and PAUSE commands, sent as JSON. So, it makes it possible to pause and resume dimming, or incorporate dimming as part of a motion lighting routine.

Super easy to use. It only only increasing the level (from my quick test) so you'll to pair the output with a range node to decrease the level.

1 Like

12 posts were split to a new topic: NodeRed Sub-category

Neat!

1 Like

And this weekend's rabbit hole is Node Red UI... Still love the stability and expandability this has added.

2 Likes

The dashboard is pretty good. My graphs now survive a NodeRed reboot/restart.

Edit: Guess when the fire went out (it's in the TV room, red in the graph).

7 Likes

Nice work on the dashboard!

I'll post mine. Note, im no expert, but with the great help of everyone in this thread, i have this flow which so far is working well for me

[{"id":"20728976.2fb466","type":"tab","label":"Main","disabled":false,"info":""},{"id":"26d21393.9ccbbc","type":"switch","z":"20728976.2fb466","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":360,"y":260,"wires":[["2be60868.8db6d8"],["cbc258ee.37f138"]]},{"id":"28a89a9b.39e9a6","type":"change","z":"20728976.2fb466","name":"Stop when active","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":180,"wires":[["786c65e8.956c0c","ea9e0581.7c23d8"]]},{"id":"858167fd.d57ba8","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":260,"wires":[["ea9e0581.7c23d8"]]},{"id":"d9696335.94e8f","type":"switch","z":"20728976.2fb466","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":340,"y":600,"wires":[["9ed9e6db.8eb478"],["797e7392.4c3f9c"]]},{"id":"9fe36ae7.803ac8","type":"change","z":"20728976.2fb466","name":"Stop when active","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":580,"wires":[["25e9e461.8b39ec","10b7710e.5d536f"]]},{"id":"2acfd99e.3916e6","type":"switch","z":"20728976.2fb466","name":"<150","property":"payload.value","propertyType":"msg","rules":[{"t":"lte","v":"150","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":970,"y":520,"wires":[["9fe36ae7.803ac8"]]},{"id":"cef6cad3.9b9ed8","type":"switch","z":"20728976.2fb466","name":"<15","property":"payload.value","propertyType":"msg","rules":[{"t":"lte","v":"15","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":140,"wires":[["28a89a9b.39e9a6"]]},{"id":"b9c43333.13c48","type":"switch","z":"20728976.2fb466","name":">60/<40","property":"payload.value","propertyType":"msg","rules":[{"t":"gte","v":"60","vt":"str"},{"t":"lte","v":"40","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":1040,"wires":[["3eddcd03.8c1442"],["e8ca5cf6.b0ccc"]]},{"id":"5939f110.26451","type":"switch","z":"20728976.2fb466","name":"open/closed","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"closed","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":990,"y":820,"wires":[["8c6e375d.677898"],["a668770c.f1c1a8"]]},{"id":"25e9e461.8b39ec","type":"change","z":"20728976.2fb466","name":"CT6500k, 100%","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":true, \"brightness\":100, \"colorTemp\":153}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":520,"wires":[["d78c7332.5f301"]]},{"id":"d2516ee7.d8b23","type":"change","z":"20728976.2fb466","name":"CT-6500k, 25%","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":true, \"brightness\":15, \"colorTemp\":153}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1480,"y":860,"wires":[["d7bb4810.9c1278"]]},{"id":"d78c7332.5f301","type":"hue-light","z":"20728976.2fb466","name":"Ensuite Light","bridge":"7dcda340.c6ab4c","lightid":"4","colornamer":true,"skipevents":false,"x":1350,"y":520,"wires":[[]],"info":"test"},{"id":"d7bb4810.9c1278","type":"hue-light","z":"20728976.2fb466","name":"Ensuite Light","bridge":"7dcda340.c6ab4c","lightid":"4","colornamer":true,"skipevents":false,"x":1650,"y":860,"wires":[[]],"info":"test"},{"id":"786c65e8.956c0c","type":"hubitat command","z":"20728976.2fb466","name":"MasterBed Switch ON","server":"26c9a23e.36f4ce","deviceId":"393","command":"on","commandArgs":"","x":1480,"y":180,"wires":[[]]},{"id":"d9e0980a.c3ad58","type":"hubitat command","z":"20728976.2fb466","name":"MasterBed Switch OFF","server":"26c9a23e.36f4ce","deviceId":"393","command":"off","commandArgs":"","x":1470,"y":120,"wires":[[]]},{"id":"67cfb696.9f0e58","type":"hubitat command","z":"20728976.2fb466","name":"Ensuite Exhaust Fan ON","server":"26c9a23e.36f4ce","deviceId":"484","command":"on","commandArgs":"","x":870,"y":1020,"wires":[[]]},{"id":"e8ca5cf6.b0ccc","type":"hubitat command","z":"20728976.2fb466","name":"Ensuite Exhaust Fan Switch (S2) OFF","server":"26c9a23e.36f4ce","deviceId":"484","command":"off","commandArgs":"","x":590,"y":1080,"wires":[[]]},{"id":"ef0e34d1.d88768","type":"hubitat device","z":"20728976.2fb466","name":"MasterBed Switch","server":"26c9a23e.36f4ce","deviceId":"393","attribute":"switch","sendEvent":false,"x":890,"y":260,"wires":[["858167fd.d57ba8"]]},{"id":"dd320a77.bc1048","type":"hubitat device","z":"20728976.2fb466","d":true,"name":"Ensuite MS (aeotec)","server":"26c9a23e.36f4ce","deviceId":"353","attribute":"motion","sendEvent":true,"x":180,"y":540,"wires":[["f7d2449c.c9eaf8"]]},{"id":"dbc4f832.3e62d8","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite Humidity Sensor","server":"26c9a23e.36f4ce","deviceId":"353","attribute":"humidity","sendEvent":true,"x":130,"y":1040,"wires":[[]]},{"id":"c1343585.aa36d8","type":"change","z":"20728976.2fb466","name":"Turn Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":740,"wires":[["ea49704a.21663"]]},{"id":"ea49704a.21663","type":"hue-light","z":"20728976.2fb466","name":"","bridge":"7dcda340.c6ab4c","lightid":"4","colornamer":true,"skipevents":false,"x":1680,"y":740,"wires":[[]]},{"id":"e521bd4d.4f816","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":80,"wires":[["d9e0980a.c3ad58"]]},{"id":"28482d90.56b802","type":"hubitat device","z":"20728976.2fb466","name":"MasterBed Switch","server":"26c9a23e.36f4ce","deviceId":"393","attribute":"switch","sendEvent":false,"x":890,"y":80,"wires":[["e521bd4d.4f816"]]},{"id":"8c6e375d.677898","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":1150,"y":800,"wires":[["1f45a598.de089a"]]},{"id":"a668770c.f1c1a8","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":1150,"y":860,"wires":[["8095726f.31e49"]]},{"id":"9ed9e6db.8eb478","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":510,"y":540,"wires":[["2f4512ab.9ec0ae"]]},{"id":"797e7392.4c3f9c","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":510,"y":620,"wires":[["f3d1b195.5a978"]]},{"id":"3f0f714e.666cfe","type":"switch","z":"20728976.2fb466","name":"Mode=Home","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":200,"wires":[["74cd80d.0a4af8","c5f203eb.b1a5"]]},{"id":"2be60868.8db6d8","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":550,"y":200,"wires":[["3f0f714e.666cfe"]]},{"id":"9725d708.0222c8","type":"switch","z":"20728976.2fb466","name":"Mode=Home","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":260,"wires":[["ef0e34d1.d88768"]]},{"id":"cbc258ee.37f138","type":"hubitat mode","z":"20728976.2fb466","name":"Mode","server":"26c9a23e.36f4ce","sendEvent":false,"x":550,"y":260,"wires":[["9725d708.0222c8"]]},{"id":"60b18d3c.7b2c34","type":"switch","z":"20728976.2fb466","name":">100","property":"payload.value","propertyType":"msg","rules":[{"t":"gte","v":"150","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":80,"wires":[["28482d90.56b802"]]},{"id":"3c418436.df0eac","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite MS (hue)","server":"26c9a23e.36f4ce","deviceId":"673","attribute":"motion","sendEvent":true,"x":130,"y":600,"wires":[["d9696335.94e8f"]]},{"id":"506d4ba5.fd1be4","type":"hubitat device","z":"20728976.2fb466","name":"HUE MS LUX","server":"26c9a23e.36f4ce","deviceId":"673","attribute":"illuminance","sendEvent":false,"x":820,"y":520,"wires":[["2acfd99e.3916e6"]]},{"id":"2dea5e7c.ca36a2","type":"hubitat device","z":"20728976.2fb466","name":"HUE MS LUX","server":"26c9a23e.36f4ce","deviceId":"673","attribute":"illuminance","sendEvent":true,"x":910,"y":740,"wires":[["bd63adcb.24c0b"]]},{"id":"bd63adcb.24c0b","type":"switch","z":"20728976.2fb466","name":">200","property":"payload.value","propertyType":"msg","rules":[{"t":"gte","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":740,"wires":[["59d619e3.57cd78"]]},{"id":"59d619e3.57cd78","type":"hue-light","z":"20728976.2fb466","name":"Ensuite Light","bridge":"7dcda340.c6ab4c","lightid":"4","colornamer":true,"skipevents":false,"x":1190,"y":740,"wires":[["2d8c5f93.45a78"]],"info":"test"},{"id":"2d8c5f93.45a78","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1330,"y":740,"wires":[["c1343585.aa36d8"]]},{"id":"22a2e5e8.6e8b9a","type":"switch","z":"20728976.2fb466","name":"open/closed","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"closed","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":950,"y":620,"wires":[["c5d50385.e8ff8"],[]]},{"id":"8095726f.31e49","type":"switch","z":"20728976.2fb466","name":"Mode=Asleep","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Asleep","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1300,"y":860,"wires":[["d2516ee7.d8b23"]]},{"id":"1f45a598.de089a","type":"switch","z":"20728976.2fb466","name":"Mode=Asleep","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Asleep","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1300,"y":800,"wires":[["c1343585.aa36d8"]]},{"id":"f3d1b195.5a978","type":"switch","z":"20728976.2fb466","name":"H/Q","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Home","vt":"str"},{"t":"eq","v":"Quiet","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":620,"wires":[["3fd24923.a7ac16"],["3fd24923.a7ac16"]]},{"id":"2f4512ab.9ec0ae","type":"switch","z":"20728976.2fb466","name":"H/Q","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Home","vt":"str"},{"t":"eq","v":"Quiet","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":540,"wires":[["506d4ba5.fd1be4"],["9fe36ae7.803ac8"]]},{"id":"3fd24923.a7ac16","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite CSD","server":"26c9a23e.36f4ce","deviceId":"677","attribute":"contact","sendEvent":false,"x":790,"y":620,"wires":[["22a2e5e8.6e8b9a"]]},{"id":"501be004.6116a","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite CSD","server":"26c9a23e.36f4ce","deviceId":"677","attribute":"contact","sendEvent":true,"x":830,"y":820,"wires":[["5939f110.26451"]]},{"id":"530a70ce.23d6c","type":"hubitat device","z":"20728976.2fb466","name":"MB MS Hue","server":"26c9a23e.36f4ce","deviceId":"674","attribute":"motion","sendEvent":true,"x":170,"y":260,"wires":[["26d21393.9ccbbc"]]},{"id":"c5d50385.e8ff8","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite Exhaust Fan ","server":"26c9a23e.36f4ce","deviceId":"484","attribute":"switch","sendEvent":false,"x":1160,"y":620,"wires":[["c3f938d0.1f3898"]]},{"id":"c3f938d0.1f3898","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1330,"y":620,"wires":[[],["10b7710e.5d536f"]]},{"id":"9ba46c5.0f8809","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite Exhaust Fan ","server":"26c9a23e.36f4ce","deviceId":"484","attribute":"switch","sendEvent":true,"x":700,"y":680,"wires":[["40ed7ebb.9f87d"]]},{"id":"40ed7ebb.9f87d","type":"switch","z":"20728976.2fb466","name":"is off?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":870,"y":680,"wires":[["e3d0da15.4f42e8"]]},{"id":"a9a459c2.3ce5a8","type":"switch","z":"20728976.2fb466","name":"Inactive","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1260,"y":680,"wires":[[]]},{"id":"e3d0da15.4f42e8","type":"hubitat device","z":"20728976.2fb466","name":"Ensuite MS (hue)","server":"26c9a23e.36f4ce","deviceId":"673","attribute":"motion","sendEvent":false,"x":1070,"y":680,"wires":[["a9a459c2.3ce5a8"]]},{"id":"a4768948.eaabc8","type":"hubitat device","z":"20728976.2fb466","name":"MB Motion","server":"26c9a23e.36f4ce","deviceId":"257","attribute":"motion","sendEvent":true,"x":210,"y":200,"wires":[["665eca14.013b34"]]},{"id":"665eca14.013b34","type":"switch","z":"20728976.2fb466","name":"Active","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":200,"wires":[["2be60868.8db6d8"]]},{"id":"3eddcd03.8c1442","type":"hue-light","z":"20728976.2fb466","name":"Ensuite Light","bridge":"7dcda340.c6ab4c","lightid":"4","colornamer":true,"skipevents":false,"x":510,"y":1020,"wires":[["4acc52f1.9eba8c"]],"info":"test"},{"id":"4acc52f1.9eba8c","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":670,"y":1020,"wires":[["67cfb696.9f0e58"]]},{"id":"f7d2449c.c9eaf8","type":"switch","z":"20728976.2fb466","name":"Active","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":540,"wires":[["9ed9e6db.8eb478"]]},{"id":"f626ea27.56aca8","type":"hubitat device","z":"20728976.2fb466","name":"MB Lux","server":"26c9a23e.36f4ce","deviceId":"257","attribute":"illuminance","sendEvent":true,"x":600,"y":80,"wires":[["60b18d3c.7b2c34"]]},{"id":"74cd80d.0a4af8","type":"hubitat device","z":"20728976.2fb466","name":"MB Lux","server":"26c9a23e.36f4ce","deviceId":"257","attribute":"illuminance","sendEvent":false,"x":900,"y":140,"wires":[["cef6cad3.9b9ed8"]]},{"id":"10b7710e.5d536f","type":"stoptimer-varidelay","z":"20728976.2fb466","duration":"45","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","x":1510,"y":580,"wires":[["c1343585.aa36d8"],[],[]]},{"id":"ea9e0581.7c23d8","type":"stoptimer-varidelay","z":"20728976.2fb466","duration":"60","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","reporting":"every_second","x":1350,"y":260,"wires":[["d9e0980a.c3ad58"],[],[]]},{"id":"b98d4e40.5f6a2","type":"switch","z":"20728976.2fb466","name":"is on?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":200,"wires":[["28a89a9b.39e9a6"]]},{"id":"c5f203eb.b1a5","type":"hubitat device","z":"20728976.2fb466","name":"MasterBed Switch","server":"26c9a23e.36f4ce","deviceId":"393","attribute":"switch","sendEvent":false,"x":890,"y":200,"wires":[["b98d4e40.5f6a2"]]},{"id":"7dcda340.c6ab4c","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.205","key":"eJKwVfdJ1cgCdCvTV0blnPBKeFuk6Jv4qa1r0lF7","interval":"3000","disableupdates":false},{"id":"26c9a23e.36f4ce","type":"hubitat config","z":"","name":"Hubitat","usetls":false,"host":"192.168.1.202","port":"80","appId":"545","nodeRedServer":"http://192.168.1.18:1880","webhookPath":"/hubitat/webhook","autoRefresh":true}]
1 Like

Yeah. I reckon this is rather advanced. It does lighting based on home alarm, lux, mode, garage door (open/shut), tv (on/off), motion etc. It's based on the state machine node in the middle, which works very well.

The orange nodes are Hue scenes. My Hue lights are no longer in HE.
The "refresh light" is a command that turns off the lights in the TV room if it's bright outside and a certain brightness inside (that means my TV room lights could turn off). I found they were staying on all day. The link out on the right hand side is linked to the link in on the left hand side.

Code

[{"id":"34f57d5.da43382","type":"function","z":"1adc6153.89ed1f","name":"TV Lux?","func":"var lux = flow.get(\"tv_lux\");\nif (lux < 10 ) {\n msg.topic1 = 'tvlux';\n msg.payload1 = true;\n msg.payload2 = false;\n node.status({text:\"Dark in TV\"});\n} else if (lux >= 10) {\n msg.topic1 = 'tvlux';\n msg.payload1 = false;\n msg.payload2 = true;\n node.status({text:\"Bright in TV\"});\n}\nvar msg1 = {topic:msg.topic1, payload:msg.payload1 };\nvar msg2 = {topic:msg.topic1, payload:msg.payload2 };\nreturn [ msg1, msg2 ];\n","outputs":2,"noerr":0,"x":195,"y":540,"wires":[["b606c3fd.fd7d4"],["64942ab8.996ca4"]],"outputLabels":["dark","bright"],"l":false},{"id":"fb6f30c9.b15dc","type":"link in","z":"1adc6153.89ed1f","name":"","links":["f99f441e.190ff8"],"x":115,"y":540,"wires":[["34f57d5.da43382"]]},{"id":"b258e370.0167c","type":"link in","z":"1adc6153.89ed1f","name":"","links":["8aa95bfd.7badf8","a6305ba2.fe51b8","f622702f.0db95","82c23706.956028"],"x":1495,"y":820,"wires":[["e04f2f55.6b8d8"]]},{"id":"2fd73e99.2391c2","type":"comment","z":"1adc6153.89ed1f","name":"Motion dependant ","info":"","x":2030,"y":360,"wires":[]},{"id":"ff426402.b1ed88","type":"stoptimer","z":"1adc6153.89ed1f","duration":"20","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":1880,"y":500,"wires":[["d4aad94d.bb22d8"],[]]},{"id":"bd4bb994.bb2b18","type":"hubitat device","z":"1adc6153.89ed1f","name":"MS - TV","server":"c40cd0a6.2f4d4","deviceId":"21","attribute":"motion","sendEvent":true,"x":1220,"y":400,"wires":[["9c4d5467.b27b08"]]},{"id":"35288004.ba639","type":"hubitat device","z":"1adc6153.89ed1f","name":"MDChild - TV","server":"c98bf7d5.9c2218","deviceId":"17","attribute":"motion","sendEvent":true,"x":1230,"y":340,"wires":[["9c4d5467.b27b08"]]},{"id":"9c4d5467.b27b08","type":"link out","z":"1adc6153.89ed1f","name":"","links":["ad11ab4.d7a0e58","6a5bddfa.2554e4","3648e8ae.4df688","48d99620.deadc8","74061f38.2cd63","1be4204f.5b8a3","9e4176b6.9ba018"],"x":1375,"y":360,"wires":[]},{"id":"3ffdf4dc.147dcc","type":"time-range-switch","z":"1adc6153.89ed1f","name":"Lower Lights","lat":"","lon":"","startTime":"21:30","endTime":"01:00","startOffset":0,"endOffset":0,"x":1834.9999980926514,"y":436.99998569488525,"wires":[["6e67f030.58bd6"],["8619de79.28732"]]},{"id":"6e67f030.58bd6","type":"time-range-switch","z":"1adc6153.89ed1f","name":"Lower Lights","lat":"","lon":"","startTime":"21:30","endTime":"22:30","startOffset":0,"endOffset":0,"x":1990,"y":420,"wires":[["ac2d928d.d0801"],["233a57d7.503b58"]]},{"id":"9b2a9e41.87df8","type":"link in","z":"1adc6153.89ed1f","name":"","links":["b2cfe71c.5ee518"],"x":2139.9999980926514,"y":536.9999856948853,"wires":[["6bcf9b6f.905864"]]},{"id":"11c4f648.4b9d4a","type":"comment","z":"1adc6153.89ed1f","name":"Not motion dependant","info":"","x":1640,"y":564,"wires":[]},{"id":"72eadf2c.89bda","type":"comment","z":"1adc6153.89ed1f","name":"Motion dependant","info":"","x":1630,"y":360,"wires":[]},{"id":"508bda0d.dcd224","type":"link in","z":"1adc6153.89ed1f","name":"","links":["77652a37.be5b14"],"x":115,"y":480,"wires":[["88995e31.20d67"]]},{"id":"88995e31.20d67","type":"function","z":"1adc6153.89ed1f","name":"Outside Lux?","func":"if (global.get(\"lux_out\") ===\"dark\") {\n msg.topic1 = 'outlux';\n msg.payload1 = true;\n msg.payload2 = false;\n node.status({text:\"Dark Outside\"});\n} else if (global.get(\"lux_out\") ===\"bright\") {\n msg.topic1 = 'outlux';\n msg.payload1 = false;\n msg.payload2 = true;\n node.status({text:\"Bright Outside\"});\n}\nvar msg1 = {topic:msg.topic1, payload:msg.payload1 };\nvar msg2 = {topic:msg.topic1, payload:msg.payload2 };\nreturn [ msg1, msg2 ];","outputs":2,"noerr":0,"x":195,"y":480,"wires":[["b606c3fd.fd7d4"],["64942ab8.996ca4"]],"outputLabels":["Dark","Bright"],"l":false},{"id":"b606c3fd.fd7d4","type":"BooleanLogicUltimate","z":"1adc6153.89ed1f","name":"Dark (TV OR Out OR Lights)","filtertrue":"onlytrue","persist":true,"sInitializeWith":"false","triggertopic":"trigger","outputtriggeredby":"all","inputCount":"3","topic":"dark","x":550,"y":480,"wires":[[],["bebe7627.eb5bc8"],[]]},{"id":"a0b2d3f1.fd40f","type":"hue-scene","z":"1adc6153.89ed1f","name":"Garage Open (Bright)","bridge":"5f7ec117.46945","sceneid":"K74npA8S3i1U6qe","groupid":"","skipevents":false,"x":1700,"y":680,"wires":[[]]},{"id":"47342663.bab308","type":"hue-scene","z":"1adc6153.89ed1f","name":"All off","bridge":"5f7ec117.46945","sceneid":"ChFQkJ19SpBbhbB","groupid":"","skipevents":false,"x":1650,"y":804,"wires":[["e0272eec.ca65"]]},{"id":"e0272eec.ca65","type":"delay","z":"1adc6153.89ed1f","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1735,"y":800,"wires":[["f9eadb3f.99e668"]],"l":false},{"id":"86042e43.5395a","type":"hue-light","z":"1adc6153.89ed1f","name":"TV (Portable)","bridge":"5f7ec117.46945","lightid":"4","colornamer":true,"skipevents":false,"x":1855,"y":800,"wires":[[]],"l":false},{"id":"f9eadb3f.99e668","type":"change","z":"1adc6153.89ed1f","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":false}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1795,"y":800,"wires":[["86042e43.5395a"]],"l":false},{"id":"a8ca247e.a38938","type":"hue-scene","z":"1adc6153.89ed1f","name":"TV on","bridge":"5f7ec117.46945","sceneid":"9tNuUFKcUsvCyJ3","groupid":"","skipevents":false,"x":1650,"y":760,"wires":[[]]},{"id":"b2c3afc7.54212","type":"hue-scene","z":"1adc6153.89ed1f","name":"Garage Open, TV on","bridge":"5f7ec117.46945","sceneid":"Dj-JeOPAacAZIUE","groupid":"","skipevents":false,"x":1700,"y":720,"wires":[[]]},{"id":"ae7cbbae.78de68","type":"hue-scene","z":"1adc6153.89ed1f","name":"No motion (70%)","bridge":"5f7ec117.46945","sceneid":"yYIc0Y8c8uGW5oR","groupid":"","skipevents":false,"x":1690,"y":600,"wires":[[]]},{"id":"4b260b47.2a29b4","type":"hue-scene","z":"1adc6153.89ed1f","name":"Garage Open, dark","bridge":"5f7ec117.46945","sceneid":"HLCoEaXqg8RvkI4","groupid":"","skipevents":false,"x":1690,"y":640,"wires":[[]]},{"id":"4248421d.bb29ac","type":"hue-scene","z":"1adc6153.89ed1f","name":"40% motion","bridge":"5f7ec117.46945","sceneid":"PhRhDUe5UVfgzUy","groupid":"","skipevents":false,"x":2254.9999980926514,"y":456.99998569488525,"wires":[[]]},{"id":"9ebb35da.883638","type":"hue-scene","z":"1adc6153.89ed1f","name":"70% motion","bridge":"5f7ec117.46945","sceneid":"34lvo-nJKCKjZU5","groupid":"","skipevents":false,"x":2254.9999980926514,"y":416.99998569488525,"wires":[[]]},{"id":"6bcf9b6f.905864","type":"hue-scene","z":"1adc6153.89ed1f","name":"100% motion","bridge":"5f7ec117.46945","sceneid":"XuGFdpTiobcCng5","groupid":"","skipevents":false,"x":2254.9999980926514,"y":496.99998569488525,"wires":[[]]},{"id":"d4aad94d.bb22d8","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":600,"wires":[["ae7cbbae.78de68"]],"l":false},{"id":"9e403d12.7a58b","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":760,"wires":[["a8ca247e.a38938"]],"l":false},{"id":"e04f2f55.6b8d8","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":800,"wires":[["47342663.bab308"]],"l":false},{"id":"3fc17484.5cf27c","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":680,"wires":[["a0b2d3f1.fd40f"]],"l":false},{"id":"8ebdaaa2.d87fc8","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":720,"wires":[["b2c3afc7.54212"]],"l":false},{"id":"642e1bab.410c04","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1555,"y":640,"wires":[["4b260b47.2a29b4"]],"l":false},{"id":"ac2d928d.d0801","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":2139.9999980926514,"y":416.99998569488525,"wires":[["9ebb35da.883638"]],"l":false},{"id":"233a57d7.503b58","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":2139.9999980926514,"y":456.99998569488525,"wires":[["4248421d.bb29ac"]],"l":false},{"id":"8619de79.28732","type":"switch","z":"1adc6153.89ed1f","name":"Disable?","property":"master_tv_lights","propertyType":"flow","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":2139.9999980926514,"y":496.99998569488525,"wires":[["6bcf9b6f.905864"]],"l":false},{"id":"ba30bc17.37b79","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1735,"y":504,"wires":[["ff426402.b1ed88"]],"l":false},{"id":"aa781c13.db657","type":"state-machine","z":"1adc6153.89ed1f","name":"State Machine","triggerProperty":"payload","triggerPropertyType":"msg","stateProperty":"payload","statePropertyType":"msg","outputStateChangeOnly":true,"throwException":false,"states":["garage_shut_bright","garage_open_bright","garage_open_dark","garage_open_tv","garage_shut_dark","TV_on","all_off"],"transitions":[{"name":"mode_off","from":"*","to":"all_off"},{"name":"alarm_off_dark","from":"all_off","to":"garage_shut_dark"},{"name":"alarm_off_bright","from":"all_off","to":"garage_shut_bright"},{"name":"dark","from":"garage_open_bright","to":"garage_open_dark"},{"name":"dark","from":"garage_shut_bright","to":"garage_shut_dark"},{"name":"bright","from":"garage_shut_dark","to":"garage_shut_bright"},{"name":"bright","from":"garage_open_dark","to":"garage_open_bright"},{"name":"on","from":"garage_open_bright","to":"garage_open_tv"},{"name":"on","from":"garage_open_dark","to":"garage_open_tv"},{"name":"on","from":"garage_shut_bright","to":"TV_on"},{"name":"on","from":"garage_shut_dark","to":"TV_on"},{"name":"garage_open","from":"garage_shut_bright","to":"garage_open_bright"},{"name":"garage_open","from":"garage_shut_dark","to":"garage_open_dark"},{"name":"garage_open","from":"TV_on","to":"garage_open_tv"},{"name":"garage_closed","from":"garage_open_dark","to":"garage_shut_dark"},{"name":"garage_closed","from":"garage_open_bright","to":"garage_shut_bright"},{"name":"garage_closed","from":"garage_open_tv","to":"TV_on"},{"name":"off","from":"TV_on","to":"garage_shut_dark"},{"name":"off","from":"garage_open_tv","to":"garage_open_dark"},{"name":"mode_awaken_dark","from":"all_off","to":"garage_shut_dark"},{"name":"mode_awaken_bright","from":"all_off","to":"garage_shut_bright"}],"x":940,"y":540,"wires":[["6c3f219e.e7686","bba66bf1.4d7a08"]]},{"id":"3949fcc0.4f1b74","type":"hubitat mode","z":"1adc6153.89ed1f","name":"Mode","server":"c40cd0a6.2f4d4","sendEvent":true,"x":230,"y":420,"wires":[["726a6f81.c5e6e"]]},{"id":"726a6f81.c5e6e","type":"switch","z":"1adc6153.89ed1f","name":"Mode","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"Day","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"eq","v":"Away","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":350,"y":420,"wires":[["173e06e2.9325f9"],["9c200dae.6b562"],["9c200dae.6b562"]]},{"id":"9c200dae.6b562","type":"change","z":"1adc6153.89ed1f","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"mode_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":420,"wires":[["aa781c13.db657"]]},{"id":"bebe7627.eb5bc8","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":775,"y":540,"wires":[["aa781c13.db657"]],"l":false},{"id":"df02b96d.12b4e8","type":"hubitat device","z":"1adc6153.89ed1f","name":"TV - Downstairs TV","server":"c98bf7d5.9c2218","deviceId":"96","attribute":"switch","sendEvent":true,"x":310,"y":840,"wires":[["eb2b1641.8992e8"]]},{"id":"eb2b1641.8992e8","type":"change","z":"1adc6153.89ed1f","name":"Switch","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":840,"wires":[["aa781c13.db657"]]},{"id":"2fec50e7.7f6c8","type":"hubitat device","z":"1adc6153.89ed1f","name":"CS - Garage Door","server":"c40cd0a6.2f4d4","deviceId":"1027","attribute":"contact","sendEvent":true,"x":310,"y":900,"wires":[["2b471099.05b46"]]},{"id":"a4c67695.6fd9c8","type":"q-gate","z":"1adc6153.89ed1f","name":"","controlTopic":"control","defaultState":"open","openCmd":"gate_open","closeCmd":"gate_closed","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":true,"x":1554.9999980926514,"y":456.99998569488525,"wires":[["282a776c.5888b8"]]},{"id":"9e4176b6.9ba018","type":"link in","z":"1adc6153.89ed1f","name":"","links":["9c4d5467.b27b08"],"x":1455,"y":400,"wires":[["a4c67695.6fd9c8"]]},{"id":"346a05f9.12718a","type":"link in","z":"1adc6153.89ed1f","name":"","links":["b2cfe71c.5ee518"],"x":1655,"y":484,"wires":[["ba30bc17.37b79"]],"info":"Stops lights from turning off, when Button 4 is pressed to turn them on for 90 mins"},{"id":"2b471099.05b46","type":"switch","z":"1adc6153.89ed1f","name":"Garage?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"open","vt":"str"},{"t":"eq","v":"closed","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":480,"y":900,"wires":[["220803c4.4bc3bc"],["c4a3de94.1f927"]]},{"id":"220803c4.4bc3bc","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"garage_open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":595,"y":860,"wires":[["aa781c13.db657"]],"l":false},{"id":"c4a3de94.1f927","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"garage_closed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":595,"y":900,"wires":[["aa781c13.db657"]],"l":false},{"id":"282a776c.5888b8","type":"switch","z":"1adc6153.89ed1f","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":1690,"y":440,"wires":[["3ffdf4dc.147dcc"],["ff426402.b1ed88"]]},{"id":"8ad20707.437738","type":"change","z":"1adc6153.89ed1f","name":"Closed","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"gate_closed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":484,"wires":[["a4c67695.6fd9c8"]]},{"id":"208ed942.621456","type":"change","z":"1adc6153.89ed1f","name":"Open","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"gate_open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":444,"wires":[["a4c67695.6fd9c8"]]},{"id":"64942ab8.996ca4","type":"BooleanLogicUltimate","z":"1adc6153.89ed1f","name":"Bright (Out AND TV AND Lights)","filtertrue":"onlytrue","persist":true,"sInitializeWith":"WaitForPayload","triggertopic":"trigger","outputtriggeredby":"all","inputCount":"3","topic":"bright","x":570,"y":560,"wires":[["bebe7627.eb5bc8"],[],[]]},{"id":"2ea6ca25.b73656","type":"inject","z":"1adc6153.89ed1f","name":"Brightness","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":75,"y":500,"wires":[["88995e31.20d67","34f57d5.da43382"]],"l":false},{"id":"5d469f7f.59bdc","type":"hubitat device","z":"1adc6153.89ed1f","name":"House Alarm","server":"c98bf7d5.9c2218","deviceId":"15","attribute":"alarm","sendEvent":true,"x":290,"y":960,"wires":[["c651dc04.99cf6"]]},{"id":"c651dc04.99cf6","type":"switch","z":"1adc6153.89ed1f","name":"Alarm","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":960,"wires":[["a2867c5c.ad18e"]]},{"id":"699497e5.9d9da8","type":"change","z":"1adc6153.89ed1f","name":"Alarm","rules":[{"t":"set","p":"payload","pt":"msg","to":"alarm_off_dark","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":920,"wires":[["aa781c13.db657"]],"l":false},{"id":"1c0d1049.6f1a2","type":"inject","z":"1adc6153.89ed1f","name":"TV","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":115,"y":840,"wires":[["df02b96d.12b4e8"]],"l":false},{"id":"6c3f219e.e7686","type":"switch","z":"1adc6153.89ed1f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"garage_shut_dark","vt":"str"},{"t":"eq","v":"garage_open_dark","vt":"str"},{"t":"eq","v":"garage_shut_bright","vt":"str"},{"t":"eq","v":"garage_open_bright","vt":"str"},{"t":"eq","v":"garage_open_tv","vt":"str"},{"t":"eq","v":"TV_on","vt":"str"},{"t":"eq","v":"all_off","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":1110,"y":540,"wires":[["208ed942.621456","2f5ad518.1b045a"],["642e1bab.410c04","ba30bc17.37b79","8ad20707.437738"],["e04f2f55.6b8d8","ba30bc17.37b79","8ad20707.437738"],["ba30bc17.37b79","8ad20707.437738","3fc17484.5cf27c"],["ba30bc17.37b79","8ad20707.437738","8ebdaaa2.d87fc8"],["8ad20707.437738","ba30bc17.37b79","9e403d12.7a58b"],["8ad20707.437738","ba30bc17.37b79","e04f2f55.6b8d8"]]},{"id":"8d47af49.aeb7e","type":"inject","z":"1adc6153.89ed1f","name":"Garage","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":115,"y":900,"wires":[["2fec50e7.7f6c8"]],"l":false},{"id":"726f38c0.8e3f98","type":"link in","z":"1adc6153.89ed1f","name":"","links":["2f5ad518.1b045a"],"x":1735,"y":400,"wires":[["3ffdf4dc.147dcc"]]},{"id":"2f5ad518.1b045a","type":"link out","z":"1adc6153.89ed1f","name":"MD Lights","links":["726f38c0.8e3f98","45a1ca94.5dfc94"],"x":1235,"y":460,"wires":[]},{"id":"a2867c5c.ad18e","type":"switch","z":"1adc6153.89ed1f","name":"Dark","property":"tv_lux","propertyType":"flow","rules":[{"t":"lt","v":"10","vt":"num"},{"t":"gte","v":"10","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":960,"wires":[["699497e5.9d9da8"],["23031114.d47d0e"]]},{"id":"23031114.d47d0e","type":"change","z":"1adc6153.89ed1f","name":"Alarm","rules":[{"t":"set","p":"payload","pt":"msg","to":"alarm_off_bright","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":960,"wires":[["aa781c13.db657"]],"l":false},{"id":"644b9b07.7a31e4","type":"change","z":"1adc6153.89ed1f","name":"Alarm","rules":[{"t":"set","p":"payload","pt":"msg","to":"mode_awaken_dark","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":595,"y":360,"wires":[["aa781c13.db657"]],"l":false},{"id":"fd62a197.26959","type":"change","z":"1adc6153.89ed1f","name":"Alarm","rules":[{"t":"set","p":"payload","pt":"msg","to":"mode_awaken_bright","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":595,"y":400,"wires":[["aa781c13.db657"]],"l":false},{"id":"3731d9f1.31e956","type":"function","z":"1adc6153.89ed1f","name":"","func":"switch (msg.payload.on) {\n case true:\n var newmsg1 = {topic: \"hue_light\", payload: true}\n var newmsg3 = {topic: \"hue_light\", payload: false}\n return [newmsg1, newmsg3]\n case false:\n var newmsg2 = {topic: \"hue_light\", payload: false}\n var newmsg4 = {topic: \"hue_light\", payload: true}\n return [newmsg2, newmsg4]\n}","outputs":2,"noerr":0,"x":155,"y":680,"wires":[["725ac418.63c01c"],["cce66fa5.ec32d"]],"l":false},{"id":"507d6819.474eb8","type":"inject","z":"1adc6153.89ed1f","name":"Alarm","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":115,"y":960,"wires":[["5d469f7f.59bdc"]],"l":false},{"id":"173e06e2.9325f9","type":"switch","z":"1adc6153.89ed1f","name":"Dark","property":"tv_lux","propertyType":"flow","rules":[{"t":"lt","v":"10","vt":"num"},{"t":"gte","v":"10","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":380,"wires":[["644b9b07.7a31e4"],["fd62a197.26959"]]},{"id":"79b460e4.cbd07","type":"hue-light","z":"1adc6153.89ed1f","name":"Light - TV couches (Hue)","bridge":"5f7ec117.46945","lightid":"6","colornamer":true,"skipevents":false,"x":95,"y":680,"wires":[["3731d9f1.31e956"]],"l":false},{"id":"725ac418.63c01c","type":"switch","z":"1adc6153.89ed1f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":215,"y":660,"wires":[["1746f1f.34e1f0e"],["b606c3fd.fd7d4"]],"l":false},{"id":"cce66fa5.ec32d","type":"switch","z":"1adc6153.89ed1f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":215,"y":700,"wires":[["64942ab8.996ca4"],["969a256a.c79468"]],"l":false},{"id":"1746f1f.34e1f0e","type":"switch","z":"1adc6153.89ed1f","name":"","property":"tv_lux","propertyType":"flow","rules":[{"t":"gt","v":"20","vt":"num"},{"t":"lte","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":255,"y":620,"wires":[["d3d65679.fdc488"],["b606c3fd.fd7d4"]],"l":false},{"id":"d3d65679.fdc488","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":295,"y":580,"wires":[["b606c3fd.fd7d4"]],"l":false},{"id":"969a256a.c79468","type":"switch","z":"1adc6153.89ed1f","name":"","property":"tv_lux","propertyType":"flow","rules":[{"t":"lte","v":"20","vt":"num"},{"t":"gt","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":255,"y":740,"wires":[["64942ab8.996ca4"],["70536c25.774504"]],"l":false},{"id":"70536c25.774504","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":295,"y":780,"wires":[["64942ab8.996ca4"]],"l":false},{"id":"c82e651a.73cde8","type":"link in","z":"1adc6153.89ed1f","name":"","links":["bba66bf1.4d7a08"],"x":2115,"y":680,"wires":[["69c752fb.3e23dc"]]},{"id":"a9513221.2e25a","type":"comment","z":"1adc6153.89ed1f","name":"Refresh Light","info":"","x":2230,"y":620,"wires":[]},{"id":"43dc7dc.f219c84","type":"and-gate","z":"1adc6153.89ed1f","name":"Bright out AND TV, lights on. ","rules":[{"t":"eq","v":"garage_shut_dark","vt":"str","propertyType":"msg","property":"payload","topic":"bright"},{"t":"eq","v":"bright","vt":"str","propertyType":"global","property":"lux_out"},{"t":"gt","v":"20","vt":"num","propertyType":"flow","property":"tv_lux"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":2460,"y":700,"wires":[["3fa0fc8.9a11104"]]},{"id":"4fb81eda.cc0e5","type":"inject","z":"1adc6153.89ed1f","name":"","topic":"","payload":"lux_out","payloadType":"global","repeat":"","crontab":"*/5 7-18 * * *","once":true,"onceDelay":"17","x":2180,"y":720,"wires":[["43dc7dc.f219c84"]]},{"id":"fcaffc69.ea4a","type":"inject","z":"1adc6153.89ed1f","name":"","topic":"","payload":"tv_lux","payloadType":"flow","repeat":"","crontab":"*/5 7-18 * * *","once":true,"onceDelay":"18","x":2170,"y":760,"wires":[["43dc7dc.f219c84"]]},{"id":"69c752fb.3e23dc","type":"change","z":"1adc6153.89ed1f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"bright","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2175,"y":680,"wires":[["43dc7dc.f219c84"]],"l":false},{"id":"17449b5d.665aa5","type":"link out","z":"1adc6153.89ed1f","name":"","links":["ca0af9d5.6ba2d8","e046f6d5.5dff58"],"x":2715,"y":700,"wires":[]},{"id":"ca0af9d5.6ba2d8","type":"link in","z":"1adc6153.89ed1f","name":"","links":["17449b5d.665aa5"],"x":35,"y":680,"wires":[["79b460e4.cbd07"]]},{"id":"3fa0fc8.9a11104","type":"change","z":"1adc6153.89ed1f","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":false}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"globe","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2655,"y":700,"wires":[["17449b5d.665aa5"]],"l":false},{"id":"2deb9122.10f00e","type":"inject","z":"1adc6153.89ed1f","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":80,"y":420,"wires":[["3949fcc0.4f1b74"]]},{"id":"bba66bf1.4d7a08","type":"link out","z":"1adc6153.89ed1f","name":"","links":["c82e651a.73cde8"],"x":1035,"y":580,"wires":[]},{"id":"c40cd0a6.2f4d4","type":"hubitat config","z":"","name":"Hubitat Coordinator","usetls":false,"host":"192.168.1.100","port":"80","appId":"1731","nodeRedServer":"http://192.168.1.90:1880","webhookPath":"/hubitat/webhook","autoRefresh":true},{"id":"c98bf7d5.9c2218","type":"hubitat config","z":"","name":"Hubitat Client","usetls":false,"host":"192.168.1.217","port":"80","appId":"808","nodeRedServer":"http://192.168.1.90:1880","webhookPath":"/hubitatclient/webhook","autoRefresh":true},{"id":"5f7ec117.46945","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.1.221","key":"removed","interval":"3000","disableupdates":false}]

Edit: my rationale for having a state machine is so that only certain things get past that gate. Also, I want the logic to be ready to turn the lights on asap, not have to go through all the stages after motion is detected (is it dark enough, is the TV on, is the garage open, is the whatever). All that needs to happen before motion is detected, so the gate is open, and it's fast.

4 Likes

That's very nice and ultra compact. What's the load time like compared to the native HE dash?

Super fast.....the Odroid which I'm using doesnt break a sweat. I have it running all day on my computer, and often on my phone. The node red dash is more stable than the HE dashboards, but that's because there are more people working on it. Though, the HE dash looks like it's coming along in leaps and bounds recently. Months ago, I didnt like the reports of HE dash slowing down the HE hub.

The one thing I've found that will slow down node-red dashboards is trends with many data points.

My tabs with 7 day trends {1 min data x 1440 min/day x 7 day) is pretty slow to load. And that's with node-red running on an Intel i5.

Everything else is fast though.

1 Like

Anyone know how to change the formatting of the date in the dashboard. Here is the flow/node. It currently displays as US time 6/7/2020. Whereas we here in Australia do things logically....it should be 7/6/2020. :grinning:

[{"id":"a677b1c6.5aa88","type":"ui_template","z":"d05dc217.e017e","group":"de18fc2c.2df86","name":"Clock Toolbar","order":2,"width":"0","height":"0","format":"<script id=\"titleScript\" type=\"text/javascript\">\n\n$(function() {\n    if($('.md-toolbar-tools').length != 0){\n        loadClock();\n    }else setTimeout(loadClock, 500)\n});\n\nfunction loadClock(){\n    $('#clock').remove();\n    var toolbar = $('.md-toolbar-tools');\n    \n    var div = $('<div/>');\n    var p = $('<p/ id=\"clock\">');\n    \n    div.append(p);\n    div[0].style.margin = '5px 5px 5px auto';\n    toolbar.append(div);\n\n    function displayTitle(lh) {\n        p.text(lh); \n    }\n    \n    function upTime() {\n        var d = new Date();\n        p.text(d.toLocaleString());\n    }\n\n    if(document.clockInterval){ \n            clearInterval(document.clockInterval);\n            document.clockInterval = null;\n    }\n        \n    document.clockInterval = setInterval(upTime,1000);\n}\n\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"global","x":1320,"y":60,"wires":[[]]},{"id":"de18fc2c.2df86","type":"ui_group","z":"","name":"hidden_group","tab":"4cab48a7.c15518","order":1,"disp":false,"width":"6","collapse":false},{"id":"4cab48a7.c15518","type":"ui_tab","z":"","name":"Zooland Sys","icon":"home","order":1,"disabled":false,"hidden":false}]

This flow places the date and clock in the top right of your dashboard.

Good morning everyone!

First off, I'm a complete noob at NR, but as necessity dictates I pick up more and do what I can. So be gentle. =)

I'm utilizing the Pushover node in hopes of moving all of my notifications over to NR. Unfortunately the formatting of the pushes I'm receiving are semi, to no help at all due to the amount of garbage in them, see below.

{"name":"switch","value":"on","displayName":"x","deviceId":"953","descriptionText":"x","unit":null,"type":null,"data":null,"currentValue":"on","dataType":"ENUM","values":["on","off"]}

How do I format that or pass prepopulated text through? For example, I wanted to include a link to my cloud dashboard or just say something simple like "Office door is open."

I appreciate any help you guys can provide.

Not sure I 100% understand, but the pushover node is pretty configurable. So just set the input values to what to what you want with a change node or function node?

For instance I normally do strings for the message body in a change node:

Here's another example where I use a change node to make an emergency priority message, and use the device name in the message body via an expression:

If you want to see all of the input options, the online node help is below (always the first place to look to see what can be done):

You understood it more than you realize, the change node was what I was missing. Thank you sir!

1 Like

Do you mind sharing the entire "Water detected..." expression you have in that change node example?