Skip to content

Commit

Permalink
feat(sma): collect total pv energy
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiga1993 committed Aug 4, 2024
1 parent 89cdce2 commit aea9c57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pollect/libs/sma/SmaModbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SmaRegisters:
REG_DC_INPUT_CURRENT = Register(30769, _ma) # 0.001A
REG_DC_INPUT_VOLTAGE = Register(30771, _hv) # 0.01V

REG_ENERGY_EFFECTIVE_SUM = Register(30513, _w) # 1Wh
REG_POWER_EFFECTIVE_SUM = Register(30775, _w) # 1W

REG_VOLTAGE_L1 = Register(30783, _hv) # 0.01V
Expand Down
3 changes: 2 additions & 1 deletion pollect/sources/SmaPvModbusSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def _probe(self) -> Optional[ValueSet] or List[ValueSet]:
base_set = ValueSet()
base_set.add(Value(self._sma.read(SmaRegisters.REG_TEMP).get_as_base_unit(), name='temp'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_FREQUENCY).get_as_base_unit(), name='frequency'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_POWER_EFFECTIVE_SUM).get_as_base_unit(), name='power'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_POWER_EFFECTIVE_SUM).get_as_base_unit(), name='energy'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_ENERGY_EFFECTIVE_SUM).get_as_base_unit(), name='power'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_DC_INPUT_VOLTAGE).get_as_base_unit(), name='dc_voltage'))
base_set.add(Value(self._sma.read(SmaRegisters.REG_DC_INPUT_CURRENT).get_as_base_unit(), name='dc_current'))

Expand Down

0 comments on commit aea9c57

Please sign in to comment.