Skip to content

Commit

Permalink
Merge pull request #438 from canton7/bugfix/inverter-power
Browse files Browse the repository at this point in the history
Let inverter power go negative
  • Loading branch information
canton7 authored Oct 15, 2023
2 parents d96dc32 + 5c02973 commit b9b0c11
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions custom_components/foxess_modbus/entities/entity_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit
icon="mdi:export",
scale=0.001,
round_to=0.01,
post_process=lambda x: max(x, 0),
validate=[Range(0, 100)],
# Negative = charging batteries
validate=[Range(-100, 100)],
),
ModbusSensorDescription(
key="rpower_Q",
Expand All @@ -376,8 +376,8 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit
icon="mdi:export",
scale=0.001,
round_to=0.01,
post_process=lambda x: max(x, 0),
validate=[Range(0, 100)],
# Negative = charging batteries
validate=[Range(-100, 100)],
),
ModbusSensorDescription(
key="rpower_S",
Expand All @@ -386,15 +386,15 @@ def _pv_energy_total(key: str, models: list[EntitySpec], name: str, source_entit
],
entity_registry_enabled_default=False,
name="Inverter Power (Apparent)",
# APPARENT_POWER only supports VA, not kVA
# APPARENT_POWER only supports VA, not kVA
# device_class=SensorDeviceClass.APPARENT_POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement="kVA",
icon="mdi:export",
scale=0.001,
round_to=0.01,
post_process=lambda x: max(x, 0),
validate=[Range(0, 100)],
# Negative = charging batteries
validate=[Range(-100, 100)],
),
ModbusSensorDescription(
key="eps_rvolt",
Expand Down

0 comments on commit b9b0c11

Please sign in to comment.