|
2 | 2 |
|
3 | 3 | The Tibber Binding retrieves `prices` from the [Tibber API](https://developer.tibber.com). |
4 | 4 | If you have Tibber Pulse hardware, you can also use the [live group](#live-group) and [statistics group](#statistics-group). |
| 5 | +Historical energy data (consumption, cost, and production) is available in the [history group](#history-group) for all users. |
5 | 6 |
|
6 | 7 | ## Supported Things |
7 | 8 |
|
@@ -124,6 +125,49 @@ All values are read-only. |
124 | 125 | | daily-production | Number:Energy | Net energy produced since midnight in kilowatt-hours | |
125 | 126 | | last-hour-production | Number:Energy | Net energy produced since last hour shift in kilowatt-hours | |
126 | 127 |
|
| 128 | +### `history` group |
| 129 | + |
| 130 | +Historical energy consumption, cost, and production delivered as time series. |
| 131 | +All values are read-only. |
| 132 | + |
| 133 | +The Tibber API only returns **completed** periods — for example, an annual query run in May 2026 returns data up to end of 2025. |
| 134 | +The binding automatically fills the gap for the current incomplete period by aggregating data bottom-up: |
| 135 | +daily entries are summed into the current week, weekly entries into the current month, and monthly entries into the current year. |
| 136 | +These synthetic entries are transient and will be replaced by real API data once the period closes. |
| 137 | + |
| 138 | +| Channel ID | Type | Description | Time Series | |
| 139 | +|---------------------|-----------------|--------------------------------------|-------------| |
| 140 | +| yearly-consumption | Number:Energy | Yearly energy consumption | yes | |
| 141 | +| yearly-cost | Number:Currency | Yearly energy costs | yes | |
| 142 | +| yearly-production | Number:Energy | Yearly energy production | yes | |
| 143 | +| monthly-consumption | Number:Energy | Monthly energy consumption | yes | |
| 144 | +| monthly-cost | Number:Currency | Monthly energy costs | yes | |
| 145 | +| monthly-production | Number:Energy | Monthly energy production | yes | |
| 146 | +| weekly-consumption | Number:Energy | Weekly energy consumption | yes | |
| 147 | +| weekly-cost | Number:Currency | Weekly energy costs | yes | |
| 148 | +| weekly-production | Number:Energy | Weekly energy production | yes | |
| 149 | +| daily-consumption | Number:Energy | Daily energy consumption | yes | |
| 150 | +| daily-cost | Number:Currency | Daily energy costs | yes | |
| 151 | +| daily-production | Number:Energy | Daily energy production | yes | |
| 152 | + |
| 153 | +#### Persistence Requirement |
| 154 | + |
| 155 | +History channels deliver data as time series, which is not supported by the default [rrd4j](https://www.openhab.org/addons/persistence/rrd4j/) persistence. |
| 156 | +Items linked to history channels **must** be configured with a persistence service that supports time series, such as [InfluxDB](https://www.openhab.org/addons/persistence/influxdb/) or [InMemory](https://www.openhab.org/addons/persistence/inmemory/). |
| 157 | +Without a compatible persistence service, history data will not be stored correctly. |
| 158 | + |
| 159 | +#### Initial Fetch on Item Link |
| 160 | + |
| 161 | +When a new item is linked to a history channel, the binding performs an **initial fetch for one time window only** — for example, the last year for yearly channels or the last month for monthly channels. |
| 162 | +This keeps the startup load low and avoids requesting the entire available history from the Tibber API at once. |
| 163 | + |
| 164 | +To populate the full available history (all years, months, weeks, or days), trigger the [`fetchHistory`](#fetchhistory) Thing Action manually after linking the item. |
| 165 | + |
| 166 | +#### Automatic Refresh |
| 167 | + |
| 168 | +Once an item is linked, history data is refreshed automatically once per day at 01:00. |
| 169 | +A full re-fetch for any time window can also be triggered at any time via the [`fetchHistory`](#fetchhistory) Thing Action. |
| 170 | + |
127 | 171 | ## Thing Actions |
128 | 172 |
|
129 | 173 | Thing actions can be used to perform calculations on the currently available price information cached by the binding. |
@@ -439,6 +483,32 @@ JSON Object `scheduleEntry` |
439 | 483 | } |
440 | 484 | ``` |
441 | 485 |
|
| 486 | +### `fetchHistory` |
| 487 | + |
| 488 | +Triggers a full history fetch for a specific time window and stores the result persistently. |
| 489 | +Use this action to manually refresh history data, for example after the binding has been offline for an extended period. |
| 490 | + |
| 491 | +#### Parameters |
| 492 | + |
| 493 | +| Name | Type | Description | Required | |
| 494 | +|--------|--------|-----------------------------------------------------|----------| |
| 495 | +| window | String | Time window to fetch: `ANNUAL`, `MONTHLY`, `WEEKLY`, `DAILY` | yes | |
| 496 | + |
| 497 | +#### Example |
| 498 | + |
| 499 | +```java |
| 500 | +rule "Tibber Fetch Full History" |
| 501 | +when |
| 502 | + System started // use your trigger |
| 503 | +then |
| 504 | + var actions = getActions("tibber","tibber:tibberapi:xyz") |
| 505 | + actions.fetchHistory("ANNUAL") |
| 506 | + actions.fetchHistory("MONTHLY") |
| 507 | + actions.fetchHistory("WEEKLY") |
| 508 | + actions.fetchHistory("DAILY") |
| 509 | +end |
| 510 | +``` |
| 511 | + |
442 | 512 | ## Full Example |
443 | 513 |
|
444 | 514 | Full example with `demo.things` and `demo.items` |
@@ -478,6 +548,19 @@ Number:Energy Tibber_API_Last_Hour_Consumption "Last Hour Consu |
478 | 548 | Number:Energy Tibber_API_Total_Production "Total Production" {channel="tibber:tibberapi:xyz:statistics#total-production"} |
479 | 549 | Number:Energy Tibber_API_Daily_Production "Daily Production" {channel="tibber:tibberapi:xyz:statistics#daily-production"} |
480 | 550 | Number:Energy Tibber_API_Last_Hour_Production "Last Hour Production" {channel="tibber:tibberapi:xyz:statistics#last-hour-production"} |
| 551 | + |
| 552 | +Number:Energy Tibber_API_Yearly_Consumption "Yearly Consumption" {channel="tibber:tibberapi:xyz:history#yearly-consumption"} |
| 553 | +Number:Currency Tibber_API_Yearly_Cost "Yearly Cost" {channel="tibber:tibberapi:xyz:history#yearly-cost"} |
| 554 | +Number:Energy Tibber_API_Yearly_Production "Yearly Production" {channel="tibber:tibberapi:xyz:history#yearly-production"} |
| 555 | +Number:Energy Tibber_API_Monthly_Consumption "Monthly Consumption" {channel="tibber:tibberapi:xyz:history#monthly-consumption"} |
| 556 | +Number:Currency Tibber_API_Monthly_Cost "Monthly Cost" {channel="tibber:tibberapi:xyz:history#monthly-cost"} |
| 557 | +Number:Energy Tibber_API_Monthly_Production "Monthly Production" {channel="tibber:tibberapi:xyz:history#monthly-production"} |
| 558 | +Number:Energy Tibber_API_Weekly_Consumption "Weekly Consumption" {channel="tibber:tibberapi:xyz:history#weekly-consumption"} |
| 559 | +Number:Currency Tibber_API_Weekly_Cost "Weekly Cost" {channel="tibber:tibberapi:xyz:history#weekly-cost"} |
| 560 | +Number:Energy Tibber_API_Weekly_Production "Weekly Production" {channel="tibber:tibberapi:xyz:history#weekly-production"} |
| 561 | +Number:Energy Tibber_API_History_Daily_Consumption "History Daily Consumption" {channel="tibber:tibberapi:xyz:history#daily-consumption"} |
| 562 | +Number:Currency Tibber_API_History_Daily_Cost "History Daily Cost" {channel="tibber:tibberapi:xyz:history#daily-cost"} |
| 563 | +Number:Energy Tibber_API_History_Daily_Production "History Daily Production" {channel="tibber:tibberapi:xyz:history#daily-production"} |
481 | 564 | ``` |
482 | 565 |
|
483 | 566 | ### Rule listen to day-ahead price update |
|
0 commit comments