- alias: 'Tænd lys i gangen når vi kommer hjem'
trigger:
platform: state
entity_id: group.all_devices
state: 'home'
condition:
condition: state
entity_id: group.all_devices
state: 'home'
action:
service: homeassistant.turn_on
entity_id: group.gang
can i have 2 conditions
i want this automation only happen when it´s sunset and i get home`?
Use both as triggers and as conditions. Event will trigger at sunset or whenever you get home. It’ll then check to make sure you’re home and it’s after sunset.
trigger:
- platform: state
entity_id: entity_id: group.all_devices
state: 'home'
- platform: sun
event: sunset
condition:
conditions: and
- condition: state
entity_id: group.all_devices
state: 'home'
- condition: sun
after: sunset
action:
That’s what this’ll do. If it’s sunset and you’re already home, it’ll come on. If you’re not home, it won’t. If you come home and it’s past sunset, it’ll come on.