Closed JvdMaat closed 4 weeks ago
@JvdMaat The unit is currently taken directly from the API response value unit
of the device parameter.
It seems that the unit for this entity was changed wrong by the manufacturer (or whoever manages the API for your device).
The wrong unity does also result in false entity detection which causes the problem with th long term statistics.
I will try to add a compensating logic to solve this and avoid similar character case issues in future.
@JvdMaat Please give the latest pre-release a try: https://github.com/jaroschek/home-assistant-myuplink/releases/tag/1.5.1-rc1
With this change I try to compensate the possible character case issues in the parameter units by and returning internal units from HA, if they can be matches case insensitive.
I have reached out to the manufacturer (Enertech) to let them know about this typo (It also shows up in my myUplink web view) and requested they fix it. But no telling how long that will take. I appreciate the fix. Not in a position to manually upload that to my HA instance (And I can't figure out how to turn on HACS beta versions anymore in the new HACS 2.0). I'll check it once 1.5.1 comes out.
@JvdMaat I have made a new release 1.5.1 after testing the change for one day by myself. Please give it a try.
Works like a charm. That (147) sensor is now showing kWh in HA (And still kWH in myUplink) Thanks! (No word back from Enertech, aside from "Thanks for letting us know, we've sent it to the engineering team"). But hopefully they'll fix it on their end as well. But consider this issue closed as fixed through 1.5.1.
Just had to remove and re-add the myUplink integration and HA Repairs notified me of the incorrect units on a sensor that was previously correct. In my instance, it's the following sensor: Power, Savings & Efficiency kWH Saved (147) In addition, HA is also alerting me that there were long term statistics for this entity previously, but it currently does not have a state class, and thus no longer has long term statistics.