From c7f21c347f2a985adae5ef6d7f9d5efc2823ffaa Mon Sep 17 00:00:00 2001 From: marq24 Date: Tue, 3 Sep 2024 17:27:51 +0200 Subject: [PATCH] remove country from hacs.json def state -> def native_value --- custom_components/senec/const.py | 334 +++++++++++++++++++++----- custom_components/senec/manifest.json | 2 +- custom_components/senec/number.py | 2 +- custom_components/senec/sensor.py | 40 ++- hacs.json | 3 - 5 files changed, 299 insertions(+), 82 deletions(-) diff --git a/custom_components/senec/const.py b/custom_components/senec/const.py index 37e1b42..dad4eed 100644 --- a/custom_components/senec/const.py +++ b/custom_components/senec/const.py @@ -174,6 +174,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="consumption_total", name="House consumed", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-import-outline", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -183,6 +184,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="powergenerated_total", name="Solar generated", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:solar-power", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -192,6 +194,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="accuimport_total", name="Battery discharged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-battery-outline", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -201,6 +204,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="accuexport_total", name="Battery charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-battery", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -210,6 +214,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridimport_total", name="Grid Imported", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:transmission-tower-export", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -219,6 +224,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridexport_total", name="Grid Exported", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:transmission-tower-import", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL, @@ -236,42 +242,43 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="powergenerated_now", name="Solar Generated Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:solar-power", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="consumption_now", name="House Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:home-import-outline", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="accuimport_now", name="Battery Discharge Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:home-battery", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="accuexport_now", name="Battery Charge Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:home-battery-outline", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="acculevel_now", name="Battery Charge Percent", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:home-battery", # device_class=SensorDeviceClass.BATTERY, state_class=SensorStateClass.MEASUREMENT, @@ -280,18 +287,18 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridimport_now", name="Grid Imported Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:transmission-tower-export", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="gridexport_now", name="Grid Exported Power", native_unit_of_measurement=UnitOfPower.KILO_WATT, + suggested_display_precision=3, icon="mdi:transmission-tower-import", device_class=SensorDeviceClass.POWER, - suggested_display_precision=3, state_class=SensorStateClass.MEASUREMENT, ), # Peak Shaving @@ -300,9 +307,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridexport_limit", name="Grid Exported Limit", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:transmission-tower-off", device_class=SensorDeviceClass.POWER_FACTOR, - suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -318,9 +325,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="peakshaving_capacitylimit", name="Peak Shaving Capacity Limit", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:battery-lock", device_class=SensorDeviceClass.BATTERY, - suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -341,6 +348,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="case_temp", name="Case Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -348,16 +356,18 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_state_current", name="Battery State Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="battery_state_voltage", name="Battery State Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:home-battery", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -371,6 +381,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_temp", name="Battery Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -379,6 +390,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_temp_max", name="Battery max Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -386,6 +398,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_soh_remaining_capacity", name="Battery remaining capacity", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:home-battery", entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT @@ -449,6 +462,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_a", name="battery_module_temperature_avg_a", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -459,6 +473,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_b", name="battery_module_temperature_avg_b", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -469,6 +484,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_c", name="battery_module_temperature_avg_c", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -479,6 +495,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_d", name="battery_module_temperature_avg_d", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -489,6 +506,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_e", name="battery_module_temperature_avg_e", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -499,6 +517,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_avg_f", name="battery_module_temperature_avg_f", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -509,6 +528,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_a", name="battery_module_temperature_min_a", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -519,6 +539,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_b", name="battery_module_temperature_min_b", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -529,6 +550,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_c", name="battery_module_temperature_min_c", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -539,6 +561,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_d", name="battery_module_temperature_min_d", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -549,6 +572,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_e", name="battery_module_temperature_min_e", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -559,6 +583,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_min_f", name="battery_module_temperature_min_f", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -569,6 +594,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_a", name="battery_module_temperature_max_a", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -579,6 +605,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_b", name="battery_module_temperature_max_b", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -589,6 +616,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_c", name="battery_module_temperature_max_c", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -599,6 +627,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_d", name="battery_module_temperature_max_d", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -609,6 +638,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_e", name="battery_module_temperature_max_e", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -619,6 +649,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_module_temperature_max_f", name="battery_module_temperature_max_f", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -653,8 +684,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ac_voltage", name="AC Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -662,8 +694,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ac_current", name="AC Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -671,6 +704,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ac_power", name="AC Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:solar-power", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -680,6 +714,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ac_power_fast", name="AC Power (fast)", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:solar-power", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -689,6 +724,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ac_frequency", name="AC Frequency", native_unit_of_measurement=UnitOfFrequency.HERTZ, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.FREQUENCY, state_class=SensorStateClass.MEASUREMENT, @@ -699,8 +735,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_bat_voltage", name="BDC Battery Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -709,8 +746,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_bat_current", name="BDC Battery Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -719,6 +757,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_bat_power", name="BDC Battery Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:battery-charging-100", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -729,8 +768,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_link_voltage", name="BDC Link Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -739,8 +779,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_link_current", name="BDC Link Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -749,6 +790,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="bdc_link_power", name="BDC Link Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:power-plug-outline", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -758,24 +800,27 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="dc_voltage1", name="DC Voltage 1", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="dc_voltage2", name="DC Voltage 2", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="dc_current1", name="DC Current 1", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -783,8 +828,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="dc_current2", name="DC Current 2", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -793,6 +839,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridpower", name="Grid Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -802,6 +849,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridconsumedpower", name="Grid consumed Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower-import", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -811,6 +859,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="gridinjectedpower", name="Grid injected Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower-export", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -820,6 +869,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="ownconsumedpower", name="Own consumed Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:home-import-outline", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -828,6 +878,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="derating", name="Derating", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:arrow-down-thin-circle-outline", state_class=SensorStateClass.MEASUREMENT, ), @@ -1465,6 +1516,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_temp", name="Battery Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=2, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -1472,6 +1524,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="case_temp", name="Case Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=2, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -1479,6 +1532,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="mcu_temp", name="Controller Temperature", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=2, icon="mdi:thermometer", entity_category=EntityCategory.DIAGNOSTIC, ), @@ -1486,6 +1540,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="solar_generated_power", name="Solar Generated Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:solar-power", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1494,6 +1549,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="house_power", name="House Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:home-import-outline", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1502,6 +1558,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_state_power", name="Battery State Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:home-battery", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1510,22 +1567,25 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_state_current", name="Battery State Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="battery_state_voltage", name="Battery State Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:home-battery", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="battery_charge_power", name="Battery Charge Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:home-battery", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1534,6 +1594,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_discharge_power", name="Battery Discharge Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:home-battery-outline", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1542,6 +1603,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="battery_charge_percent", name="Battery Charge Percent", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, icon="mdi:home-battery", # device_class=SensorDeviceClass.BATTERY, state_class=SensorStateClass.MEASUREMENT, @@ -1550,6 +1612,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="grid_state_power", name="Grid State Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1558,6 +1621,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="grid_imported_power", name="Grid Imported Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower-export", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1566,6 +1630,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="grid_exported_power", name="Grid Exported Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:transmission-tower-import", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1575,6 +1640,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="House consumed", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-import-outline", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1584,6 +1650,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="Solar generated", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:solar-power", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1593,6 +1660,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="Battery charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-battery", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1602,6 +1670,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="Battery discharged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:home-battery-outline", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1611,6 +1680,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="Grid Imported", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:transmission-tower-export", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1620,6 +1690,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): controls=("require_stats_fields"), name="Grid Exported", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:transmission-tower-import", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -1628,22 +1699,25 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="solar_mpp1_potential", name="MPP1 Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp1_current", name="MPP1 Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp1_power", name="MPP1 Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1652,22 +1726,25 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="solar_mpp2_potential", name="MPP2 Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp2_current", name="MPP2 Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp2_power", name="MPP2 Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1676,22 +1753,25 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="solar_mpp3_potential", name="MPP3 Voltage", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp3_current", name="MPP3 Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="solar_mpp3_power", name="MPP3 Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1700,6 +1780,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_net_freq", name="Enfluri Net Frequency", native_unit_of_measurement=UnitOfFrequency.HERTZ, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.FREQUENCY, state_class=SensorStateClass.MEASUREMENT, @@ -1708,6 +1789,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_net_power_total", name="Enfluri Net Total Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1716,54 +1798,61 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_net_potential_p1", name="Enfluri Net Voltage Phase 1", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_potential_p2", name="Enfluri Net Voltage Phase 2", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_potential_p3", name="Enfluri Net Voltage Phase 3", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_current_p1", name="Enfluri Net Current Phase 1", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_current_p2", name="Enfluri Net Current Phase 2", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_current_p3", name="Enfluri Net Current Phase 3", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( key="enfluri_net_power_p1", name="Enfluri Net Power Phase 1", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1772,6 +1861,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_net_power_p2", name="Enfluri Net Power Phase 2", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1780,6 +1870,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_net_power_p3", name="Enfluri Net Power Phase 3", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1789,6 +1880,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_freq", name="Enfluri Usage Frequency", native_unit_of_measurement=UnitOfFrequency.HERTZ, + suggested_display_precision=3, icon="mdi:meter-electric", device_class=SensorDeviceClass.FREQUENCY, state_class=SensorStateClass.MEASUREMENT, @@ -1798,6 +1890,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_power_total", name="Enfluri Usage Total Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1807,8 +1900,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_potential_p1", name="Enfluri Usage Voltage Phase 1", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1816,8 +1910,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_potential_p2", name="Enfluri Usage Voltage Phase 2", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1825,8 +1920,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_potential_p3", name="Enfluri Usage Voltage Phase 3", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, icon="mdi:lightning-bolt", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1834,8 +1930,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_current_p1", name="Enfluri Usage Current Phase 1", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1843,8 +1940,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_current_p2", name="Enfluri Usage Current Phase 2", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1852,8 +1950,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_current_p3", name="Enfluri Usage Current Phase 3", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-ac", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -1861,6 +1960,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_power_p1", name="Enfluri Usage Power Phase 1", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1870,6 +1970,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_power_p2", name="Enfluri Usage Power Phase 2", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1879,6 +1980,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="enfluri_usage_power_p3", name="Enfluri Usage Power Phase 3", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:meter-electric", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -1890,6 +1992,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A1", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1901,6 +2004,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A2", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1912,6 +2016,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A3", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1923,6 +2028,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A4", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1934,6 +2040,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A5", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1945,6 +2052,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Temperature A6", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1956,6 +2064,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B1", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1967,6 +2076,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B2", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1978,6 +2088,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B3", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -1989,6 +2100,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B4", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2000,6 +2112,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B5", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2011,6 +2124,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Temperature B6", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2022,6 +2136,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C1", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2033,6 +2148,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C2", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2044,6 +2160,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C3", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2055,6 +2172,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C4", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2066,6 +2184,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C5", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2077,6 +2196,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Temperature C6", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2088,6 +2208,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D1", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2099,6 +2220,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D2", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2110,6 +2232,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D3", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2121,6 +2244,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D4", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2132,6 +2256,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D5", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2143,6 +2268,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Temperature D6", icon="mdi:thermometer", native_unit_of_measurement=UnitOfTemperature.CELSIUS, + suggested_display_precision=1, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -2155,6 +2281,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A1", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2165,6 +2292,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A2", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2175,6 +2303,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A3", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2185,6 +2314,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A4", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2195,6 +2325,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A5", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2205,6 +2336,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A6", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2215,6 +2347,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A7", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2225,6 +2358,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A8", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2235,6 +2369,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A9", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2245,6 +2380,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A10", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2255,6 +2391,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A11", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2265,6 +2402,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A12", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2275,6 +2413,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A13", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2285,6 +2424,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Cell Voltage A14", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2295,6 +2435,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B1", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2305,6 +2446,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B2", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2315,6 +2457,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B3", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2325,6 +2468,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B4", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2335,6 +2479,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B5", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2345,6 +2490,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B6", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2355,6 +2501,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B7", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2365,6 +2512,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B8", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2375,6 +2523,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B9", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2385,6 +2534,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B10", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2395,6 +2545,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B11", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2405,6 +2556,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B12", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2415,6 +2567,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B13", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2425,6 +2578,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Cell Voltage B14", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2435,6 +2589,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C1", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2445,6 +2600,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C2", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2455,6 +2611,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C3", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2465,6 +2622,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C4", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2475,6 +2633,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C5", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2485,6 +2644,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C6", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2495,6 +2655,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C7", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2505,6 +2666,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C8", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2515,6 +2677,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C9", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2525,6 +2688,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C10", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2535,6 +2699,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C11", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2545,6 +2710,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C12", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2555,6 +2721,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C13", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2565,6 +2732,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Cell Voltage C14", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2575,6 +2743,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D1", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2585,6 +2754,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D2", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2595,6 +2765,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D3", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2605,6 +2776,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D4", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2615,6 +2787,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D5", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2625,6 +2798,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D6", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2635,6 +2809,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D7", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2645,6 +2820,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D8", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2655,6 +2831,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D9", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2665,6 +2842,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D10", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2675,6 +2853,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D11", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2685,6 +2864,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D12", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2695,6 +2875,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D13", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2705,6 +2886,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Cell Voltage D14", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2715,6 +2897,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Voltage", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2724,6 +2907,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Voltage", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2733,6 +2917,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Voltage", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2742,6 +2927,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Voltage", icon="mdi:lightning-bolt", native_unit_of_measurement=UnitOfElectricPotential.VOLT, + suggested_display_precision=2, device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, ), @@ -2752,6 +2938,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: Current", icon="mdi:current-dc", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -2761,6 +2948,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: Current", icon="mdi:current-dc", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -2770,6 +2958,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: Current", icon="mdi:current-dc", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -2779,6 +2968,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: Current", icon="mdi:current-dc", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -2789,6 +2979,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: State of charge", icon="mdi:battery-charging-high", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2797,6 +2988,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: State of charge", icon="mdi:battery-charging-high", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2805,6 +2997,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: State of charge", icon="mdi:battery-charging-high", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2813,6 +3006,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: State of charge", icon="mdi:battery-charging-high", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), @@ -2823,6 +3017,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module A: State of Health", icon="mdi:battery-heart-variant", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2832,6 +3027,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module B: State of Health", icon="mdi:battery-heart-variant", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2841,6 +3037,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module C: State of Health", icon="mdi:battery-heart-variant", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2850,6 +3047,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): name="Module D: State of Health", icon="mdi:battery-heart-variant", native_unit_of_measurement=PERCENTAGE, + suggested_display_precision=0, state_class=SensorStateClass.MEASUREMENT, ), @@ -2904,6 +3102,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_power", name="Wallbox I Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:car-arrow-left", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -2922,6 +3121,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_energy", name="Wallbox I charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:ev-station", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -2932,8 +3132,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_l1_charging_current", name="Wallbox I L1 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2942,8 +3143,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_l2_charging_current", name="Wallbox I L2 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2952,8 +3154,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_l3_charging_current", name="Wallbox I L3 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -2962,8 +3165,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_1_min_charging_current", name="Wallbox I MIN charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -2980,6 +3184,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_power", name="Wallbox II Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:car-arrow-left", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -2998,6 +3203,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_energy", name="Wallbox II charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:ev-station", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -3008,8 +3214,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_l1_charging_current", name="Wallbox II L1 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3018,8 +3225,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_l2_charging_current", name="Wallbox II L2 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3028,8 +3236,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_l3_charging_current", name="Wallbox II L3 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3038,8 +3247,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_2_min_charging_current", name="Wallbox II MIN charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -3056,6 +3266,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_power", name="Wallbox III Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:car-arrow-left", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -3074,6 +3285,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_energy", name="Wallbox III charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:ev-station", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -3084,8 +3296,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_l1_charging_current", name="Wallbox III L1 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3094,8 +3307,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_l2_charging_current", name="Wallbox III L2 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3104,8 +3318,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_l3_charging_current", name="Wallbox III L3 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3114,8 +3329,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_3_min_charging_current", name="Wallbox III MIN charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), @@ -3132,6 +3348,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_power", name="Wallbox IV Power", native_unit_of_measurement=UnitOfPower.WATT, + suggested_display_precision=2, icon="mdi:car-arrow-left", device_class=SensorDeviceClass.POWER, state_class=SensorStateClass.MEASUREMENT, @@ -3150,6 +3367,7 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_energy", name="Wallbox IV charged", native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, + suggested_display_precision=3, icon="mdi:ev-station", device_class=SensorDeviceClass.ENERGY, state_class=SensorStateClass.TOTAL_INCREASING, @@ -3160,8 +3378,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_l1_charging_current", name="Wallbox IV L1 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3170,8 +3389,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_l2_charging_current", name="Wallbox IV L2 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3180,8 +3400,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_l3_charging_current", name="Wallbox IV L3 charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), ExtSensorEntityDescription( @@ -3190,8 +3411,9 @@ class ExtNumberEntityDescription(NumberEntityDescription): key="wallbox_4_min_charging_current", name="Wallbox IV MIN charging Current", native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, + suggested_display_precision=2, icon="mdi:current-dc", - device_class=SensorDeviceClass.ENERGY, + device_class=SensorDeviceClass.CURRENT, state_class=SensorStateClass.MEASUREMENT, ), diff --git a/custom_components/senec/manifest.json b/custom_components/senec/manifest.json index 2fb53f1..0c85fb6 100644 --- a/custom_components/senec/manifest.json +++ b/custom_components/senec/manifest.json @@ -13,5 +13,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/marq24/ha-senec-v3/issues", "requirements": ["xmltodict>=0.12.0", "packaging>=21.0", "python-dateutil>=2.8.0"], - "version": "2024.8.5" + "version": "2024.9.0" } diff --git a/custom_components/senec/number.py b/custom_components/senec/number.py index ad8e10e..9fd431d 100644 --- a/custom_components/senec/number.py +++ b/custom_components/senec/number.py @@ -79,7 +79,7 @@ def _internal_check_minmax_adjustment(self): _LOGGER.error(f"Could not fetch min/max values for '{self.entity_description.key}' - cause: {err}") @property - def state(self) -> float: + def native_value(self) -> float: if self.entity_description.array_key is not None: data = getattr(self.coordinator.senec, self.entity_description.array_key) if data is not None and len(data) > self.entity_description.array_pos: diff --git a/custom_components/senec/sensor.py b/custom_components/senec/sensor.py index 5e0f34a..c2930d8 100644 --- a/custom_components/senec/sensor.py +++ b/custom_components/senec/sensor.py @@ -97,7 +97,7 @@ def __init__( description, "controls") and description.controls is not None and "only_increasing" in description.controls @property - def state(self): + def native_value(self): """Return the current state.""" if self.entity_description.array_key is not None: data = getattr(self.coordinator.senec, self.entity_description.array_key) @@ -111,28 +111,26 @@ def state(self): # _LOGGER.debug( str(sensor)+' '+ str(type(value)) +' '+str(value)) if isinstance(value, bool): return value - - if isinstance(value, int): - return value - - # always try to parse sensor value as float - try: - value = round(float(value), 2) - except (ValueError, TypeError): + elif isinstance(value, int): return value - - # do not update if value is lower than current state - # this is only an issue for _total sensors - # since the API may return false values in this case - if not self._is_total_increasing: - return value - elif (self._previous_float_value is not None) and (value < self._previous_float_value): - _LOGGER.debug( - f"Thanks for nothing Senec! prev>new for key {self._attr_translation_key} - prev:{self._previous_float_value} new: {value}") - return self._previous_float_value else: - self._previous_float_value = value - return value + # always try to parse sensor value as float + try: + value = float(value) + except (ValueError, TypeError): + return value + + # do not update if value is lower than current state + # this is only an issue for _total sensors + # since the API may return false values in this case + if not self._is_total_increasing: + return value + elif (self._previous_float_value is not None) and (value < self._previous_float_value): + _LOGGER.debug(f"Thanks for nothing Senec! prev>new for key {self._attr_translation_key} - prev:{self._previous_float_value} new: {value}") + return self._previous_float_value + else: + self._previous_float_value = value + return value async def async_added_to_hass(self) -> None: """Call when entity about to be added to Home Assistant.""" diff --git a/hacs.json b/hacs.json index 609f96d..787d4b8 100644 --- a/hacs.json +++ b/hacs.json @@ -1,8 +1,5 @@ { "name": "SENEC.Home V2.x/V3/V4 Systems", - "country": [ - "ALL" - ], "homeassistant": "2023.6.0", "hacs": "1.18.0", "render_readme": true