Browse Source

Merge pull request #563 from PaeserBastelstube/patch-1

RPi: missing reactive power (Blindleistung) - add MQTT Output
pull/572/head
Lukas Pusch 2 years ago
committed by GitHub
parent
commit
d9eaafea6b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      tools/rpi/hoymiles/__main__.py
  2. 14
      tools/rpi/hoymiles/decoders/__init__.py

1
tools/rpi/hoymiles/__main__.py

@ -219,6 +219,7 @@ def mqtt_send_status(broker, inverter_ser, data, topic=None):
broker.publish(f'{topic}/emeter/{phase_id}/power', phase['power'])
broker.publish(f'{topic}/emeter/{phase_id}/voltage', phase['voltage'])
broker.publish(f'{topic}/emeter/{phase_id}/current', phase['current'])
broker.publish(f'{topic}/emeter/{phase_id}/Q_AC', phase['reactive_power'])
phase_id = phase_id + 1
# DC Data

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

@ -91,7 +91,7 @@ class Response:
class StatusResponse(Response):
"""Inverter StatusResponse object"""
e_keys = ['voltage','current','power','energy_total','energy_daily','powerfactor']
e_keys = ['voltage','current','power','energy_total','energy_daily','powerfactor', 'reactive_power']
temperature = None
frequency = None
powerfactor = None
@ -438,6 +438,10 @@ class Hm300Decode0B(StatusResponse):
""" Grid frequency in Hertz """
return self.unpack('>H', 16)[0]/100
@property
def ac_reactive_power_0(self):
""" reactive power """
return self.unpack('>H', 20)[0]/10
@property
def temperature(self):
""" Inverter temperature in °C """
return self.unpack('>h', 26)[0]/10
@ -521,6 +525,10 @@ class Hm600Decode0B(StatusResponse):
""" Grid frequency in Hertz """
return self.unpack('>H', 28)[0]/100
@property
def ac_reactive_power_0(self):
""" reactive power """
return self.unpack('>H', 32)[0]/10
@property
def powerfactor(self):
""" Powerfactor """
return self.unpack('>H', 36)[0]/1000
@ -654,6 +662,10 @@ class Hm1200Decode0B(StatusResponse):
""" Grid frequency in Hertz """
return self.unpack('>H', 48)[0]/100
@property
def ac_reactive_power_0(self):
""" reactive power """
return self.unpack('>H', 52)[0]/10
@property
def powerfactor(self):
""" Powerfactor """
return self.unpack('>H', 56)[0]/1000

Loading…
Cancel
Save