Hi!
I’m very new to much of the hands-on stuff that HASS requires, but I find it both fun and engaging. Now, I’ve played around with HASS for a few days and have a relatively working setup (with some home-brew stuff, e.g. going through IFTTT to get reliable, fast-ish (5 second instead of 30-180 second lag) state changes from my Tellstick Net). One thing I haven’t got working yet is presence detection, which seems to be an issue for many people, especially with iPhones.
I really only want to track home or not at home, so I don’t need anything advanced, and I really thought I had found the solution when I remembered that IFTTT can send HTTP requests to the REST api. And after much frustration, I got the automation working as well, saying that if NMAP changes the state of me to not_home, it should check the input_boolean that IFTTT triggers. If that is ‘on’, the device_tracker should be set to ‘home’, despite the phone’s wifi going to sleep.
The automation sort of works, it triggers when the state changes, but there it stops. Device_tracker doesn’t change back to ‘home’ as I thought it would with the ‘see’ command. Is it working as intended or am I doing something wrong?
Here comes the snippet from my automation.yaml.
- alias: Home State
trigger:
- platform: state
entity_id: device_tracker.gustafs_iphone
to: 'not_home'
condition:
condition: state
entity_id: input_boolean.gustaf_home
state: 'on'
action:
- service: device_tracker.see
data:
dev_id: device_tracker.gustafs_iphone
location_name: 'home'