Add sensors to Wallbox (#145247)

This commit is contained in:
Joris Drenth 2025-05-20 23:02:07 +02:00 committed by GitHub
parent c60f19b35b
commit 46fe132e83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 0 deletions

View File

@ -11,6 +11,8 @@ CODE_KEY = "code"
CONF_STATION = "station"
CHARGER_ADDED_DISCHARGED_ENERGY_KEY = "added_discharged_energy"
CHARGER_ADDED_ENERGY_KEY = "added_energy"
CHARGER_ADDED_GREEN_ENERGY_KEY = "added_green_energy"
CHARGER_ADDED_GRID_ENERGY_KEY = "added_grid_energy"
CHARGER_ADDED_RANGE_KEY = "added_range"
CHARGER_CHARGING_POWER_KEY = "charging_power"
CHARGER_CHARGING_SPEED_KEY = "charging_speed"

View File

@ -27,6 +27,8 @@ from homeassistant.helpers.typing import StateType
from .const import (
CHARGER_ADDED_DISCHARGED_ENERGY_KEY,
CHARGER_ADDED_ENERGY_KEY,
CHARGER_ADDED_GREEN_ENERGY_KEY,
CHARGER_ADDED_GRID_ENERGY_KEY,
CHARGER_ADDED_RANGE_KEY,
CHARGER_CHARGING_POWER_KEY,
CHARGER_CHARGING_SPEED_KEY,
@ -99,6 +101,22 @@ SENSOR_TYPES: dict[str, WallboxSensorEntityDescription] = {
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
CHARGER_ADDED_GREEN_ENERGY_KEY: WallboxSensorEntityDescription(
key=CHARGER_ADDED_GREEN_ENERGY_KEY,
translation_key=CHARGER_ADDED_GREEN_ENERGY_KEY,
precision=2,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
CHARGER_ADDED_GRID_ENERGY_KEY: WallboxSensorEntityDescription(
key=CHARGER_ADDED_GRID_ENERGY_KEY,
translation_key=CHARGER_ADDED_GRID_ENERGY_KEY,
precision=2,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
CHARGER_ADDED_DISCHARGED_ENERGY_KEY: WallboxSensorEntityDescription(
key=CHARGER_ADDED_DISCHARGED_ENERGY_KEY,
translation_key=CHARGER_ADDED_DISCHARGED_ENERGY_KEY,

View File

@ -59,6 +59,12 @@
"added_energy": {
"name": "Added energy"
},
"added_green_energy": {
"name": "Added green energy"
},
"added_grid_energy": {
"name": "Added grid energy"
},
"added_discharged_energy": {
"name": "Discharged energy"
},