Skip to content

[Bug] device_tracker only added when Integration is reloaded #315

@Zarox666

Description

@Zarox666

Describe the issue

When a device, lets say my mobile phone, is connecting to another AP no device_tracker is added.
The existing device_tracker turns to "not_home." When the Integration for that AP is reloaded while the phone is connected to another AP, it turns to "unavailable".
Only when I reload the Integration for the AP the phone is now connected with, a second device_tracker will be added.
When the device reverts back to the first AP, the device_tracker of the second AP will show not_home and the first still "unavailable".
With a second reload of the integration, the first AP then shows the presence of the phone.
But I if reload the intergatrion for the second AP then that one goes to "unavailable".

image

image

Is it even neccessary, sensible to create multiple device_trackers for the same device?

How to reproduce the issue

Get two Mikrotik APs that provide the same WLAN and roam between them.

Expected behavior

Devices registering with an AP should get a device_tracker and the device_tracker should get updated, without reloading the Integration.

Screenshots

see above

Software versions

Home Assistant 2023.10.0
Supervisor 2023.10.0
Operating System 10.5
Frontend 20231002.0 - latest
Mikrotik Router integration version: v.2.1.4
RouterOS version: both Routers in this test run v6.49.7 (stable) but I have a 3rd AP running v7.6 that is also affected.

Diagnostics data

Could not find anything in the logs that seems to be related.

Traceback/Error logs

see above

Additional context

This has worked at some point in the past, as I did not have to connect my phone (or other devices) to a certain AP (by switching of the other APs) and then reload the integration in order to get all 3 possible device_trackers into my config, when I originally set up the integration. This must have been prior to v.2.1.3.
However I cannot say, when this stopped working.
Originally the device trackers were showing as device_tracker.name_of_the_device. And the second and third as device_tracker.name_of_the_device_2 and device_tracker.name_of_the_device_3 respectively.
Since the Upgrade of the Mikrotik Integration to Version 2.1.3 device_trackers now show as device_tracker.MAC_Address.
This broke all my automations concerned about device trackers and I had to reconfigure everything with the new entity_ids.
For that it seems I am not the only one: #301
But in my Case its a bunch of Shelly Devices and my Android OS mobile Phone with the Companion App that was affected.

In essence the current state would mean, that I have to bring all possible devices into my network. Switch off 2 of the APs, reload the Integration for the 3rd one, then switch that off and the next one on and repeat the same there.

Generally I am wondering if multiple device_trackers for the same device provided by multiple APs are neccessary.
From a (laymans) logic perspective a single device_tracker per device and than an information in the Attribute which AP reported the Status would be good.

Please let me know if anything is unclear or further information required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplannedTo be implemented in future release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions