Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serial number retrieval and add power #124

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dbus_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _get_serial(self, pvinverternumber):
if self.dtuvariant == constants.DTUVARIANT_AHOY:
if not meter_data["inverter"][pvinverternumber]["name"]:
raise ValueError("Response does not contain name")
serial = meter_data["inverter"][pvinverternumber]["name"]
serial = meter_data["inverter"][pvinverternumber]["serial"]

elif self.dtuvariant == constants.DTUVARIANT_OPENDTU:
if not meter_data["inverters"][pvinverternumber]["serial"]:
Expand Down Expand Up @@ -650,7 +650,10 @@ def set_dbus_values(self):
# the phase angles are 120 degrees apart
# sqrt(3) = 1.73205080757 <-- So we do not need to include Math Library
singlePhaseVoltage = voltage / 1.73205080757

if self.dtuvariant == constants.DTUVARIANT_AHOY:
singlePhaseVoltage = voltage
self._dbusservice["/Ac/Power"] = power

realCurrent = power / 3 / singlePhaseVoltage

self._dbusservice["/Ac/L1/Voltage"] = singlePhaseVoltage
Expand Down