syssi / homeassistant-goecharger-mqtt

go-eCharger integration for Home Assistant using the MQTT API
Apache License 2.0
88 stars 18 forks source link

[BREAKING] Remove `dwo` as a sensor and add it as a number entity #143

Closed Triple-S closed 7 months ago

Triple-S commented 7 months ago

Very simple change to make the dwo field writeable.

syssi commented 7 months ago

Could you update the README.md too? (Move the dwo row to the number section)

Triple-S commented 7 months ago

Could you update the README.md too? (Move the dwo row to the number section)

Sure, it is done.

Triple-S commented 7 months ago

I just realized that there was another flaw with the implementation: Initially I assumed that setting the Charging energy limit to 0 would remove the limit since it is displayed like this in the go-e app. However, I found out that internally there is a distinct difference between a limit of 0 and "null" (unset). Because I don't see any reason to set the limit to exactly 0 on purpose, I added an exception in number.py to report a 0 as "null" to the charger and thereby remove the limit. In Home Assistant this state is displayed as an empty field. One could add another exception to display this state as 0, but I think it is better to have a visibile difference between 0 and "null" in Home Assiatant.

Another change I implemented is increasing the maximum possible value of the Charging energy limit from 100kWh to 1000kWh since there are already cars around with batteries larger than 100kWh, so the maximum could have been too low for some cars.