eelcohn / home-assistant-ddwrt

DDWRT component/entity for Home Assistant
18 stars 7 forks source link

Device Tracker not updating #11

Open anandyliang opened 3 years ago

anandyliang commented 3 years ago

Model: Archer C9v1 Firmware: Firmware: DD-WRT v3.0-r45993 std (03/12/21)

Hey so first off, great work on the component, I think the integrated component is way too barebones compared to how much data can be retrieved, and I think this bridges the gap quite a bit.

So initially I wasn't able to get the component to work at all until I realized that the master didn't have the latest version. Once I used the latest branch, it did begin to work but the log spat out a bunch of warnings about active_wireless data and uPnP forward data having different numbers of elements than expected.

Didn't matter to me that much as I'm using ARP to track my devices since I'm running multiple APs. ARP data seemed to look fine but upon inspection in my devices page, I saw a whole a bunch of interfaces instead of device names. It turns out my Status_Lan.Live page has 8 elements per device instead of 4 or 5. Once I hardcoded it to 8, the devices were added fine. I'm not sure if there's a better way to detect the number of elements per device. The stock integration uses regex to match the MAC address so perhaps something with that will be the answer. I'll pull request or something if I find something good.

(On a side note, I also added a condition to make sure the amount of connections were at least 1 as the ARP table will keep devices with 0 connections, which is weird because I wouldn't consider them active)

However, all the devices are permanently marked as unavailable and I'm afraid I'm not advanced enough to understand why. I looked through the log and I couldn't find any evidence of any ddwrtdevice messages past the initial bootup. I can attach a log for you to look at if that helps. Otherwise, let me know if there's anything else I can provide.

Thanks!