I am trying to setup this kitchen light where it turn on when motion is detected and it will stay turn on until the Kitchen sensor occupancy and toilet presence sensor is not occupied.
How do I keep the sequence of
checking that both the kitchen and toilet sensor on human presence is cleared then it turn off the light and start a new run?
Not sure what I wrote earlier confusing.
My idea is that when I walk into the kitchen. Light auto on. Walk into the toilet and the toilet presence sensor will trigger the toilet light to be on.
When the toilet presence sensor detect human around, the kitchen light will remain on.
When the toilet presence sensor detect no human and there is no motion in kitchen sensor, the kitchen light will turn off. I am having issues making sure the automation run a full cycle.
Your âsensor detected to clearâ trigger is set up incorrectly. Itâs triggering both when itâs detected & when itâs clear
Instead of this:
- trigger: state
entity_id:
- binary_sensor.kitchen_sensor_occupancy
id: sensor detected to clear
from:
- "on"
- "off"
It should be:
- trigger: state
entity_id:
- binary_sensor.kitchen_sensor_occupancy
id: sensor detected to clear
from: "on"
to: "off"
for:
hours: 0
minutes: 0
seconds: 30
I also added the 30s timeout to your trigger, because you were checking that in your conditions, but conditions donât wait for a timeout once the trigger fires.
thank you so much but can i ask is the 30 sec act as a cooldown and also for a human to have a action inbetween so it will only re trigger the whole automation if it goes clear and for 30 sec?
Your previous automation was triggering immediately when it went from detected to clear. It was then checking the conditions that it was clear for 30s.
That is not how conditions work in HA. Once a trigger fires, a condition is evaluated immediately, so your condition was never met (because your sensor had only been clear for less than 1s at the time) and your automation stopped there.