Device_tracker.see doesn't actually change state

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'

Ok, I’ve left this automation running for two days now, and it looks like it’s working sometimes. The gaps in the ‘home’ status is generally 1-3 minutes without me touching the phone, but it can go as high as ten minutes before it changes back. So I can’t conclude that it isn’t notifications that wakes the phone back up and connects it or the automation.

But I think this should be instant, since it’s an instance within HA that triggers a change within HA. So again, have I missed the purpose of the device_tracker.see service, or is something foul afoot in my code?

WI’ve noticed the same thing. I have an automation that is supposed to update my location on the map while driving from work and send my wife a notification that I’ve left work but with the device_tracker.see it still updates at 15 min increments. I was thinking it was a user error. Glad I’m not the only one.

I am trying to do something like this now, and it’s kind of backwards that it doesn’t update instantly. Anyone found a solution?