Hi, sorry for this newbie question but how can I retrigger the automation when conditions become true? I didn’t get it - sorry! My script will only fire once, right?!
The plan is that the light should only be switched on when all the people are not at home and the conditions are true - so even when everyone is out and the sunset will be there later.
alias: Rule_BalconyLight
trigger:
- platform: state
entity_id:
- person.max
- person.anna
to: not_home
condition:
- condition: device
type: is_off
device_id: 3dee28f48c3d23b71c44c10ee16ba5f8
entity_id: switch.balcony
domain: switch
- condition: sun
after: sunset
after_offset: "00:10:00"
- condition: time
before: input_datetime.var_balconytimeoff
action:
- type: turn_on
device_id: 3dee28f48c3d23b71c44c10ee16ba5f8
entity_id: switch.balcony
domain: switch
mode: single
Not sure if I am reading this correctly but it looks like you would like to turn “switch.balcony” on with the sun and off with time if the switch is off and no one is home.
if that is the case then.
The trigger should be sun. Conditions should be zone home like what drew said but a condition & your condition for device is good but you dont need it as if it is on and you turn it on then it is on followed by your action to turn_on then your time is needed for off.
Hi, sorry for the confusion. I want to turn on the lamp when one of the people leaves the house, but only when the sun has set. If no one has left the house and the sun has set, the light should not go on. But as soon as someone leaves the house in the time window, it should come on again. I hope it is clearer now