Device Tracker - Automation to Trigger Update (Something like a device_tracker.scan service)

Hello,

I’d like to create an automation to trigger an update on all of my device trackers when my sensor.front_door is open. I was hoping to find a device_tracker.scan service or something that causes all (or by entity_id) device trackers to scan, regardless of the interval_seconds settings.

Basically, given my device trackers and my door sensor, I can tell that someone came home, but it can take a while for the next interval_seconds to pass, scan for new devices, and then know who came home.

I’d like to have the opening of the front door trigger an immediate scan so I can tell who’s home right away.

Anyone have any ideas on this?

Thanks!

2 Likes

This would be awesome.

Some serious thread necromancy here but with the iOS 2.0 companion app beta you can send a notify.mobile_app_your_device_name with the message being “request_location_update”, like the below.

{"message":"request_location_update"}

I guess for Android anything integrating with mobile_app library, including the forthcoming official app should work too.

1 Like

This is actually now possible because of an even more generic service call, homeassistant.update_entity which allows you to force an update for ANY entity, including device trackers!

See service calls docs.

1 Like

How do you deal with the delay of logging into wifi? When I get home, my mobile takes between instant and several minutes before logging into my wifi. Updating all devices won’t cut it.
Do you use other trackers? I also use owntracks in significant mode, but it also is quite slow to update, which ruins precision but is enough to show me somewhat where I am.

Oh…this looks real promising. I’ll take a look…

Ta.

Can anyone confirm that homeassistant.update_entity is working for device trackers in practice, and which types?

I’m not having much luck just yet…

Having it scan for bluetooth devices might solve a few problems for me.

No, this is not working:

2020-03-19 22:43:02 WARNING (MainThread) [homeassistant.helpers.entity_component] Forced update failed. Entity device_tracker.garden_repeater not found.