Tibber price level to turn on heating?

´You the best ! I will try that ! Can i add more “entity_id”: under target ?´

As you are using numbers, you can simplify the combined sensor by using the max function.

Something like this:

      - name: Electricity Price Level (combined)
        unit_of_measurement: ""
        icon: mdi:currency-usd
        state: >-
          {% set level1 = states('sensor.electricity_price_level_24h') | float(-1) %}
          {% set level3 = states('sensor.electricity_price_level_tibber_3_days') | float(-1) %}
          {{ max(level1,level3) }}

I’m not sure if I understood what you are trying to achieve. What those thresholds are doing?

You should be able to do it like this:

        - switch.your_switch
        - switch.other_switch
1 Like

Thanks ! :heart_eyes:

Thanks for the reply! You reminded me to update here at the community as well :blush:
I optimized my code a bit and will not be using “Tibber level 3 days”.
Please have a look here:

1 Like

The thresholds are similar to what Tibber are using, here from Tibber Developer Reference docs.
I am not sure how these thresholds will adapt to my 4 level needs… :thinking:
So instead, I made my thresholds variables that I can change when/if I need to tune the settings of the thresholds. I hope it made it a bit more clear to you :smiley:
Please also have a look at my updated and commented code here:
CTC i350 (heat pump) smartcontrol using Tibber electricity prices by the hour

This is a very interesting thread!

I am using the cheap / very cheap attribute from tibber to charge my home battery when there will not be enough solar power this day.

But since I run out of battery almost every day now in the winter, I am thinking about changing the automation:

I want to charge the battery when the electric price is at the daily lowest. I think that should be the attribute “min price”.

Does anyone has an idea how to make a binary switch with “min price”?

1 Like

I just started completely new into HA and have no clue so far. I’m trying to get an overview on how this whole thing works in general ^^
I am thinking about the same idea - charging my battery with grid power when the price is low and tanking it out again when it’s bigherly priced.
If you have a solution I’d be very glad to participate.
Sadly at my current knowledge level, I won’t have a chance to help here ^^

In his apexchart this guy is also implementing a minimum price, should be easy enough to create a sensor that compares that value (on state change (see above) of the current price) and sets it to 1 if equal or 0 if not.

Actually, the same guy :smiley: Edward is everywhere :smiley:

Also I just found out that tibber is indeed giving min/max/avg price - I just looked at two different sensors and could not find the attribute -.-

1 Like

Hello Edward,
I am new to HA. Where do I put the code exactly?
I am also strugfgling to automate due to the “3-day” price level. I need an entity with a “todays price level”.
Thank you in advance