I have created a flow to automaticly turn on my light from sunset till 22:00.
Now i want that if i turn on the light with my wall switch that it only turns off when i use the switch.
Is there a way to let node red detect if i use that switch?
I already set a switch node that can detect when it went on automaticly and a inject node to simulate my wall switch, but have no idea where to find the wall switch.
My flow looks like…
[{"id":"1fafb6bc.021b59","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"d747de0d.ce3bf","type":"api-call-service","z":"1fafb6bc.021b59","name":"turn light on","server":"108395f9.caaaca","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.fibaro_system_fgd212_dimmer_2_level_2","data":"{\"entity_id\":\"light.fibaro_system_fgd212_dimmer_2_level_2\",\"brightness_pct\":20}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1550,"y":320,"wires":[[]]},{"id":"189f2ebd.fe5b61","type":"api-call-service","z":"1fafb6bc.021b59","name":"turn light off","server":"108395f9.caaaca","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.fibaro_system_fgd212_dimmer_2_level_2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1550,"y":540,"wires":[[]]},{"id":"4c5a9313.0942ec","type":"switch","z":"1fafb6bc.021b59","name":"home or away","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":480,"y":380,"wires":[["5711d7dd.331b98"],["70a1c564.bc2e24"]]},{"id":"5711d7dd.331b98","type":"time-range-switch","z":"1fafb6bc.021b59","name":"sunset - 22:00","lat":"53.024","lon":"7.2","startTime":"sunset","endTime":"22:00","startOffset":0,"endOffset":0,"x":640,"y":220,"wires":[["978c9e63.aa4a"],[]]},{"id":"978c9e63.aa4a","type":"api-current-state","z":"1fafb6bc.021b59","name":"light already on?","server":"108395f9.caaaca","version":1,"outputs":2,"halt_if":"true","halt_if_type":"msg","halt_if_compare":"is","override_topic":false,"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":960,"y":220,"wires":[[],["b67b692.7fadf18"]]},{"id":"70a1c564.bc2e24","type":"api-current-state","z":"1fafb6bc.021b59","name":"still someone home?","server":"108395f9.caaaca","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.aanwezigheid","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":660,"y":540,"wires":[["8a0ae1f.9fc6b2","d986974f.a56598"],[]]},{"id":"8a0ae1f.9fc6b2","type":"api-current-state","z":"1fafb6bc.021b59","name":"light already out?","server":"108395f9.caaaca","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1130,"y":540,"wires":[[],["e7929c28.487e3"]]},{"id":"3dfb09f.86a1d76","type":"poll-state","z":"1fafb6bc.021b59","name":"Someone home?","server":"108395f9.caaaca","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"group.aanwezigheid","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":200,"y":380,"wires":[["4c5a9313.0942ec"]]},{"id":"b67b692.7fadf18","type":"trigger","z":"1fafb6bc.021b59","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"reset","bytopic":"all","name":"sent true and wait for reset","x":1240,"y":320,"wires":[["d747de0d.ce3bf","408da81b.b62db"]]},{"id":"d986974f.a56598","type":"change","z":"1fafb6bc.021b59","name":"reset when nobody home","rules":[{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":420,"wires":[["b67b692.7fadf18"]]},{"id":"1591a141.bb41f7","type":"inject","z":"1fafb6bc.021b59","name":"reset at 03:00","topic":"","payload":"reset","payloadType":"str","repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":0.1,"x":940,"y":320,"wires":[["b67b692.7fadf18"]]},{"id":"b3dda352.3a0b68","type":"inject","z":"1fafb6bc.021b59","name":"light off at 22:00","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"00 22 * * *","once":false,"onceDelay":0.1,"x":670,"y":700,"wires":[["8a0ae1f.9fc6b2"]]},{"id":"408da81b.b62db","type":"change","z":"1fafb6bc.021b59","name":"auto or manual?","rules":[{"t":"set","p":"auto","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":160,"wires":[[]]},{"id":"e7929c28.487e3","type":"switch","z":"1fafb6bc.021b59","name":"true or false?","property":"auto","propertyType":"flow","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1350,"y":540,"wires":[["189f2ebd.fe5b61"],[]]},{"id":"b518b47a.33fcf8","type":"inject","z":"1fafb6bc.021b59","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1270,"y":140,"wires":[["408da81b.b62db"]]},{"id":"108395f9.caaaca","type":"server","z":"","name":"Home Assistant","addon":true}]
Dfp