tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
301 stars 50 forks source link

[Bug] Device tracking flap between home/away #262

Closed sbeaudoin closed 1 year ago

sbeaudoin commented 1 year ago

Problem Description New installation of this integration. Added my Mikrotik switch, router and acces point. For each, activated the following options:

All entities starting with "device_tracker" flap between "unavailable" to "home" at each 10-15 seconds.

To Reproduce

  1. Install Home Assistant OS v9.4 (Supervisor v2022.12.1, Home Assistant v2022.12.9)
  2. Install Mikrotik Router v2.1.2
  3. Configure it for a Mikrotik RB3011UiAS with RouterOS v7.6 and firmware v7.6
  4. Activate the following options:
  1. In the developer tools sections, filter the entities with the name "track"

All the state will change from "unavailable" to "home" at each 10 to 15 seconds as seen in the following video:

https://user-images.githubusercontent.com/3873484/210599550-e2b91420-c009-4ec4-ad0f-e19ef37ee3cf.mp4

Here is the debug log:

home-assistant_mikrotik_router_2023-01-04T16-16-00.821Z.log

sbeaudoin commented 1 year ago

It seems related to a permission issue. I use a user named "iot" with restricted permissions. Those are the ones I use:

Rights

sbeaudoin commented 1 year ago

Found the problem. I must activate "write", but why? I don't want this to modify my settings!

tomaae commented 1 year ago

I would need to see debugs in order to know what exactly is failing. What you attached is just a standard HA log. Enable debugs and wait for flap to occur.

Integration never modifies your settings. write permission is mainly to enable switches, but there are some weird limitations placed on api, where write permission is linked to ability to read data, such as environment temperatures. Your case seems to be something new or missed due to settings combination.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.