You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For user like me without access to real-time electricity consumption data, it's still useful to access the consumption data that the API provides out of the box. In turn, this will allow the Home Assistant sensor to be able to query and use these values.
Therefore I would suggest including the following lines after line #297 in __init__.py in the update_info() function. Sorry, I'm not good with git otherwise I'd do a pull request.
consumption(resolution: DAILY, last: 1) {
nodes {
from
to
consumption
consumptionUnit
unitPrice
unitPriceVAT
cost
totalCost
currency
}
}
Unfortunately, data are only provided only up till yesterday -- limited by Tibber. And even then, it's still not the most elegant solution, as ideally it would only need to query this once per day not every update cycle. But it does work fine at least for me and it's better than nothing...
The sensor.py in your Home Assistant Tibber component can then have the following lines added at the end of the async_update() function to display these values in the attributes.
This is probably not at all useful for people who do have real-time data. I can't judge that, but in that case you may wish to start this block with a condition if not home.has_real_time_consumption:
For user like me without access to real-time electricity consumption data, it's still useful to access the consumption data that the API provides out of the box. In turn, this will allow the Home Assistant sensor to be able to query and use these values.
Therefore I would suggest including the following lines after line #297 in
__init__.py
in the update_info() function. Sorry, I'm not good with git otherwise I'd do a pull request.Unfortunately, data are only provided only up till yesterday -- limited by Tibber. And even then, it's still not the most elegant solution, as ideally it would only need to query this once per day not every update cycle. But it does work fine at least for me and it's better than nothing...
The
sensor.py
in your Home Assistant Tibber component can then have the following lines added at the end of the async_update() function to display these values in the attributes.This is probably not at all useful for people who do have real-time data. I can't judge that, but in that case you may wish to start this block with a condition
if not home.has_real_time_consumption:
The text was updated successfully, but these errors were encountered: