Add more sensors for users with Tibber Pulse (#66201)

* Tibber, Add stats and sensors for homes with real time meter

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tibber stats

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Monthly peak hour
This commit is contained in:
Daniel Hjelseth Høyer 2022-02-10 08:47:34 +01:00 committed by GitHub
parent 72acda81a7
commit 3733aa9494
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -3,7 +3,7 @@
"domain": "tibber",
"name": "Tibber",
"documentation": "https://www.home-assistant.io/integrations/tibber",
"requirements": ["pyTibber==0.21.7"],
"requirements": ["pyTibber==0.22.1"],
"codeowners": ["@danielhiversen"],
"quality_scale": "silver",
"config_flow": true,

View file

@ -210,7 +210,7 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key="peak_hour",
name="Month peak hour consumption",
name="Monthly peak hour consumption",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
),
@ -253,17 +253,17 @@ async def async_setup_entry(
if home.has_active_subscription:
entities.append(TibberSensorElPrice(home))
if coordinator is None:
coordinator = TibberDataCoordinator(hass, tibber_connection)
for entity_description in SENSORS:
entities.append(TibberDataSensor(home, coordinator, entity_description))
if home.has_real_time_consumption:
await home.rt_subscribe(
TibberRtDataCoordinator(
async_add_entities, home, hass
).async_set_updated_data
)
if home.has_active_subscription and not home.has_real_time_consumption:
if coordinator is None:
coordinator = TibberDataCoordinator(hass, tibber_connection)
for entity_description in SENSORS:
entities.append(TibberDataSensor(home, coordinator, entity_description))
# migrate
old_id = home.info["viewer"]["home"]["meteringPointData"]["consumptionEan"]
@ -547,7 +547,7 @@ class TibberDataCoordinator(update_coordinator.DataUpdateCoordinator):
hass,
_LOGGER,
name=f"Tibber {tibber_connection.name}",
update_interval=timedelta(hours=1),
update_interval=timedelta(minutes=20),
)
self._tibber_connection = tibber_connection

View file

@ -1362,7 +1362,7 @@ pyRFXtrx==0.27.1
# pySwitchmate==0.4.6
# homeassistant.components.tibber
pyTibber==0.21.7
pyTibber==0.22.1
# homeassistant.components.dlink
pyW215==0.7.0

View file

@ -854,7 +854,7 @@ pyMetno==0.9.0
pyRFXtrx==0.27.1
# homeassistant.components.tibber
pyTibber==0.21.7
pyTibber==0.22.1
# homeassistant.components.nextbus
py_nextbusnext==0.1.5