pbix / HA-solark-PV

Home Assistant integration for the SolArk PV Inverter
Apache License 2.0
36 stars 9 forks source link

unknown unit warning #4

Closed poldim closed 2 years ago

poldim commented 2 years ago

This is an odd message. I looked through your code and you're referencing the HA units for solark_battery_state_of_charge.

I don't think there's anything to do here, but logging it in case anyone else comes across it. It might be a problem upstream with the recorder component.

image

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:264
Integration: Sensor (documentation, issues)
First occurred: 7:20:10 AM (3 occurrences)
Last logged: 7:20:10 AM

sensor.solark_battery_state_of_charge has unknown unit %
sensor.active_energy_integration_hourly has unknown unit kwh
sensor.active_energy_integration_daily has unknown unit kwd
pbix commented 2 years ago

I do see that SOC message in my setup but only during initialization after restarting home assistant.

It is very strange to me in that I am using many of the standard units of measure in home assistant in the integration and usually I only see the message in regards to "%" and not any of the others.

I wonder if it is a bug in home assistant that might be fixed in the future. I do think there are some related issues with energy management in HA. I am using 2021.10.1 right now and do not see the other two warnings you document. I sometimes see another one related to one of these not being "strictly increasing" but again only during initialization.

Hopefully someone with more knowledge than me will comment on this issue and suggest a resolution. Or the will disappear in future revisions of HA.

Thanks for the report.

pbix commented 2 years ago

HA v2021.12.2 changed the error message to be more clear about the issue as being related to the sensor type. So by changing the sensor type I was able to resolve this warning. This fix is in the repo now so I am closing this issue.