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

acthor...externe Messung... #2831

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion packages/modules/smarthome/acthor/smartacthor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def getwatt(self, uberschuss: int, uberschussoffset: int) -> None:
argumentList = ['python3', self._prefixpy + 'acthor/watt.py',
str(self.device_nummer), str(self._device_ip),
str(self.devuberschuss), self._device_acthortype,
self._device_acthorpower, str(forcesend)]
self._device_acthorpower, str(forcesend),
str(self.newwatt), str(self._oldmeasuretype1)]
try:
self.callpro(argumentList)
self.answer = self.readret()
Expand Down
11 changes: 9 additions & 2 deletions packages/modules/smarthome/acthor/watt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
atype = str(sys.argv[4])
instpower = int(sys.argv[5])
forcesend = int(sys.argv[6])
aktpoweralt = int(sys.argv[7])
measuretyp = str(sys.argv[8])
# forcesend = 0 default time period applies
# forcesend = 1 default overwritten send now
# forcesend = 9 default overwritten no send
Expand Down Expand Up @@ -73,6 +75,11 @@
value1 = resp.registers[0]
all = format(value1, '04x')
aktpower = int(struct.unpack('>h', codecs.decode(all, 'hex'))[0])
# sofern externe Messung wird dieser Wert genommen
if measuretyp == 'empty':
aktpower = int(struct.unpack('>h', codecs.decode(all, 'hex'))[0])
else:
aktpower = aktpoweralt
# Wassertemperatur lesen
# Temp0 Warmwasser 1001
# Temp1 1030 <- Optional wenn 0, nicht angeschlossen dann ersetzt durch 300 (keine Anzeige)
Expand Down Expand Up @@ -139,8 +146,8 @@
f.write(str(count1))
# mehr log schreiben
if count1 < 3:
log.info(" watt devicenr %d ipadr %s ueberschuss %6d Akt Leistung %6d Status %2d" %
(devicenumber, ipadr, uberschuss, aktpower, status))
log.info(" watt devicenr %d ipadr %s ueberschuss %6d Akt Leistung %6d Status %2d Externe Messung %s" %
(devicenumber, ipadr, uberschuss, aktpower, status, measuretyp))
log.info(" watt devicenr %d ipadr %s Neu Leistung %6d pvmodus %1d modbuswrite %1d" %
(devicenumber, ipadr, neupower, pvmodus, modbuswrite))
log.info(" watt devicenr %d ipadr %s type %s inst. Leistung %6d Skalierung %.2f" %
Expand Down
Loading