MikeJMcGuire / hass-actronque

Actron Que/Neo Air Conditioner Add-On for Home Assistant
GNU General Public License v3.0
15 stars 5 forks source link

Battery reporting 0% on Neo zone sensors #16

Open kclif9 opened 9 months ago

kclif9 commented 9 months ago

Hello,

The battery is reporting as 0% on the Neo zone sensors. Looking at the API responses I can see that it's showing voltages. Can you please see if the battery % can be set correctly?

Home assistant screenshot: image

API response screenshot: image

I can also see humidity levels reported from the sensors, can those be added as well? They look to be different per zone so Actron may have fixed the issue that caused them to show 0%?

Thanks in advance for your help!

bongo505 commented 5 months ago

The code (line 883 in que.cs) looks for the battery percentage in: RemoteZoneInfo[{0}].Sensors.{1}.Battery_pc But only if the unit is a Que (the if statement includes a check that the JSON contains sensors, and that system type == que).

The Neo separates zones and sensors (which it calls peripherals) and stores the battery percentage against the peripheral - as seen in your API response above. Peripherals / RemainingBatteryCapacity_pc There is a link between the zone and the peripheral using the peripheral name (which is a form of the MAC address) - in the peripheral this is SerialNumber (but note "DeviceType"), in the zone it is that serial number preceded by ZS: for a Zone Sensor, while the NEO unit uses the wall controller address (e.g. C1)

The peripheral as you noted also stores reported humidity and temperature, so perhaps the code could use this to retrieve current data. The peripheral does include which zone it is linked to under ZoneAssignment. There are two options - use the zone to find the serial number, then look for that serial in peripherals. Alternatively (likely better) - step through the peripherals looking for the assigned zone and allocate the values to that zone. Mike has noted that it is possible for more than one sensor to be located per zone, so additional work may be required - I don't know the ins and outs enough.

Apologies, but while I can code a bit in C++ for ESP32 this is beyond me at the moment. I hope however that I've laid a trail with enough breadcrumbs for someone to pick up on.

MikeJMcGuire commented 4 months ago

Howdy - let me know if this is still an issue. I don't have a Neo to test it against, so may need some help with the testing. Can you post a comment to the Neo page about it and then I can contact you directly. https://blog.mikejmcguire.com/2021/02/11/actron-neo-and-home-assistant/