So, at this moment the lights in a part of my home shut off at 22h. Works great. At least when I am not at home. When I am at home, it’s quite annoying.
Solution : I have a device tracker “device_tracker.xiaomi_13” that can track if I am at home or not.
How can I merge those together so that my lights won’t turn off when I am at home?
alias: Lichten Living Uit
description: ""
trigger:
- platform: time
at: "22:00:00"
condition: []
action:
- service: light.turn_off
target:
entity_id: light.groeplichtlivingstaanlamp
data: {}
- service: light.turn_off
target:
entity_id: light.groeplichtlivingleeslamp
data: {}
mode: single
No it’s pretty clear in the trace - automation stopped because condition failed. That means as far as Home Assistant is concerned - the state of the device tracker was NOT away. So that’s where you need to look.
away, is not the state. not_home is the state for not at home AND not in any other configured zone.
If you have any other configured zones then you will want to use a not before this condition, and check for the state home.
condition:
- condition: not
conditions:
- condition: state
entity_id: device_tracker.xiaomi_13
state: home
Hi Andrew Jones,
Thanks for your advice! I’ve corrected it and i’ll let you know if this solution works for me this evening. I’m not at home, so the lights should go out at 22h. I’ll keep you posted!