Hi
I’ve just started using node-red and I have a very basic flow with my motion sensor and light.
Between sunset and sunrise, if motion is detected in the toilet on the sensor, the toilet light goes on. After 5 minutes it goes off, unless it detects another motion in that time and resets the timer. (The 5 minutes determined by my partner and is non-negotiable).
As 5 minutes is a long time, we will manually switch off the light using our wall mounted tablet dashboard. In doing so, this then stops the motion being picked up again if you were to walk in, say 30 seconds after.
How can I add a node in to the flow so if the light is manually turned off via the wall tablet, it is open to detect movement again at any opportunity?
[{"id":"b9531343880e604b","type":"server-state-changed","z":"0f294f53a3b13b68","g":"88c6a46ec3ce8ade","name":"motion","server":"ad57766.0cc8988","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.toilet_movement_sensor_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":270,"y":460,"wires":[["aa3b4bf1b1c2da38"]]},{"id":"a9bc0b890a8dcc16","type":"api-call-service","z":"0f294f53a3b13b68","g":"88c6a46ec3ce8ade","name":"Toilet Light","server":"ad57766.0cc8988","version":5,"debugenabled":false,"domain":"light","service":"turn_{{payload}}","areaId":[],"deviceId":[],"entityId":["light.toilet"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":930,"y":460,"wires":[[]]},{"id":"b59223b488dabf96","type":"trigger","z":"0f294f53a3b13b68","g":"88c6a46ec3ce8ade","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":750,"y":460,"wires":[["a9bc0b890a8dcc16"]]},{"id":"aa3b4bf1b1c2da38","type":"time-range-switch","z":"0f294f53a3b13b68","g":"88c6a46ec3ce8ade","name":"lux","lat":"50","lon":"-0.18","startTime":"sunset","endTime":"sunrise","startOffset":"-60","endOffset":"+60","x":510,"y":460,"wires":[["b59223b488dabf96"],[]]},{"id":"ad57766.0cc8988","type":"server","name":"Home Assistant","addon":true}]