Device tracking (wifi) tied to rooms

Hi!

I’ve been an avid user of HA for quite some time and love it. I have a wifi setup with ruckus unleashed with 3APs which works wonders and the device tracker works just fine.

I was wondering though if the devs (or anyone else) has any ideas on how to leverage the wifi device tracker with multiple rooms. The ruckus unleashed code shows the AP that the device is currently connected to. I can assign rooms to the APs as well, quite easily. The only missing link would be for the device to be associated to a certain room based on the AP its connected to.

hypothetically I guess I could do something with mqtt_room and then triggering messages with the AP information added to it (or the room information) but if anyone has any ideas on how to to it “nicer”, I would greatly appreciate it.

Im no stranger to code and could contribute to the ruckus integration… but I was trying to find out the cleanest way to do so and maybe make it a bit more generic so that other wifi solutions could leverage it as well

I would absolutely love this as well!

Edit: I have no idea what I am doing but I think I managed to figure out something.

In:

on line 38 the code gets information about the Ruckus AP clients. It seems to me that the code only keeps the MAC address from all the information and then uses it later to add the devices as entities. Here is where I think the code could be tweaked to also keep the Access Point attribute of the client and store it in some attribute. The Access Point attribute is the AP’s MAC address. You can see the client info from a computer if you SSH to the Master AP, run enable, then run show current-active-clients all. The fetching of this information is all done through the pyruckus library available at: GitHub - gabe565/pyruckus: Python client for Ruckus Unleashed

After we have stored the Access Point variable/attribute, we then need some kind of helper script (similar to device_tracker?) to read that, fetch the area_id of the associated AP and then update the area_id of the connected devices. Keeping this or part of this separate means that it can be used by other WiFi solutions.

That is as far as I can get and I might be wrong on some stuff.

@garci66 I hope this helps if you have any python skills.