home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.43k stars 30.67k forks source link

Mikrotik: users are reported "away" while they are at home #105034

Open jeroenrnl opened 11 months ago

jeroenrnl commented 11 months ago

The problem

I have 5 different Mikrotik Accesspoints, all of them are connected to Home Assistant and all of them are reporting connected devices (i.e. the AP's are reachable, the user has sufficient rights and the integration is working correctly).

However, when a user moves from one AP to another, they change to "Away" and will only be reported "Home" again when they move back to the first AP.

Whenever a device is seen on another accesspoint, this is logged.

Platform mikrotik does not generate unique IDs. ID xx:xx:xx:xx:xx:xx already exists - ignoring device_tracker.xx_xx_xx_xx_xx_xx

What version of Home Assistant Core has the issue?

core-2023.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

mikrotik

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

Hey there @engrbm87, mind taking a look at this issue as it has been labeled with an integration (mikrotik) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mikrotik` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mikrotik` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


mikrotik documentation mikrotik source (message by IssueLinks)

issue-triage-workflows[bot] commented 8 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

jeroenrnl commented 8 months ago

The issue is still there

marlovh commented 8 months ago

Confirmed, I have the same issue. Using a hAP ax3 as main router and hAP ax2 as secondary AP. Running RouterOS v 7.14.

This issue started when I installed the hAP ax2 yesterday. hass_mikrotik_home_status

jeroenrnl commented 6 months ago

@engrbm87 could you please stop ignoring this?

engrbm87 commented 6 months ago

Devices registered by one AP can't have their state updated by another AP that is configured as a separate config entry. The second AP will try to register the detected device but will fail because the entity unique id (device mac) is already associated with the entity created by the first AP. One solution is to use CAPSMan where you configure the AP that is the CAPS manager which holds all the wireless devices and their connectivity is updated even when they connect to other APs.

issue-triage-workflows[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

jeroenrnl commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

This really is a great way to ensure I will never log a bug again

PWnet commented 1 month ago

@jeroenrnl I (still) have the same issue that has been closed for Stale. https://github.com/home-assistant/core/issues/69954#issue-1202844093

Even if using CAPSMan could be a solution, I think the Mikrotik integration has a problem with the way it handles the device tracking: indeed other integration (like dd-wrt, for example) works without flawns with multiple Accesspoints configuration.

I can't find the email, but some users have suggested some changes to the integration code to handle device tracking properly. As soon as I find the information I will post it here.

In the meantime I hope @engrbm87 can fix the issue.

Regards

psycho160 commented 1 month ago

hi, i think this is because wifiwave2 mikrotik devices use a different capsman. currently the integration querys only the "old" capsman registration table, not the new one.

i have a mixed environment, old and new capsman (running on the same hardware box) and my device tracker shows my phone only available if it's connected to an "old" AP.

Debug log says:

DEBUG (SyncWorker_15) [homeassistant.components.mikrotik.coordinator] Hub is a CAPSman manager

But the integration should also check the "Wifi" part of the code but never reaches self.get_list_from_interface(WIFI)

psycho160 commented 1 month ago

hi, i think this is because wifiwave2 mikrotik devices use a different capsman. currently the integration querys only the "old" capsman registration table, not the new one.

i have a mixed environment, old and new capsman (running on the same hardware box) and my device tracker shows my phone only available if it's connected to an "old" AP.

Debug log says:

DEBUG (SyncWorker_15) [homeassistant.components.mikrotik.coordinator] Hub is a CAPSman manager

But the integration should also check the "Wifi" part of the code but never reaches self.get_list_from_interface(WIFI)

As a workaround i did the following:

and now all my wifiwafe2 clients and "old" capsman clients are recognized by the device tracker.

UPDATE: Runs good for 3 days now πŸ‘