Skip to content

Commit

Permalink
Merge branch 'jmason/add-soh' into jmason/always-record-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jmason committed Dec 15, 2022
2 parents 6b6882e + 2cbafdd commit da9b23d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions custom_components/solis/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
ENERGY_KILO_WATT_HOUR,
ENERGY_MEGA_WATT_HOUR,
POWER_WATT,
POWER_KILO_WATT,
ELECTRIC_CURRENT_AMPERE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
Expand Down Expand Up @@ -306,7 +305,7 @@
],
'batpower': [
'Battery Power',
POWER_KILO_WATT,
POWER_WATT,
'mdi:battery',
DEVICE_CLASS_POWER,
STATE_CLASS_MEASUREMENT,
Expand Down
9 changes: 8 additions & 1 deletion custom_components/solis/soliscloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,14 @@ def _post_process(self) -> None:
float(self._data[GRID_DAILY_ON_GRID_ENERGY])*10
except KeyError:
pass


# turn batteryPower negative when discharging (fix for https://github.com/hultenvp/solis-sensor/issues/158)
try:
if self._data[BAT_CURRENT] < 0:
self._data[BAT_POWER] = self._data[BAT_POWER] * -1
except KeyError:
pass

# Unused phases are still in JSON payload as 0.0, remove them
# FIXME: use acOutputType
self._purge_if_unused(0.0, PHASE1_CURRENT, PHASE1_VOLTAGE)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/solis/workarounds.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Switch on/off SolisCloud workarounds

#SolisCloud returns daily on grid energy a factor 10 off
correct_daily_on_grid_energy_enabled: false
correct_daily_on_grid_energy_enabled: true

0 comments on commit da9b23d

Please sign in to comment.