Tibber Binding

Mine yesterday. There is a channel for the consumption counter (1.8.0) but none for feed-in (2.8.0).
Just a channel “accumulated feed-in since midnight” which seems weird. Hence my question.

I’m lost in documentation here:

  • live_accumulatedConsumption is NULL with my Tibber API and the MainUI says:
    “Consumption at given time interval (e.g. hourly, daily, last meter reading, accumulated since midnight)”

same with

  • live_lastMeterConsumption
  • live_accumulatedProduction

Perhaps, I’ll have to wait for tomorrow as I installed my Pulse just two hours ago - and the docs also mention “Accumulated Consumption since Midnight”, so I guess it’s not overall 1-0:1.8.0 or 1-0:2.8.0…

Either way: I don’t seem to find the API calls for both overall meter readings. And without that endpoint, just adding consumption to kWh feels a bit pointless and fuzzy.

I can see all of those 3 values (Pulse running since yesterday).

As I said there is live_lastMeterConsumption for 1.8.0 bu tnone for 2.8.0.

Ok, played around a bit, and there IS an endpoint to it, so it just has to be added to the binding, I guess?

subscription{
  liveMeasurement(homeId:"xxx"){
    timestamp
    power
    accumulatedConsumption
    accumulatedCost
    currency
    minPower
    averagePower
    maxPower
    lastMeterProduction
    lastMeterConsumption
  }
}

Last two arguments load 1-0:1.8.0 and 1-0:2.8.0. So its just not implemented in the current binding

Hi @kjoglums would you mind adding the lastMeterProduction channel ?

If you already configured the channels for the binding and later activated the Pulse, you have to restart the binding to fill/receive the items coming from the Pulse.
After I did restart it, the items got filled

After updating the binding to 3.4.2 from i think 3.3.0 or so the item TibberAPITomorrowPrices isn’t NULL anymore and contains the prices for tomorrow!

The item TibberAPITodayPrices is still NULL by the way. Seems like it’s not implemented yet or somthing. I think i will try another update in a few weeks!

Thanks for the support! :slight_smile:

Hi,

i just registered with Tibber too and also installed the Binding. I can read the data and i can also get the current price. However Tibber recommends to not use the current price but to get the price for the next day and cache it instead.

This also makes sense, if you want to calculate ahead, if it makes sense to plugin the car at night or start a specific consumer at a certain time and maybe also ask the user for feedback if it should be started or not, or send a reminder to plug in the car before going to sleep.

Writing such rules itself for me is not really a problem, however i have no experience with parsing dates and such in OH and to store them in a format where i can use them in rules.

Is there anyone that built rules already based on the prices when cached and only requested once per day in the afternoon?

I just need a sample, how to deal with them…

So i request tomorrow prices and get a result in json format like

[
  {
    "startsAt": "2022-09-27T00:00:00.000+02:00",
    "total": 3.8472
  },
  {
    "startsAt": "2022-09-27T01:00:00.000+02:00",
    "total": 3.0748
  },
...

What would be the best way, to store this as a value for using in rules? Should i just keep it in that format and create a rule to iterate throught each element in that array and then send a notification or start a certain task at a certain time?

Quite frankly, I use the aWATTar-Binding for that. The basic aWATTar-API is open without registration and the aWATTar-Binding already spits out two things: hourly prices in separate channels and an extra Thing, which can be configured to already calculate the “cheap hours”. So I use that for starting loading the EV and other high consumption devices.
There’s a discussion going on to streamline the efforts for dynamic pricing:

But for the time being, I just use the ready-made channel-configuration with aWATTar-things. :wink:
You can add the local surplus to the aWATTar-bridge (base price) and you’ll get the same exact pricing as you do with Tibber.

1 Like

Hi,

here is my example of parsing the hour values fron the JSON format:

rule "Determine maximal price on next day"
when
    Time cron "0 55 23 * * ?"
then   
    var price_tom_min = Float::parseFloat("100")
    var price_tom_max = Float::parseFloat("0")

    for (var i = 0; i <= 23; i++) {
    var newString = "$.[" + i + "].total"
    JSONPathexp.postUpdate(newString)
    var newValue = transform("JSONPATH", newString, TibberAPITomorrowPrices.state.toString)
    var Price = Float::parseFloat(newValue) * 100
    if (Price < price_tom_min)  price_tom_min = Price
    if (Price > price_tom_max)  price_tom_max = Price
    }

    PriceTomorrowMin.postUpdate(price_tom_min)    
    PriceTomorrowMax.postUpdate(price_tom_max)
    PriceTomorrowDiff.postUpdate(price_tom_max-price_tom_min)  
end

Enable the JSONPath Transformation in the Transformation Add-ons tab.
newString is for example “$.[0].total” to access the first hour of the day.

Thanks, this looks good for determining the best hours, in Germany we should rather use 0 05 14 * * ? as cron expression as the prices should be fixed after 2pm (at least on Awattar, guess it’s the same on Tibber?).

So the only other thing I’m missing right now is how to display that on Grafana. If I have 24 today values and 24 tomorrow values, how can i show that on Grafana? Any ideas?

Sorry for the late reply, but will have a look at getting lastMeterProduction channel included in the binding.

1 Like
1 Like

Feature request:

  • Add channels for lastMeterConsumption and minPower.

Reasoning:

  • lastMeterConsumption could be used to check the correctness of the hourly consumption values (I wouldn’t expect any discrepancies though - but who knows?).
  • minPower could be used to reduce the base load by identifying (and replacing) power guzzlers.
subscription{
  liveMeasurement(homeId:"XXXXXXXXX"){
    timestamp
    lastMeterConsumption
    power
    accumulatedConsumption
    accumulatedCost
    currency
    minPower
    averagePower
    maxPower
  }
}

Result:

{
  "liveMeasurement": {
    "timestamp": "2023-04-01T12:12:16.000+02:00",
    "lastMeterConsumption": 19957.8146,
    "power": 358,
    "accumulatedConsumption": 4.3593,
    "accumulatedCost": 0.817414,
    "currency": "EUR",
    "minPower": 105,
    "averagePower": 357.1,
    "maxPower": 4893
  }
}

Moderator’s request: read before posting.
Particularly so before asking someone to work for you.

I think they are already there? Channels live_lastMeterConsumption and live_minPower.

@laursen @mstormi
You are right, channels are available - I am sorry I did not check the documentation properly.

You didn’t even read this thread.

Proof?

I don’t have to give proof, but it’s the post right above your request.