Allright. I’ve searched several topics and I’m new to Hass.io. For now it’s a lot of fun, but I’m stuck on something - I guess - easy for you guys.
I want just a simpe thing to start with.
- When I’m at home and the sun is down, turn on the lights. So far so good with this automation:
- action:
- data:
entity_id: light.tradfri_group_4
service: homeassistant.turn_on
alias: Thuis na zonsondergang
condition:
- condition: state
entity_id: device_tracker.xxx
state: home
id: 'xxx'
trigger:
- event: sunset
platform: sun
But I also want, when I’m not at home for example five minutes, to turn the lights out. I’ve found something like this, But I’m not able to get this working:
condition:
condition: state
entity_id: device_tracker.paulus
state: not_home
# optional: trigger only if state was this for last X time.
for:
hours: 1
minutes: 10
seconds: 5