Browse Source

[rpi] Add powerfactor and event_count decoder for HM300, HM350, HM400

Without event_count program crashes immediately in __main__.py line 233.
pull/910/head
Betacentauri 2 years ago
parent
commit
2005348f54
  1. 8
      tools/rpi/hoymiles/decoders/__init__.py

8
tools/rpi/hoymiles/decoders/__init__.py

@ -515,9 +515,17 @@ class Hm300Decode0B(StatusResponse):
""" reactive power """ """ reactive power """
return self.unpack('>H', 20)[0]/10 return self.unpack('>H', 20)[0]/10
@property @property
def powerfactor(self):
""" Powerfactor """
return self.unpack('>H', 24)[0]/1000
@property
def temperature(self): def temperature(self):
""" Inverter temperature in °C """ """ Inverter temperature in °C """
return self.unpack('>h', 26)[0]/10 return self.unpack('>h', 26)[0]/10
@property
def event_count(self):
""" Event counter """
return self.unpack('>H', 28)[0]
class Hm300Decode0C(Hm300Decode0B): class Hm300Decode0C(Hm300Decode0B):
""" 1121-series mirco-inverters status data """ """ 1121-series mirco-inverters status data """

Loading…
Cancel
Save