Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion custom_components/checkwatt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, UnitOfEnergy
from homeassistant.const import PERCENTAGE, UnitOfEnergy, UnitOfPower
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down Expand Up @@ -149,6 +149,33 @@
state_class=SensorStateClass.TOTAL_INCREASING,
translation_key="export_sensor",
),
"solar_power": SensorEntityDescription(
key="solar_power",
name="Current Solar Production",
icon="mdi:solar-power-variant-outline",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
state_class=SensorStateClass.MEASUREMENT,
translation_key="solar_power_sensor",
),
"battery_power": SensorEntityDescription(
key="battery_power",
name="Current Battery Power",
icon="mdi:home-battery",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
state_class=SensorStateClass.MEASUREMENT,
translation_key="battery_power_sensor",
),
"grid_power": SensorEntityDescription(
key="grid_power",
name="Current Grid Power",
icon="mdi:transmission-tower-export",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfPower.KILO_WATT,
state_class=SensorStateClass.MEASUREMENT,
translation_key="grid_power_sensor",
),
}


Expand Down
9 changes: 9 additions & 0 deletions custom_components/checkwatt/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@
"export_sensor": {
"name": "Export Energy"
},
"solar_power_sensor": {
"name": "Current Solar Production"
},
"battery_power_sensor": {
"name": "Current Battery Power"
},
"grid_power_sensor": {
"name": "Current Grid Power"
},
"spot_price_sensor": {
"name": "Spot Price",
"state_attributes": {
Expand Down
9 changes: 9 additions & 0 deletions custom_components/checkwatt/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@
"export_sensor": {
"name": "Exporterad Energi"
},
"solar_power_sensor": {
"name": "Aktuell solenergi produktion"
},
"battery_power_sensor": {
"name": "Aktuell batteri effekt"
},
"grid_power_sensor": {
"name": "Aktuell nät effekt"
},
"spot_price_sensor": {
"name": "Spotpris",
"state_attributes": {
Expand Down