Thank you for trying, but i looked at the link and understood nothing.
I know i copied the “sensor” from some thread, but can not remember if it was in this thread or somewhere else.
I will just have to trawl through this site and see if i can find where i copied it from, i am not very good at this, i can easily copy something that works, but understanding exactly what makes, what work, is not my forte sadly.
But thanks for trying, i know i am a bit of a lost cause
Hi!
Yesterday i changed the nordpool sensor to cents (Living in Finland)
Unistalled nordpool and installed again, so the settings are correct
But the energy dashboard does not calculate it correct? Any suggestions?
Did you figure it out? It seems I am getting the sensor readings always in cents. So the energy dashboard has a x100 factor in price calculation. This happened after the last update.
I’m not sure if I understood what you are looking for.
I can easily change that to show the “n” cheapest hour on that interval. Just change that last number on [0:n] for the number of hour you want.
For the cheapest 4 hours on that interval, in ther order from the cheapest hour to the 4th cheapest hour:
Well, you can have an automation running every time the price changes between this time interval and then check if it is cheaper than the max of the 4 cheapest prices and based on that turn on or off your device.
But please note this is turning on/off bested on the cheapest 4 hours, not on the cheapest 4 CONSECUTIVE hours, which will require a bit more complexity.
For a car charger, you probably want 4 cheapest hours, but for a dishwasher, you probably want the cheapest 4 consecutive hours.
Did anyone find a fix for the hour 23-24 not showing in apexcard?
The push for extra datapoint didn’t work, as said. I also tried extend to end, which fills it to end of day2. Also setring group_by 1h and duration 1h didn’t work
I’m trying to create a template that shows the true cost for electricity. I’m using a template from smarthomejunkie as a starting point. He created a helper to add additional cost but i want to add it to the template file.
What i have so far:
- sensor:
- name: "Nordpool Energie Prijzen"
unique_id: 46c4adb8-b582-4dcf-8b19-0b80646c82f0
icon: mdi:currency-eur
unit_of_measurement: "€"
state: >
{% set energy_tax = 0.1524 | float %}
{% set extra_cost = 0.0175 | float %}
{% set VAT = 1.21 | float %}
state: {{ (((states('sensor.nordpool_kwh_nl_eur_3_10_021') | float / 121) * 100) + energy_tax + extra_cost) * VAT }}
attributes:
times: >
{% set ns = namespace(times=[]) -%}
{%- set today = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_today') -%}
{%- for hours in today -%}
{%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
{%- endfor -%}
{%- set tomorrow = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_tomorrow') -%}
{%- for hours in tomorrow -%}
{%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
{%- endfor -%}
{{ ns.times }}
prices: >
{% set ns = namespace(prices=[]) -%}
{%- set today = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_today') -%}
{%- for hours in today -%}
{%- set ns.prices = ns.prices + [(((hours.value / 121) * 100) + energy_tax + extra_cost) * VAT] -%}
{%- endfor -%}
{%- set tomorrow = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_tomorrow') -%}
{%- for hours in tomorrow -%}
{% if hours.value %}
{%- set ns.prices = ns.prices + [(((hours.value / 121) * 100) + energy_tax + extra_cost) * VAT] -%}
{% endif %}
{%- endfor -%}
{{ ns.prices }}
When i insert it to “template” in “developers tools” it gives the following output
Thank you! That did the trick.
Had some other errors bur those are resolved already.
In case anybody else is interrested, below is the full script with the prices rounded to 2.
# Nordpool Settings
- sensor:
- name: "Nordpool Energie Prijzen"
unique_id: 46c4adb8-b582-4dcf-8b19-0b80646c82f0
icon: mdi:currency-eur
unit_of_measurement: "€"
state: >
{% set energy_tax = 0.1524 | float %}
{% set extra_cost = 0.0175 | float %}
{% set VAT = 1.21 | float %}
{{ ((((states('sensor.nordpool_kwh_nl_eur_3_10_021') | float / 121) * 100) + energy_tax + extra_cost) * VAT) | round(2) }}
attributes:
times: >
{% set ns = namespace(times=[]) -%}
{%- set today = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_today') -%}
{%- for hours in today -%}
{%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
{%- endfor -%}
{%- set tomorrow = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_tomorrow') -%}
{%- for hours in tomorrow -%}
{%- if hours.value -%}
{%- set ns.times = ns.times + [as_local((hours.start)).strftime("%Y-%m-%d %H:%M:%S")] -%}
{%- endif -%}
{%- endfor -%}
{{ ns.times }}
prices: >
{% set energy_tax = 0.1524 | float %}
{% set extra_cost = 0.0175 | float %}
{% set VAT = 1.21 | float %}
{% set ns = namespace(prices=[]) -%}
{%- set today = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_today') -%}
{%- for hours in today -%}
{%- set ns.prices = ns.prices + [((((hours.value / 121) * 100) + energy_tax + extra_cost) * VAT) | float | round(2)] -%}
{%- endfor -%}
{%- set tomorrow = state_attr('sensor.nordpool_kwh_nl_eur_3_10_021', 'raw_tomorrow') -%}
{%- for hours in tomorrow -%}
{% if hours.value %}
{%- set ns.prices = ns.prices + [((((hours.value / 121) * 100) + energy_tax + extra_cost) * VAT) | float | round(2)] -%}
{% endif %}
{%- endfor -%}
{{ ns.prices }}
Is there a way to create a sensor that always show the price of the previous hour?
I want to use it to multiply it with my house solar energy consumption for the previous hour.
In this way calculating every 1min after each hour my “real saving”.
Sorry this may be slightly off topic but this thread seem to contain many experts on how to pull the attribute data off the nordpool sensor.