Skip to content

Commit

Permalink
sdm120, sdm630 und Lovato Zähler werden aus openWB 2.0 Verzeichniss g…
Browse files Browse the repository at this point in the history
…enommen

Neu werden diese Zähler für Smarthome aus dem Openwb 2.0 Verzeischniss aufgerufen. Die separaten verzeichnisse unter Smarthome wurden gelöscht.
  • Loading branch information
okaegi committed Dec 20, 2022
1 parent 6ee2ef1 commit c0790d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 117 deletions.
24 changes: 0 additions & 24 deletions modules/smarthome/lovato/lovato.py

This file was deleted.

33 changes: 0 additions & 33 deletions modules/smarthome/sdm120/sdm120.py

This file was deleted.

33 changes: 0 additions & 33 deletions modules/smarthome/sdm630/sdm630.py

This file was deleted.

49 changes: 22 additions & 27 deletions runs/usmarthome/smartmeas.py
@@ -1,6 +1,10 @@
from usmarthome.smartbase0 import Sbase0
from usmarthome.global0 import log
from typing import Dict, Tuple
from modules.common import modbus
from modules.common import sdm
from modules.common import lovato

import subprocess


Expand Down Expand Up @@ -448,16 +452,13 @@ def __init__(self) -> None:
print('__init__ Sllovato excuted')

def sepwattread(self) -> Tuple[int, int]:
argumentList = ['python3', self._prefixpy + 'lovato/lovato.py',
str(self.device_nummer), str(self._device_measureip),
str(self._device_measureid),
str(self._device_measureportsdm)]
try:
proc = subprocess.Popen(argumentList)
proc.communicate()
answer = self.readret()
self.newwatt = int(answer['power'])
self.newwattk = int(answer['powerc'])
# neu aus openwb 2.0
with modbus.ModbusTcpClient_(self._device_measureip, int(self._device_measureportsdm)) as tcp_client:
lov = lovato.Lovato(int(self._device_measureid), tcp_client)
_, newwatt = lov.get_power()
self.newwatt = int(newwatt)
self.newwattk = 0
except Exception as e1:
log.warning("Leistungsmessung %s %d %s Fehlermeldung: %s "
% ('Lovato ', self.device_nummer,
Expand All @@ -472,16 +473,13 @@ def __init__(self) -> None:
print('__init__ Slsdm630 excuted')

def sepwattread(self) -> Tuple[int, int]:
argumentList = ['python3', self._prefixpy + 'sdm630/sdm630.py',
str(self.device_nummer), str(self._device_measureip),
str(self._device_measureid),
str(self._device_measureportsdm)]
try:
proc = subprocess.Popen(argumentList)
proc.communicate()
answer = self.readret()
self.newwatt = int(answer['power'])
self.newwattk = int(answer['powerc'])
# neu aus openwb 2.0
with modbus.ModbusTcpClient_(self._device_measureip, int(self._device_measureportsdm)) as tcp_client:
sdm630 = sdm.Sdm630(int(self._device_measureid), tcp_client)
_, newwatt = sdm630.get_power()
self.newwatt = int(newwatt)
self.newwattk = int(sdm630.get_imported())
except Exception as e1:
log.warning("Leistungsmessung %s %d %s Fehlermeldung: %s "
% ('Sdm630 ', self.device_nummer,
Expand All @@ -496,16 +494,13 @@ def __init__(self) -> None:
print('__init__ Slsdm120 excuted')

def sepwattread(self) -> Tuple[int, int]:
argumentList = ['python3', self._prefixpy + 'sdm120/sdm120.py',
str(self.device_nummer), str(self._device_measureip),
str(self._device_measureid),
str(self._device_measureportsdm)]
try:
proc = subprocess.Popen(argumentList)
proc.communicate()
answer = self.readret()
self.newwatt = int(answer['power'])
self.newwattk = int(answer['powerc'])
# neu aus openwb 2.0
with modbus.ModbusTcpClient_(self._device_measureip, int(self._device_measureportsdm)) as tcp_client:
sdm120 = sdm.Sdm120(int(self._device_measureid), tcp_client)
_, newwatt = sdm120.get_power()
self.newwatt = int(newwatt)
self.newwattk = int(sdm120.get_imported())
except Exception as e1:
log.warning("Leistungsmessung %s %d %s Fehlermeldung: %s "
% ('Sdm120 ', self.device_nummer,
Expand Down

0 comments on commit c0790d0

Please sign in to comment.