Closed matthewbyrne closed 1 year ago
Feels like this change broke it https://github.com/hultenvp/solis-sensor/pull/250
Can you perhaps make a screenshot with both battery power and battery current?
From ~6am today was me charging the battery, and from 8am was me using the battery. As you can see, both are positive.
Thanks,
This is really not what I expected. I copy over the sign of the current and apply it to the power, because battery power is always positive for some people due to some silly bug in the Soliscloud API. You are using soliscloud, right, or are you using m.ginlong.com?
Correct. Soliscloud.
I've had to resort to @barthoefs fix from here: https://github.com/hultenvp/solis-sensor/issues/249#issuecomment-1379991258
Ughh, you are right, there is a mistake in the code. 🤦
# turn batteryPower negative when discharging (fix for https://github.com/hultenvp/solis-sensor/issues/158)
try:
math.copysign(self._data[BAT_POWER],self._data[BAT_CURRENT])
except KeyError:
pass
should be:
# turn batteryPower negative when discharging (fix for https://github.com/hultenvp/solis-sensor/issues/158)
try:
self._data[BAT_POWER] = math.copysign(self._data[BAT_POWER],self._data[BAT_CURRENT])
except KeyError:
pass
Describe the bug Up until this week the
solis_battery_power
entity was negative while discharging, and positive while charging. Now it seems as though it is always positive.Versions HA Version an deployment 2022.12.7 HACS version 1.30.1 Integration version v3.3.1
Screenshots