Skip to content

Commit

Permalink
Fixed status flapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Dec 18, 2023
1 parent c0cbce8 commit d1c56c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v0.1.5
* Changed: Fixed status flapping between running and standby

## v0.1.4
* Added: Frequency
* Added: StatusCode: 7 = Running; 8 = Standby
Expand Down
14 changes: 8 additions & 6 deletions dbus-mqtt-pv/dbus-mqtt-pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,15 @@ def _update(self):
if pv_L3_power:
logging.debug("|- L3: {:.1f} W - {:.1f} V - {:.1f} A".format(pv_L3_power, pv_L3_voltage, pv_L3_current))

# is only displayed for Fronius inverters (product ID 0xA142)
# if power above 10 W, set status code to 9 (running)
if self._dbusservice['/StatusCode'] != 7 and self._dbusservice['/Ac/Power'] > 10:
self._dbusservice['/StatusCode'] = 7
# is only displayed for Fronius inverters (product ID 0xA142) in GUI but displayed in VRM portal
# if power above 10 W, set status code to 7 (running)
if self._dbusservice['/Ac/Power'] >= 10:
if self._dbusservice['/StatusCode'] != 7:
self._dbusservice['/StatusCode'] = 7
# else set status code to 8 (standby)
elif self._dbusservice['/StatusCode'] != 8:
self._dbusservice['/StatusCode'] = 8
else:
if self._dbusservice['/StatusCode'] != 8:
self._dbusservice['/StatusCode'] = 8

last_updated = last_changed

Expand Down

0 comments on commit d1c56c4

Please sign in to comment.