Any good ideas are welcome. Nordpool Energy Price per hour

Look no further: GitHub - erlendsellie/priceanalyzer: Priceanalyzer for Home Assistant, based on Nordpool Prices.

1 Like

Thanks, but that wasn’t really what I was looking for. I did find something that looks promising though:

And am working with this now. Since I am still in a static price contract and just playing around I can still experiment freely without fear of expensive mistakes…:innocent:

1 Like

It was just time which helped. Today it works just is should be :slight_smile:

I have done this little different. I have a slider where I can choose how many cheapest hour I need. I’m using this one to manage my garage heat pump.
These links are for Finnish but you’ll see codes how its done.

If you need help, I think I can assist you.

2 Likes

Thanks, I will look through that when I have a little time.

https://github.com/jonasbkarlsson/ev_smart_charging

I installed this one, does the trick!

In addition, but using entso-e:
https://community.home-assistant.io/t/custom-component-entso-e-day-ahead-energy-prices/467127/16

- unique_id: billigste_timer_1_2
      name: billigste_timer_1_2
      state: >-
        {% set l=state_attr('sensor.average_electricity_price_today', 'prices')[14:]|sort(attribute='price') %}
        {% set t = now() %}
        {{ (t >= as_datetime(l[0].time) and t <= as_datetime(l[0].time) + timedelta(hours = 1))
          or (t >= as_datetime(l[1].time) and t <= as_datetime(l[1].time) + timedelta(hours = 1)) }}
    - unique_id: billigste_timer_1_3
      name: billigste_timer_1_3
      state: >-
        {% set l=state_attr('sensor.average_electricity_price_today', 'prices')[14:]|sort(attribute='price') %}
        {% set t = now() %}
        {{ (t >= as_datetime(l[0].time) and t <= as_datetime(l[0].time) + timedelta(hours = 1))
          or (t >= as_datetime(l[1].time) and t <= as_datetime(l[1].time) + timedelta(hours = 1))
          or (t >= as_datetime(l[2].time) and t <= as_datetime(l[2].time) + timedelta(hours = 1)) }}
1 Like

Its a bug. The calculation fails to the price are 0. Please update to the prerelease 0.0.10b0

1 Like

Dutch energy tax changed back from 9% to the original 21%.
Update sensor.py by AJediIAm · Pull Request #252 · custom-components/nordpool · GitHub has been submitted.

If you want to update your energy prices now, you can go to custom_components > nordpool > sensor.py

Replace the line
"NL": ["EUR", "Netherlands", 0.09],

With
"NL": ["EUR", "Netherlands", 0.21],

Request for help:
I updated the documentation for this integration. It turns out some of the parameters did not have the most descriptive name, so I submitted a pull request to fix the names on the UI.
Please have a look at the language files and check if they still match the English version. If anything is unclear, consult the documentation.

Secondly, there are many good examples in this threat, but it can be hard to find. If you have a good and fitting example which would be useful for a large audience, please add it to the documentation.

1 Like

I’ve got some issues with my Nordpool, and that’s not the extension but the calculating. I don’t understand. I don’t have a dynamic energy contract yet, but I want to know the right prices. So I hope someone can help me.

What I got now is:

  - platform: nordpool
    VAT: False
    currency: "EUR"
    price_in_cents: true
    low_price_cutoff: 0.5
    region: "BE"
    precision: 3
    price_type: kWh
    additional_costs: >
      {% set VAT = 0.06 %}
      {% set kwh_tarief = 0.0 %}
      {% set bijz_accijns = 0.0 %}
      {% set energiebijdrage = 0.0 %}
      {% set groenestroom_wkk = 0.0 %}
      {% set marge = 0.0 %}
      {{ ((current_price + marge) * VAT + kwh_tarief + bijz_accijns + energiebijdrage + groenestroom_wkk) |float }}

Within my configuration.yaml file. If you can see, the VAT will be calculated (6%) for now. The price is correct. If I calculate the Market data from Nord Pool, you see between 00-01 a price of 130,01. So I calculate 130.01*0.01 * 1.06 which is good now. But when I add the marge of 0.2040 it has to be on 13,9973 but it calculates within HA this value: 15.005 which is incorrect…

130.01*0.1+0.2040 * 1.06 = 13,9973 and not 15.005. Any idea why it goes wrong?
Even when I add a extra 0 at marge (0.02040) it calculates wrong, it’s saying then 13,903…

The add. costs are this:


You can see here the right prices of all add. costs:
{% set s = {"VAT": 1.06,"kwh_tarief": 0.0394475,"bijz_accijns": 0.0144160,"energiebijdrage": 0.0020417,"groenestroom_wkk": 0.02714,"marge": 0.002040 } %}
{{((current_price + s.marge) * s.VAT + s.kwh_tarief + s.bijz_accijns + s.energiebijdrage + s.groenestroom_wkk) | float}}

Hope someone can help me to get the right price.


Update:

I fixed the price now:

  - platform: nordpool
    VAT: False
    currency: "EUR"
    price_in_cents: false
    low_price_cutoff: 0.5
    region: "BE"
    precision: 5
    price_type: kWh
    additional_costs: >
      {% set VAT = 0.06 %}
      {% set netwerkkosten = 0.0394475 %}
      {% set federale_accijns = 0.014416 %}
      {% set energiebijdrage = 0.0020417 %}
      {% set groenestroom_wkk = 0.02184 %}
      {% set marge = 0.002040 %}
      {% set correctie = 0.002 %}
      {{((current_price + marge) * VAT + netwerkkosten + federale_accijns + energiebijdrage + groenestroom_wkk + correctie) |float}}
1 Like

I have modified a few templates found here, special thanks to sepahewes post up here.

Simple value template for use as a condition in automations. Returns true if this hour is among the cheapest x hours this day. Change number in range() to increase or decrease threshold:

{% set np_tdy=state_attr('sensor.nordpool_kwh_se3_sek_3_095_0', 'raw_today') | sort(attribute='value') %}
{% for n in range(4) %}
  {% if np_tdy[n].start <= now() <= np_tdy[n].end %}
    {{ true }}
  {% endif %}
{% endfor %}

Similar to above but also include tomorrows prices if they are available. Change range() to increase or decrease threshold.

{% set np_tdy = state_attr('sensor.nordpool_kwh_se3_sek_3_095_0', 'raw_today') %}
{% if state_attr('sensor.nordpool_kwh_se3_sek_3_095_0', 'tomorrow_valid') == true %}
  {% set np_tmr = state_attr('sensor.nordpool_kwh_se3_sek_3_095_0', 'raw_tomorrow') %}
  {% set np_cmd = (np_tdy+np_tmr) | sort(attribute='value') %}
{% else %}
  {% set np_cmd = np_tdy | sort(attribute='value') %}
{% endif %}
{% for n in range(10) %}
  {% if np_cmd[n].start <= now() <= np_cmd[n].end %}
    {{ true }}
  {% endif %}
{% endfor %}

I have also made a template sensor to analyze the spot price trend (i.e. if the price is decreasing or increasing).

These can be used as conditions for smarter automations. I plan to modify the sensor to also include the level or increase or decrease in price, for example “Next 6 hours: Slighly decreasing” and “Tomorrow: High increase”.

Many lines I know, I’m sure they can be shortened by someone with more syntax experience :slight_smile:

Is anyone else having trouble with Nordpool today? I seems to be getting no or false data…

Hi Community! I’m stuggling a bit of getting an automation to work in HA, where I want the color of a bulb to turn into green, yellow or red, based on the current Nordpool Energy Price. I could ofcause set my own threshold, but I want to acheive this by setting the treshold based on what be the highest, median and lowest price for that specific day. Does anyone have an example on how to solve this?

1 Like

Hello

I use GitHub - kotope/ha_nordpool_cheapest_hours: Home Assistant package to calculate cheapest hours using Nordpool integration (Thanks to you who fixed it) and some automations to control my solar batteries. it works well, but I wish to be able to select the X most expensive hours in the next 24 hours, not sequentially. Anyone have a solution for that?
Thanks in advance
/ Jonas

1 Like

Hi who is one of the top Dutch contributors to this wonderful integration please? I’d like to ask him/her for their referal code before signing up to tibber (they get EUR 50 worth of smart home shopping credit).

like this template sensor?

   - name: cheapest_2_hours_nordpool
     state: >-
         {% set l1=state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_today')[:24]|sort(attribute='value') %}
         {{
           (now() >= l1[0].start and now() <= l1[0].end)
           or (now() >= l1[1].start and now() <= l1[1].end)
         }}    

and replace 0 with 23 for most expensive ect. And probably tomorrow instead today?

2 Likes

This looks interesting, but it gives me “false” as a result instead of the cheapest non-sequential hours…

It will give you true in case it’s one of the cheapest. Just add the following to get attributes containing the date/time of the cheapest hours (or most expensive hours if you sort them the other way around)

attribute_templates:
  Hour1: {{ l[0] }}
  Hour2: {{ l[1] }}
  Hour3: {{ l[2] }}
  Hour4: {{ l[3] }}
1 Like

Thanks. I will try it out.

I decided to switch to Tibber today, of course it will take a while until the switch will actually happen, so I have some time to get my scripts ready.

My “endgame” is to charge my solar battery when electricity is cheap and then use the power. Of course always calculating in how much power my solar is going to generate within the next 12 (or 24?) Hours. I can already do it with “cheapest consecutive hours” but not yet with individual hours.

I will do the same switch to Tibber. As far as I can tell from Nordpools license agreement, any unlicensed usage of their data is not allowed (even personal). Looking for licensed users on their web page, Tibber is one of them. I cannot find Home Assistant as a licensed end user nor as a licensed data re-distributor.
For sure I cannot afford to pay the ridiculously expensive license fee myself.
But maybe I am not looking in the right place.

1 Like