Turn Light Off

Hi Team.

I have a Node Red automation and just looking for some help or ideas. The Good-Bye-Good-Night is a boolean is on when we are in bed or away from home and its off when home.

So if motion is detected and we are home and the time is between 7AM and 7PM turn the light on Full otherwise turn on dimmed. Thats all good and working.

What i am trying to do is if motion is detected and we are not at home and the time is between 00:00 and 23:59 to turn the lights off after 15 seconds. Basically my cats trip the motion sensor and i want the light to stay on only briefly. I dont want to just have the light off in case a human trips the motion. Basically to save electricity and money as there is no need for the light to be on for 5 minutes when the cat trips it which is what it is when normally detected

You don’t need the time-switch node as you’re checking for the whole day. Removing it does the same thing.

image

[{"id":"212c260712e1d388","type":"inject","z":"855ee4f6e2e5c130","name":"motion","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":306,"y":512,"wires":[["2ced432d673f973d"]]},{"id":"2ced432d673f973d","type":"trigger","z":"855ee4f6e2e5c130","name":"","op1":"{\"service\": \"turn_on\"}","op2":"{\"service\": \"turn_off\"}","op1type":"str","op2type":"json","duration":"15","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":470,"y":512,"wires":[["72ff12e269c0635d"]]},{"id":"72ff12e269c0635d","type":"api-call-service","z":"855ee4f6e2e5c130","name":"","server":"","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.light1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":512,"wires":[[]]}]

Thanks mate. But if i am home i need the motion to trigger and light stay on for say 5 mins.

It only needs to trigger and light stay on for 15 seconds if we are not home or in bed.

Thanks mate. I will give this ago tonight or when the Mrs leaves later.

Hi. Just getting back to this node. If i stick a debug in the Good-Bye-Good-Night i can see that it turns TRUE just before the trigger 10s.

However it is not turning the light on at all and thus off again.

Any suggestions?

Ignore me. I was using the wrong input boolean. All good and working.