MindrustUK / Heatmiser-for-home-assistant

Heatmiser Neo-Hub / Neostat support for home-assistant.io
87 stars 33 forks source link

Feature: Report Heatmiser NeoHub serial number correctly for internal use in unique ID and Device Info #195

Open MindrustUK opened 3 weeks ago

MindrustUK commented 3 weeks ago

At present it appears that the Heatmiser API does not report the Hub's serial number in anyway, this feature has been requested here: https://dev.heatmiser.com/t/no-method-to-retrive-serial-nubmer-for-neohub-in-api/1298

In the absence of this feature, there should be a configuration step during the initial config flow / integration setup that prompts the user for a serial number, with an explanation of what it does, being that this is surfaced in the device info as a useful bit of information, but more importantly it plays a critical role in determining unique device ID's.

ocrease commented 2 weeks ago

@MindrustUK the websocket api returns a device id in the response wrapper which is the mac address of the hub. It's not the serial number, but it's perfectly valid to use as the unique key for the hub.

You could have something that only allows multiple hubs if using the websocket api. Or if adding a second hub the user is prompted to add an identifier (or use the config entry id which is suggested as a last resort)

ocrease commented 2 weeks ago

I forgot to say that to get the mac address from the websocket response, there would need to be a change in the API

MindrustUK commented 1 week ago

@ocrease Great suggestion! MAC addresses are indeed (or at least supposed to be) unique, this would be great. I'm thinking maybe there's a case to do some ARP cache resolution to resolve the MAC address in the use case that the websocket API isn't used. Equally as suggested this really only comes into play with multiple hubs... it feels wrong to not have this by default, but maybe I'm just obsessing over something ultimately of little value. :thinking: