---
id: tibber
label: Tibber
title: Tibber - Bindings
type: binding
description: "The Tibber Binding retrieves `prices` from [Tibber API](https://developer.tibber.com)."
logo: images/addons/tibber.png
install: auto
---
{% include base.html %}
# Tibber Binding
The Tibber Binding retrieves `prices` from [Tibber API](https://developer.tibber.com).
Users equipped with Tibber Pulse hardware can connect in addition to [live group](#live-group) and [statistics group](#statistics-group).
## Supported Things
| Type | ID | Description |
|-----------|-----------|---------------------------|
| Thing | tibberapi | Connection to Tibber API |
## Thing Configuration
| Name | Type | Description | Default | Required |
|---------------|-----------|---------------------------------------|-----------|-----------|
| token | text | Tibber Personal Token | N/A | yes |
| homeid | text | Tibber Home ID | N/A | yes |
| updateHour | integer | Hour when spot prices are updated | 13 | yes |
Note: Tibber token is retrieved from your Tibber account:
[Tibber Account](https://developer.tibber.com/settings/accesstoken)
Note: Tibber HomeId is retrieved from [developer.tibber.com](https://developer.tibber.com/explorer):
- Sign in (Tibber user account) and "load" personal token.
- Copy query from below and paste into the Tibber API Explorer, and run query.
- If Tibber Pulse is connected, the Tibber API Explorer will report "true" for "realTimeConsumptionEnabled"
- Copy HomeId from Tibber API Explorer, without quotation marks, and use this in the bindings configuration.
```graphql
{
viewer {
homes {
id
features {
realTimeConsumptionEnabled
}
}
}
}
```
If user have multiple HomeIds / Pulse, separate Things have to be created for the different/desired HomeIds.
## Channels
### `price` group
Current and forecast Tibber price information.
All read-only.
| Channel ID | Type | Description | Time Series |
|-------------------|----------------------|----------------------------------------|--------------|
| spot-price | Number:EnergyPrice | Spot prices for today and tomorrow | yes |
| level | Number | Price levels for today and tomorrow | yes |
| average | Number:EnergyPrice | Average price from last 24 hours | yes |
The `level` number is mapping the [Tibber Rating](https://developer.tibber.com/docs/reference#pricelevel) into numbers.
Zero reflects _normal_ price while values above 0 are _expensive_ and values below 0 are _cheap_.
Mapping:
- Very Cheap: -2
- Cheap: -1
- Normal: 0
- Expensive: 1
- Very Expensive: 2
The `average` values are not delivered by the Tibber API.
It's calculated by the binding to provide a trend line for the last 24 hours.
After initial setup the average values will stay NULL until the next day because the previous 24 h prices cannot be obtained by the Tibber API.
Please note time series are not supported by the default [rrd4j](https://www.openhab.org/addons/persistence/rrd4j/) persistence.
The items connected to the above channels needs to be stored in e.g. [InfluxDB](https://www.openhab.org/addons/persistence/influxdb/) or [InMemory](https://www.openhab.org/addons/persistence/inmemory/).
### `live` group
Live information from Tibber Pulse.
All values read-only.
| Channel ID | Type | Description |
|-----------------------|---------------------------|-------------------------------------------------------|
| consumption | Number:Power | Consumption at the moment in watts |
| minimum-consumption | Number:Power | Minimum power consumption since midnight in watts |
| peak-consumption | Number:Power | Peak power consumption since midnight in watts |
| production | Number:Power | Net power production at the moment in watts |
| minimum-production | Number:Power | Minimum net power production since midnight in watts |
| peak-production | Number:Power | Maximum net power production since midnight in watts |
| voltage1 | Number:ElectricPotential | Electric potential on phase 1 |
| voltage2 | Number:ElectricPotential | Electric potential on phase 2 |
| voltage3 | Number:ElectricPotential | Electric potential on phase 3 |
| current1 | Number:ElectricCurrent | Electric current on phase 1 |
| current2 | Number:ElectricCurrent | Electric current on phase 2 |
| current3 | Number:ElectricCurrent | Electric current on phase 3 |
### `statistics` group
Statistic information about total, daily and last hour energy consumption and production.
All values read-only.
| Channel ID | Type | Description |
|-----------------------|---------------------------|---------------------------------------------------------------|
| total-consumption | Number:Energy | Total energy consumption measured by Tibber Pulse meter |
| daily-consumption | Number:Energy | Energy consumed since midnight in kilowatt-hours |
| daily-cost | Number:Currency | Accumulated cost since midnight |
| last-hour-consumption | Number:Energy | Energy consumed since last hour shift in kilowatt-hours |
| total-production | Number:Energy | Total energy production measured by Tibber Pulse meter |
| daily-production | Number:Energy | Net energy produced since midnight in kilowatt-hours |
| last-hour-production | Number:Energy | Net energy produced since last hour shift in kilowatt-hours |
## Thing Actions
Thing actions can be used to perform calculations on the current available price information cached by the binding.
Cache contains energy prices from today and after reaching the `updateHour` also for tomorrow.
This is for planning when and for what cost a specific electric consumer can be started.
Performing a calcuation a `parameters` object is needed containing e.g. your boundaries for the calculation.
Parameter object allow 2 types: Java `Map` or JSON `String`.
The result is returned as JSON encoded `String`.
Refer below sections how the result looks like.
If the action cannot be performed, a warning will be logged and an empty `String` will be returned.
Some real life scenarios are schown in [Action Examples](#action-examples) section.
### `priceInfoStart`
Returns starting point as `Instant` of first available energy price.
It's not allowed to start calculations before this timestamp.
In case of error `Instant.MAX` is returned.
### `priceInfoEnd`
Returns end point as `Instant` of the last available energy price.
It's not allowed to exceed calculations after this timestamp.
In case of error `Instant.MIN` is returned.
### `listPrices`
List prices in ascending / decending _price_ order.
Use [persistence estensions](https://www.openhab.org/docs/configuration/persistence.html#persistence-extensions-in-scripts-and-rules) if you need _time_ ordering.
#### Parameters
| Name | Type | Description | Default | Required |
|---------------|-----------|---------------------------------------|-------------------|-----------|
| earliestStart | Instant | Earliest start time | now | no |
| latestStop | Instant | Latest end time | `priceInfoEnd` | no |
| ascending | boolean | Price sorting order | true | no |
#### Example
```java
rule "Tibber Price List"
when
System started // use your trigger
then
var actions = getActions("tibber","tibber:tibberapi:xyz")
// parameters empty => default parameters are used = starting from now till end of available price infos, ascending
var parameters = "{}"
var result = actions.listPrices(parameters)
val numberOfPrices = transform("JSONPATH", "$.size", result)
logInfo("TibberPriceList",result)
for(var i=0; i