chamberlain2007 / aprilaire-ha

A custom component for Home Assistant to interact with Aprilaire thermostats.
MIT License
12 stars 5 forks source link

Sensor's not unique between devices. #4

Closed nberardi closed 1 year ago

nberardi commented 1 year ago

I have two 8840 devices in my house, and the plugin seems to be sharing the same sensors across the two devices. A unique name should be assigned to each device to ensure that the status is reported properly.

chamberlain2007 commented 1 year ago

Can you clarify A) do you have two separate 8840s with two separate IP addresses? B) is it just the naming that's wrong?

It should create a Device for each time the integration is added. The device's identifier is unique, using the MAC address of the thermostat. The device then houses the climate and sensor entities, etc. Those entities currently use the entity's name as the unique_id property, so theoretically I guess they could overlap. Conceivably we could append the MAC address there if needed.

Let me know what you're actually seeing on your end.

chamberlain2007 commented 1 year ago

@nberardi I believe this should be fixed in a555b04. I have put it into pre-release 0.2 which you can activate in HACS by enabling beta releases for the repo. If you can give this a shot while in pre-release, that would be great. Otherwise, I will go ahead and release after some more testing on my end.

nberardi commented 1 year ago

Thanks I will give it a shot. I wish I could be more help, however Python isn’t a language that I have a lot of comfort In right now.

I have started to mess around in the protocol using Node. And haven’t ran into the API stability problems that you mentioned in your forum post.

Interestingly, I have found that the API does large dumps of data at times, and you really need to pay attention to the length and checksums to find all the packets sent.

Not sure if you have found the same, in your development effort. https://github.com/nberardi/scrypted-aprilaire/blob/main/src/AprilaireClient.ts#L98

nberardi commented 1 year ago

@chamberlain2007 the extra sensors are separated out as expected in my setup on .2.

chamberlain2007 commented 1 year ago

Great!