Could you post your ha configs?
It could be very useful…
Thanks!
Could you post your ha configs?
It could be very useful…
Thanks!
Sure.
zone:
- name: 'Home'
latitude: !secret home_lat
longitude: !secret home_long
radius: 3
zone.home:
track_ios: true
beacon:
uuid: 123456789-1234-1234-1234-1234567891234
major: 0
minor: 0
3a. I selected the phone as device tracker for my “person”
3b. I then created the following python script that changes the status of the device tracker that gets called in the automations in step 3c:
entity_id = data.get('entity_id')
if not entity_id:
logger.error('No entity_id provided')
state = data.get('state')
if not state:
logger.error('No state provided')
hass.states.set(entity_id, state)
- alias: Set Away Status
description: ''
trigger:
- platform: webhook
webhook_id: set_away_status
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: person.you
state: home
sequence:
- data:
entity_id: device_tracker.your_iphone
state: not_home
service: python_script.set_state
mode: single
- alias: Set Home Status
description: ''
trigger:
- platform: webhook
webhook_id: set_home_status
condition: []
action:
- data:
entity_id: device_tracker.your_iphone
state: home
service: python_script.set_state
mode: single
So in summary here’s what happens:
Then you can use the change of status as a trigger for an automation of your choice.