How to optimize a circuit with motion sensor and light timer

I have a circuit to switch 3 light groups with a motion detector. Each lighting group has a timer to switch off again after a defined time. The special thing is, that the timer only switches off the lighting group, that was switched off before the movement. This means that the lighting group that is switched to permanent light, remains unaffected by the motion detector and timer. That works well in itself.
However, I use 3 different timers for this circuit. One for each lighting group.
After a movement it is checked (Check Light A-C) whether the light is switched on. If the light is switched off, the timer is started and the light is switched on.
If it is determined after a movement that the light is switched on, no timer is started and the continuous light remains switched on of course.

Now I would like to operate the circuit with 1 timer, which serves all 3 light groups. But with the same premise, that only the lighting groups, that are not switched to permanent light, are switched off.

Does anyone have any idea how a circuit with only one timer could look like?

[{"id":"6ebe367c03015fde","type":"stoptimer","z":"0a899830909fc2d0","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":560,"y":280,"wires":[["e486c0a67d8a174c"],[]]},{"id":"faa8dedb213b3b1a","type":"api-current-state","z":"0a899830909fc2d0","name":"Check Light A","server":"1a9b3950.6d0f47","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.licht_eingang_eingang","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":280,"wires":[[],["96a3c844b09db3b3","6ebe367c03015fde"]]},{"id":"017b49421fd3957c","type":"api-current-state","z":"0a899830909fc2d0","name":"Check Light B","server":"1a9b3950.6d0f47","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.licht_unterschlag_eingangsseite_unterschlag_nord","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":380,"wires":[[],["b986a78a432e2ef0","a46fc9a77b588d4c"]]},{"id":"044a1727f923901f","type":"api-current-state","z":"0a899830909fc2d0","name":"Check Light C","server":"1a9b3950.6d0f47","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.licht_unterschlag_west_unterschlag_west","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":480,"wires":[[],["75c38e98dfce732a","f1bef4548d6c5096"]]},{"id":"96a3c844b09db3b3","type":"debug","z":"0a899830909fc2d0","name":"Light A ON","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":550,"y":320,"wires":[]},{"id":"aa3ecc6bfa857db5","type":"inject","z":"0a899830909fc2d0","name":"Motion","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":110,"y":380,"wires":[["faa8dedb213b3b1a","017b49421fd3957c","044a1727f923901f"]]},{"id":"e486c0a67d8a174c","type":"debug","z":"0a899830909fc2d0","name":"Light A OFF","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":750,"y":280,"wires":[]},{"id":"b986a78a432e2ef0","type":"debug","z":"0a899830909fc2d0","name":"Light B ON","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":550,"y":420,"wires":[]},{"id":"75c38e98dfce732a","type":"debug","z":"0a899830909fc2d0","name":"Light C ON","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":550,"y":520,"wires":[]},{"id":"a46fc9a77b588d4c","type":"stoptimer","z":"0a899830909fc2d0","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":560,"y":380,"wires":[["ae165ea74210842c"],[]]},{"id":"ae165ea74210842c","type":"debug","z":"0a899830909fc2d0","name":"Light B OFF","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":750,"y":380,"wires":[]},{"id":"f1bef4548d6c5096","type":"stoptimer","z":"0a899830909fc2d0","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":560,"y":480,"wires":[["b3b1a3fbf5311416"],[]]},{"id":"b3b1a3fbf5311416","type":"debug","z":"0a899830909fc2d0","name":"Light C OFF","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":750,"y":480,"wires":[]},{"id":"1a9b3950.6d0f47","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

Well I guess you could but the way you have it is nice and clear and easy to understand and fix when you want to come back and change it in 6 months time.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.