Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Counter sensor properties updated for HA energy dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
a529987659852 committed May 29, 2022
1 parent f84e58c commit d9678b9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions custom_components/openwbmqtt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Netzbezug",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 1)
),
Expand All @@ -133,7 +133,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Netzeinspeisung",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 1)
),
Expand All @@ -142,7 +142,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="PV-Gesamtertrag",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 1)
),
Expand All @@ -152,7 +152,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Batteriebezug",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 1)
),
Expand All @@ -161,7 +161,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Batterieeinspeisung",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 1)
),
Expand Down Expand Up @@ -228,7 +228,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Geladene Energie (akt. Ladevorgang)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
value_fn=lambda x: round(float(x), 2),
),
Expand All @@ -237,7 +237,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Geladene Energie (seit Anstecken)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
value_fn=lambda x: round(float(x), 2),
),
Expand All @@ -246,7 +246,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Geladene Energie (heute)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL_INCREASING,
icon="mdi:counter",
value_fn=lambda x: round(float(x), 2),
),
Expand All @@ -255,7 +255,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
name="Geladene Energie (gesamt)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
state_class=SensorStateClass.TOTAL,
icon="mdi:counter",
value_fn=lambda x: round(float(x), 1),
),
Expand Down

0 comments on commit d9678b9

Please sign in to comment.