Skip to content

Commit

Permalink
-Automatic refresh of the power limit in the role 'pvinverter' deacti…
Browse files Browse the repository at this point in the history
…vated

-Fixed GUI on Venus OS V3.42.
-Fixed inverterTotalEnergy on VRM
  • Loading branch information
Telekatz committed Oct 6, 2024
1 parent 0e331e7 commit 5864a79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def _inverterLoop(self):
if self._everySeconds(300):
self._inverterLoopCounter = 0

if self._dbusservice['/State'] > 1:
if self._dbusservice['/State'] > 1 and self._role == 'acload':
self._inverterSetPower(self._dbusservice['/Ac/PowerLimit'], True)

except Exception as e:
Expand Down
12 changes: 2 additions & 10 deletions MicroPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,11 @@ def _updateVebusTotal(self):
inverterAcVoltage[i] = max(inverterAcVoltage[i],self._dbusmonitor.get_value(self._powerMeterService,f'/Ac/L{i+1}/Voltage') or 0)
inverterTotalPowerDC = self._dbusservice['/Ac/Power'] / self._efficiency()
inverterTotalCurrentDC = 0 if voltageDC == 0 else (inverterTotalPowerDC / voltageDC) * -1
for device in self._devices:
inverterTotalEnergy += device.Energy

else:
for device in self._devices:
inverterTotalPowerDC += device.DcPower
inverterTotalCurrentDC += device.DcCurrent
inverterTotalEnergy += device.Energy
for i in range(0,3):
inverterTotalPower[i] += device.AcPowerL(i+1)
inverterTotalCurrent[i] += device.AcCurrentL(i+1)
Expand All @@ -671,14 +668,8 @@ def _updateVebusTotal(self):

# 5s interval
if self._everySeconds(5):
if self._powerMeterService != None:
for device in self._devices:
inverterTotalEnergy += device.Energy
else:
inverterTotalEnergy += device.Energy
self._dbusservice['/Energy/InverterToAcIn1'] = inverterTotalEnergy

for device in self._devices:
inverterTotalEnergy += device.Energy
eff = device.Efficiency
effP = device.AcPower
if eff > 0:
Expand All @@ -687,6 +678,7 @@ def _updateVebusTotal(self):
temperature = max(temperature, device.Temperature)
self._dbusservice['/Temperature'] = temperature
self._dbusservice['/Ac/Efficiency'] = 0 if efficiency == 0 else efficiencyP / efficiency
self._dbusservice['/Energy/InverterToAcIn1'] = inverterTotalEnergy


def _getSystemPower(self):
Expand Down
18 changes: 8 additions & 10 deletions qml/PageMain.diff
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
--- /opt/victronenergy/gui/qml/PageMain._qml
+++ /opt/victronenergy/gui/qml/PageMain.qml
@@ -64,6 +64,11 @@
}

@@ -57,6 +57,11 @@
Component {
+ id: vebusPageHm
+ PageVebusHm {}
id: vebusPage
PageVebus {}
+ }
+
+ Component {
id: multiRsPage
PageMultiRs {}
+ id: vebusPageHm
+ PageVebusHm {}
}
@@ -146,7 +151,7 @@
switch(service.type)

Component {
@@ -146,5 +151,5 @@
{
case DBusService.DBUS_SERVICE_MULTI:
- page = vebusPage
+ page = service.name.indexOf("vebus.MicroPlus") > 0?vebusPageHm:vebusPage
break;
case DBusService.DBUS_SERVICE_MULTI_RS:
page = multiRsPage

0 comments on commit 5864a79

Please sign in to comment.