willholdoway / hifiberry

This is a custom component to allow control of HifiberryOS devices in Home Assistant using the audiocontrol2 REST API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Use device name as UID instead of IP address

salsabeard opened this issue · comments

I just migrated my 3 devices from Balena-Sound to HiFiBerry OS. I can't believe I held out as long as I did as this platform is exactly what I've wanted.

My suggestion is based around two different use-case scenarios. One would be for users that are simply using DHCP for addressing of the HFB. Given that the address is subject to change, it isn't a viable UID.

The second use-case is the one I fall into. I have static addresses assigned for my devices, but I also utilize both wired and wireless. In both Balena-Sound and HiFiBerry OS, the devices seem to connect to wireless even when the wired is connected. This results in the device pulling two IP addresses.

As such, I end up having 6 different devices with single entities for 3 physical units. It would be nice if each unit was tracked as a single device with a data table consisting of the relevant MAC addresses. IP would be populated dynamically via ARP. Then we'd just need the media player entity to track whichever MAC is actively in use for the device.

This is defined by hifiberry you would have to ask over there and @schnabel would have to help implement in audiocontrol2sio

@salsabeard if you are still interested ... let me know. But I do not have a lot of time at the moment :-(.

Hi @salsabeard,
I think your problem might just be a small misunderstanding. If I understand correctly you want to abstract away from the physical connection used to communicate from HASS with the hifiberry API.
You could use the name of the hifiberry devices instead of fixed IPs (in the HASS config). This name should be used by your router for your LAN (for DNS). You can configure the name in main view of the hifiberry os (the three dots). In case you want to disable wifi ... you can do that in the network settings.
Hope that solves your problem :-).

HI @salsabeard. I did not mean offend you or question your knowledge about networking. I assumed from your first post that you might think you have to use an IP to configure the HFB in HASS. That is why I pointed out that you could use DNS if your router supports it.
I also think it is a valid assumption that many user do use a router with DNS and in that case it would solve the problem. Since it is possible to turn off the wifi on the hifiberry I do not really see much need for action.