Well you have a couple of instances here
-
Door opened - light turned on - presumably to last colour set ? or is it to a default colour ? If it is to a default colour then you do not need to do anything extra (presumably) as your Turn on Light node will set that then - if it is to a different colour then i would set another Flow Variable - that stored the value of the colour - not sure how you are setting this is is HVS, RGB or just by name ? But whatever it is then store that at the time you set it and put in the flow context
-
Door left open to long - colour changes - presumably to a new fixed colour ? Nothing special to do here - you already have the trigger node that times out so you just set the new value in that object that switches the light
-
If the door closes then you need to negate the trigger node so you will need a link into the trigger from the close switch - like this
[{"id":"91ee800c.97882","type":"inject","z":"56d3c1c6.0d901","name":"Door Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Open","payloadType":"str","x":210,"y":140,"wires":[["f2e11a79.f8f9c8"]]},{"id":"9523cd6b.1bd71","type":"inject","z":"56d3c1c6.0d901","name":"Door Closed","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Closed","payloadType":"str","x":220,"y":280,"wires":[["f2e11a79.f8f9c8"]]},{"id":"f2e11a79.f8f9c8","type":"switch","z":"56d3c1c6.0d901","name":"Monitor Door State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"},{"t":"eq","v":"Closed","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":420,"y":220,"wires":[["c4cc5acf.ad66d8"],["8a95533a.011cd"]]},{"id":"c4cc5acf.ad66d8","type":"change","z":"56d3c1c6.0d901","name":"Set COntext for Door to Open","rules":[{"t":"set","p":"DoorState","pt":"flow","to":"Open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":200,"wires":[["e4efbbfa.3a0358"]]},{"id":"8a95533a.011cd","type":"change","z":"56d3c1c6.0d901","name":"Set Context to Door Closed","rules":[{"t":"set","p":"DoorState","pt":"flow","to":"Closed","tot":"str"},{"t":"set","p":"reset","pt":"msg","to":"Yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":260,"wires":[["ae9d0d4a.80ab8","e4efbbfa.3a0358"]]},{"id":"e4efbbfa.3a0358","type":"trigger","z":"56d3c1c6.0d901","name":"Pause on Door Open","op1":"Open","op2":"StillOpen","op1type":"str","op2type":"str","duration":"1","extend":true,"overrideDelay":false,"units":"s","reset":"Open","bytopic":"all","topic":"topic","outputs":2,"x":1020,"y":160,"wires":[["251d4d76.9e62a2"],["80347b0e.3b4868"]]},{"id":"41fafddd.381444","type":"comment","z":"56d3c1c6.0d901","name":"Door Open","info":"Send to the Ligth Node to switch on","x":1220,"y":100,"wires":[]},{"id":"251d4d76.9e62a2","type":"debug","z":"56d3c1c6.0d901","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1230,"y":140,"wires":[]},{"id":"ff601f50.cfafa","type":"comment","z":"56d3c1c6.0d901","name":"Door Left Open","info":"Change the color of the light as door open too long","x":1240,"y":260,"wires":[]},{"id":"80347b0e.3b4868","type":"debug","z":"56d3c1c6.0d901","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1230,"y":300,"wires":[]},{"id":"4f75983f.a459c8","type":"comment","z":"56d3c1c6.0d901","name":"Door Closed - Switch off light","info":"Turn the light off","x":1060,"y":360,"wires":[]},{"id":"ae9d0d4a.80ab8","type":"debug","z":"56d3c1c6.0d901","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":400,"wires":[]}]
Craig