Hi,
I have a current rule where by if I leave the house ‘home’ to 'not_‘home’ my lights will turn off. I am using owntracks with it set to major movements so I think thats every 5 mins or 500m something like that any way. The current rule is
alias: Turn off Light
initial_state: True
hide_entity: False
trigger:
platform: state
entity_id: device_tracker.phones_rosss_iphone
from: 'home'
to: 'not_home'
condition:
condition: state
entity_id: input_boolean.light_tracking
state: 'on'
action:
- service: light.turn_off
entity_id: group.bedroom_lights
- service: notify.pushover
data:
title: ""
message: "Left Home! Lights OFF!"
The issue i’m having is, my place of work is only a 5/7 min walk away from ‘home’. I have a work zone setup within HA to HA knows i’m at work. Issue is that owntracks doesn’t update before I enter the ‘work’ zone so because my automation rule is from ‘home’ to ‘not_home’ the rule isn’t triggering because owntracks isn’t updating quick enough and the zone is going from ‘home’ to ‘work’ due to me being so close to work.
I cant see from the HA website that there is a rule to say if going from home to not home OR Work - Then run my automation. Or has any one got a better way of doing this?
My current way around this is that I have built another automation rule that says if my lights are still on by 7:15am this means that the tracking automation didnt work so turn the lights off regardless of where I am so long as my ‘Work Day’ sensor is True so that this only happens on days im at work and will definitely be out of the house.