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

Commit

Permalink
Merge pull request #38 from northalpha/main
Browse files Browse the repository at this point in the history
Add sensors:
- pv/DailyYieldKwh
- global/DailyYieldHausverbrauchKwh
  • Loading branch information
a529987659852 authored Oct 31, 2022
2 parents bd8a9a2 + c383bdc commit 1d74d58
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions custom_components/openwbmqtt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):

# List of global sensors that are relevant to the entire wallbox
SENSORS_GLOBAL = [
# System
openwbSensorEntityDescription(
key="system/IpAddress",
name="IP-Adresse",
Expand Down Expand Up @@ -130,6 +131,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
entity_registry_enabled_default=False,
icon="mdi:tag-multiple-outline",
),
# Global
openwbSensorEntityDescription(
key="global/cpuModel",
name="CPU Modell",
Expand Down Expand Up @@ -203,6 +205,15 @@ class openWBNumberEntityDescription(NumberEntityDescription):
entity_registry_enabled_default=False,
icon="mdi:home-lightning-bolt-outline",
),
openwbSensorEntityDescription(
key="global/DailyYieldHausverbrauchKwh",
name="Heutiger Hausverbrauch (kWh)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda x: round(float(x), 2),
icon="mdi:counter",
),
openwbSensorEntityDescription(
key="global/WAllChargePoints",
name="Ladeleistung aller Ladepunkte",
Expand All @@ -220,6 +231,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
value_fn=lambda x: round(float(x), 2),
icon="mdi:counter",
),
# PV
openwbSensorEntityDescription(
key="pv/W",
name="PV-Leistung",
Expand All @@ -230,6 +242,26 @@ class openWBNumberEntityDescription(NumberEntityDescription):
value_fn=lambda x: round(float(x) * (-1.0)),
icon="mdi:solar-power-variant-outline",
),
openwbSensorEntityDescription(
key="pv/WhCounter",
name="PV-Gesamtertrag",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 2),
icon="mdi:counter",
),
openwbSensorEntityDescription(
key="pv/DailyYieldKwh",
name="Heutiger PV-Ertrag (kWh)",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda x: round(float(x), 2),
icon="mdi:counter",
),
# EVU
openwbSensorEntityDescription(
key="evu/W",
name="EVU-Leistung",
Expand Down Expand Up @@ -279,16 +311,6 @@ class openWBNumberEntityDescription(NumberEntityDescription):
value_fn=lambda x: round(float(x), 2),
icon="mdi:transmission-tower-import",
),
openwbSensorEntityDescription(
key="pv/WhCounter",
name="PV-Gesamtertrag",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
value_fn=lambda x: round(float(x) / 1000.0, 2),
icon="mdi:counter",
),
# Housebattery
openwbSensorEntityDescription(
key="housebattery/WhImported",
Expand Down

0 comments on commit 1d74d58

Please sign in to comment.