Hi everyone,
Did anyone figured out how to retain the state of a person/device tracker when using Locative with webhooks, and lately via Home Assistant Cloud webhook, after a reboot?
After each reboot the state goes to an unknown state and I can only change it if I send a test from the mobile Locative app for the device tracker to appear/get recreated, then, change its state to say “home”. Otherwise it just doesn’t get created as a device tracker until the mobile device changes its actual physical location to a known location (“not home”when I leave home, or “home” when I get home)
Same here, also post this on GitHub.
Have you found a solution?
Unfortunately not. I don’t think anyone did.
It seems that automation with homeassistant.update_entity
works for me
then a automation to do this action after when HA is restart will solve the problem (workaround)
hey @mgim thanks for the tip, I’ve tried your solution but doesn’t want to work the way I though you meant:
- service: homeassistant.update_entity
data:
entity_id: device_tracker.123abc_xxx_xxx_xxx_xxxxxxxx, device_tracker.234abc_xxx_xxx_xxx_xxxxxxxx, device_tracker.345abc_xxx_xxx_xxx_xxxxxxxx
They all return unknown upon restart.
Can you give us an example on how you’ve done yours?
My full automation looks like this, and the first part works fine and is sending me a notification when HA restarted not the second part where it meant to update the state of my locative device_trackers.
- id: notificationRestart
alias: ‘Notification Home Assistant Restart’
trigger:
platform: homeassistant
event: start
action:
- service: notify.pushover
data_template:
title: “HASS Restart”
message: “Home Assistant has restarted.”
- service: homeassistant.update_entity
data: entity_id: device_tracker.123abc_xxx_xxx_xxx_xxxxxxxx, device_tracker.234abc_xxx_xxx_xxx_xxxxxxxx, device_tracker.345abc_xxx_xxx_xxx_xxxxxxxx
@dashony
All the device_tracker I am referring to are linked to some app integration on Android or iOS. The device_tracker listed by your routine integration or by nmap will not be working.
@mgim are you using Locative with your setup? I’m wondering what app you were referring to.
Locative is an iOS app and it does a POST when location zone changes, using a webhook to the HA server (if on a HA cloud), or a direct POST via a DuckDNS or some external link to your instance using a U & P.
First time it does a POST to HA after a restart, it creates the device_tracker.xxxxx for your device and the issue is that during restart, the device_tracker.xxxxx doesn’t exist hence why it shows as unavailable.
If you attempt to hard code one in, the device_tracker that gets created will be different (device_tracker.xxxx_2) since the original one is already is use…
So can’t win…
Ideally, the device_tracker and it’s status get saved with their last status prior to reboot and get their status reassigned after reboot .
I’d love to see this working.
I am not using Locative. I am using the official Home Assistant app.
You should vote here for the fix:
Voted. Fingers crossed
voted also !