Add HomeWizard battery group target power sensor (#172243)

This commit is contained in:
Duco Sebel
2026-05-26 11:50:51 +02:00
committed by GitHub
parent 67e4f04f09
commit 2d54070cab
4 changed files with 8790 additions and 4532 deletions
@@ -632,6 +632,19 @@ SENSORS: Final[tuple[HomeWizardSensorEntityDescription, ...]] = (
has_fn=lambda data: data.measurement.cycles is not None,
value_fn=lambda data: data.measurement.cycles,
),
HomeWizardSensorEntityDescription(
key="battery_group_target_power_w",
translation_key="battery_group_target_power_w",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=0,
entity_registry_enabled_default=False,
has_fn=lambda data: data.batteries is not None,
value_fn=lambda data: (
data.batteries.target_power_w if data.batteries is not None else None
),
),
HomeWizardSensorEntityDescription(
key="uptime",
translation_key="uptime",
@@ -106,6 +106,9 @@
"any_power_fail_count": {
"name": "Power failures detected"
},
"battery_group_target_power_w": {
"name": "Battery group target power"
},
"cycles": {
"name": "Battery cycles"
},
File diff suppressed because it is too large Load Diff
@@ -29,6 +29,57 @@ pytestmark = [
"HWE-P1",
[
"sensor.device_average_demand",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
"sensor.device_dsmr_version",
"sensor.device_energy_export_tariff_1",
"sensor.device_energy_export_tariff_2",
"sensor.device_energy_export_tariff_3",
"sensor.device_energy_export_tariff_4",
"sensor.device_energy_export",
"sensor.device_energy_import_tariff_1",
"sensor.device_energy_import_tariff_2",
"sensor.device_energy_import_tariff_3",
"sensor.device_energy_import_tariff_4",
"sensor.device_energy_import",
"sensor.device_frequency",
"sensor.device_long_power_failures_detected",
"sensor.device_peak_demand_current_month",
"sensor.device_power_failures_detected",
"sensor.device_power_phase_1",
"sensor.device_power_phase_2",
"sensor.device_power_phase_3",
"sensor.device_power",
"sensor.device_smart_meter_identifier",
"sensor.device_smart_meter_model",
"sensor.device_tariff",
"sensor.device_total_water_usage",
"sensor.device_voltage_phase_1",
"sensor.device_voltage_phase_2",
"sensor.device_voltage_phase_3",
"sensor.device_voltage_sags_detected_phase_1",
"sensor.device_voltage_sags_detected_phase_2",
"sensor.device_voltage_sags_detected_phase_3",
"sensor.device_voltage_swells_detected_phase_1",
"sensor.device_voltage_swells_detected_phase_2",
"sensor.device_voltage_swells_detected_phase_3",
"sensor.device_water_usage",
"sensor.device_wi_fi_ssid",
"sensor.device_wi_fi_strength",
"sensor.gas_meter_gas",
"sensor.heat_meter_energy",
"sensor.inlet_heat_meter",
"sensor.warm_water_meter_water",
"sensor.water_meter_water",
],
),
(
"HWE-P1-predictive",
[
"sensor.device_average_demand",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -346,6 +397,35 @@ async def test_sensors(
(
"HWE-P1",
[
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
"sensor.device_frequency",
"sensor.device_voltage_phase_1",
"sensor.device_voltage_phase_2",
"sensor.device_voltage_phase_3",
"sensor.device_wi_fi_strength",
],
),
(
"HWE-P1-predictive",
[
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
"sensor.device_frequency",
"sensor.device_voltage_phase_1",
"sensor.device_voltage_phase_2",
"sensor.device_voltage_phase_3",
"sensor.device_wi_fi_strength",
],
),
(
"HWE-P1-no-batteries",
[
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -530,6 +610,7 @@ async def test_external_sensors_unreachable(
"sensor.device_apparent_power",
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -585,6 +666,7 @@ async def test_external_sensors_unreachable(
"sensor.device_apparent_power_phase_3",
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -636,6 +718,7 @@ async def test_external_sensors_unreachable(
"sensor.device_apparent_power",
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -694,6 +777,7 @@ async def test_external_sensors_unreachable(
"sensor.device_average_demand",
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -742,6 +826,7 @@ async def test_external_sensors_unreachable(
[
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -787,6 +872,7 @@ async def test_external_sensors_unreachable(
"sensor.device_average_demand",
"sensor.device_average_demand",
"sensor.device_battery_cycles",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",
@@ -834,6 +920,7 @@ async def test_external_sensors_unreachable(
"HWE-KWH3",
[
"sensor.device_average_demand",
"sensor.device_battery_group_target_power",
"sensor.device_battery_cycles",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
@@ -879,6 +966,7 @@ async def test_external_sensors_unreachable(
"sensor.device_apparent_power_phase_3",
"sensor.device_apparent_power",
"sensor.device_average_demand",
"sensor.device_battery_group_target_power",
"sensor.device_current_phase_1",
"sensor.device_current_phase_2",
"sensor.device_current_phase_3",