Debian GNU/Linux 10 (buster)
Linux 5.10.17-v8+
Raspberry Pi 4 Model B Rev 1.4
Openhabian 3.0.1
Within the easter break i have received lots of new sonoff zigbee sensors, i have successfully connected them all to the sonoff zigbee bridge running tasmota to mqtt.
Im trying to create a rule to turn a light on when motion is detected but only if night_state = ON. i then want to start a timer for say 5 minutes and then turn off said light if there is no motion. If there is motion detected once the 5 minutes is up, the timer should be reset.
This is a very common thing that we start with when we do home automation. It is unfortunate that each of us has to do the same thing again and again. Reusable sets of rule would be useful here, but unfortunately that is still far away due to the low level of abstractions in OpenHab. The general idea is to combine the Astro sensor, motion sensor, timer, and the light switches.
If you search the forum, you will see many solutions. I myself went through 3 iterations.