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

smarthome dactype = 3 anpassung #2799

Merged
merged 1 commit into from
Nov 6, 2023
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/nxdacxx/smartnxdacxx.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:
str(self.devuberschuss),
str(self._device_nxdacxxueb), str(forcesend),
str(self._device_dacport),
str(self._device_nxdacxxtype)]
str(self._device_nxdacxxtype),
str(self.newwatt)]
try:
self.callpro(argumentList)
self.answer = self.readret()
Expand Down
12 changes: 8 additions & 4 deletions packages/modules/smarthome/nxdacxx/watt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
forcesend = int(sys.argv[5])
port = int(sys.argv[6])
dactyp = int(sys.argv[7])
aktpoweralt = int(sys.argv[8])
initlog("DAC", devicenumber)
log = logging.getLogger("DAC")
# forcesend = 0 default time period applies
Expand All @@ -36,7 +37,10 @@
with open(file_stringcount5, 'w') as f:
f.write(str(count5))
modbuswrite = 0
neupower = uberschuss
if dactyp == 3:
neupower = uberschuss + aktpoweralt
else:
neupower = uberschuss
if neupower < 0:
neupower = 0
if neupower > maxpower:
Expand Down Expand Up @@ -71,9 +75,9 @@
if count1 > 80:
count1 = 0
if count1 < 3:
helpstr = 'devicenr %d ipadr %s ueberschuss %6d port %4d'
helpstr = 'devicenr %d ipadr %s ueberschuss %6d aktpoweralt %6d port %4d'
helpstr += ' maxueberschuss %6d pvmodus %1d modbuswrite %1d'
log.info(helpstr % (devicenumber, ipadr, uberschuss,
log.info(helpstr % (devicenumber, ipadr, uberschuss, aktpoweralt,
port, maxpower, pvmodus, modbuswrite))
# modbus write
if modbuswrite == 1:
Expand All @@ -94,7 +98,7 @@
rq = client.write_register(0, ausgabe, unit=1)
elif dactyp == 3:
ausgabe = int(((neupower * (4095-820)) / maxpower)+820)
if ausgabe < 820:
if ausgabe <= 820:
ausgabe = 0
# ausgabe nicht kleiner 4ma sonst Leistungsregelung der WP aus
rq = client.write_register(0x01f4, ausgabe, unit=1)
Expand Down
Loading