tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
309 stars 53 forks source link

[Bug] None of the connected devices is listed as home on a RB4011iGS+RM #148

Closed strasharo closed 2 years ago

strasharo commented 2 years ago

Describe the issue

I’m running the integration on two HASS instances against two different models of the router. The one hooked against a RB952Ui-5ac2nD (HAP AC Lite) works fine, however the other which I attached to a RB4011iGS+RM router fails to detect which devices are currently online an lists all of them as not_home and have the disconnected icon, while at least ten of them are currently connected and have “bound” status in the DHCP leases page. What is the criteria the integration uses to determine if a device is at home or not, is the DHCP status sufficient or there’s something else used?

How to reproduce the issue

Steps to reproduce the behavior: 1) Have an up to date version of HASS 2) Add the Mikrotik router integration via HACS 3) Configure it against a RB4011iGS+RM. 4) Observe the list of connected devices present by the integration.

Expected behavior

Devices which are currently connected to the router should be shown as connected/home

Screenshots

image

image

image

Software versions

Traceback/Error logs

None

Additional context

I have the same setup against RB952Ui-5ac2nD with the same software and it works fine there.

tomaae commented 2 years ago

its not related to router itself, I have same one without wifi.

anything in HA log? if not, you will have to run debug and see whats going on.

strasharo commented 2 years ago

Ah, my fault. Looks like I had a rather restrictive drop ICMP rule on input, which was causing the pings to fail: Screenshot at 2021-11-18 22-22-53 Didn't know the integration was trying to ping them, thought it was relying on the DHCP presense. Bumping the logging level revealed the ping failures. Thanks a lot and sorry for the spam. :)

tomaae commented 2 years ago

No worries, it happens. If does not rely on DHCP presence. DHCP is just one way of device discovery. it would not be very responsive and reliable way for presence :)