mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Add battery discharge sensor to ViCare integration (#113502)
Co-authored-by: jan iversen <jancasacondor@gmail.com>
This commit is contained in:
parent
219cb7a788
commit
1ffc514528
@ -620,6 +620,45 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
|||||||
options=["charge", "discharge", "standby"],
|
options=["charge", "discharge", "standby"],
|
||||||
value_getter=lambda api: api.getElectricalEnergySystemOperationState(),
|
value_getter=lambda api: api.getElectricalEnergySystemOperationState(),
|
||||||
),
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="ess_discharge_today",
|
||||||
|
translation_key="ess_discharge_today",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
value_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedCurrentDay(),
|
||||||
|
unit_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedUnit(),
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="ess_discharge_this_week",
|
||||||
|
translation_key="ess_discharge_this_week",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
value_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedCurrentWeek(),
|
||||||
|
unit_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedUnit(),
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="ess_discharge_this_month",
|
||||||
|
translation_key="ess_discharge_this_month",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
value_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedCurrentMonth(),
|
||||||
|
unit_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedUnit(),
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="ess_discharge_this_year",
|
||||||
|
translation_key="ess_discharge_this_year",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
value_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedCurrentYear(),
|
||||||
|
unit_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedUnit(),
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
),
|
||||||
|
ViCareSensorEntityDescription(
|
||||||
|
key="ess_discharge_total",
|
||||||
|
translation_key="ess_discharge_total",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
value_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedLifeCycle(),
|
||||||
|
unit_getter=lambda api: api.getElectricalEnergySystemTransferDischargeCumulatedUnit(),
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
),
|
||||||
ViCareSensorEntityDescription(
|
ViCareSensorEntityDescription(
|
||||||
key="pcc_transfer_power_exchange",
|
key="pcc_transfer_power_exchange",
|
||||||
translation_key="pcc_transfer_power_exchange",
|
translation_key="pcc_transfer_power_exchange",
|
||||||
|
@ -286,6 +286,21 @@
|
|||||||
"standby": "Standby"
|
"standby": "Standby"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ess_discharge_today": {
|
||||||
|
"name": "Battery discharge today"
|
||||||
|
},
|
||||||
|
"ess_discharge_this_week": {
|
||||||
|
"name": "Battery discharge this week"
|
||||||
|
},
|
||||||
|
"ess_discharge_this_month": {
|
||||||
|
"name": "Battery discharge this month"
|
||||||
|
},
|
||||||
|
"ess_discharge_this_year": {
|
||||||
|
"name": "Battery discharge this year"
|
||||||
|
},
|
||||||
|
"ess_discharge_total": {
|
||||||
|
"name": "Battery discharge total"
|
||||||
|
},
|
||||||
"pcc_current_power_exchange": {
|
"pcc_current_power_exchange": {
|
||||||
"name": "Grid power exchange"
|
"name": "Grid power exchange"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user