You can replace this:
By this:
{% if state_attr('sensor.nordpool_kwh_trheim_nok_3_095_025', 'tomorrow') | count > 0 %}
So you only display if tomorrow have some content.
You can replace this:
By this:
{% if state_attr('sensor.nordpool_kwh_trheim_nok_3_095_025', 'tomorrow') | count > 0 %}
So you only display if tomorrow have some content.
Well. actually, the entire content “fails” if tomorrow is unavailable, but it has been more reliable than using the tomorrow_valid flag. It’s quite some time since I tried to use the flag, but since this is mostly working I am sticking with it.
Before 13:01 it shows this (The last sentence says: “The energy price for tomorrow is not ready”:
Haha, that was way easier than my “hack”. Time to change my card, I guess
This thread is really cool and super helpful for a Newbie like myself.
I live in Denmark and have solar panels on the roof and I am selling excessive power to a company called “Jysk Energi”. The price I get is my consumption price in DKK reduced by 25 ore, I believe.
Of course I would like to assess the “returned to grid” in monetary terms. Could I use the Nordpool price per hour and somehow apply “minus 0,25 DKK”?
You can easily create a template sensor to do that.
It would be something like this (please change the entity_id
for your NordPool sensor):
template:
- sensor:
- name: Electricity selling price
unique_id: electricity_selling_price
unit_of_measurement: "DKK/kWh"
device_class: monetary
availability: "{{ is_number('sensor.nordpool_kwh_se3_sek_3_10_025') }}"
state: "{{ states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(0) - 0.25 }}"
Then you will have a new sensor.electricity_selling_price
with the adjusted value.
By the way, what if the NordPool price is lower than 0.25 ore/kWh? How should be your selling price in this case?
Edward, that’s awesome. Many thanks.
But I do have a problem it seems (see screenshot).
I need to read up on your question on the negative price though
You are missing the beginning of the code I’ve shared where the template:
is and also some Indentation.
Try to copy my code again, including the first line.
Go to Developer Tools, select the tab Status and then search for sensor.electricity_selling_price
. Please share what you find there.
This is awesome, many thanks, buddy.
For less cluttered & easy to scan UI, replace
const timeString = startDate.toLocaleTimeString(locale)
with
const timeString = startDate.toLocaleTimeString([], { hour12: false, hour: "2-digit" })
Cheers
cmon guys, such a long thread and nobody has come up with a graph that includes tariffs?
Or am i just bad at search?
Isnt the day and night difference in tariffs common in most countries?
for example in EE the tariff price changes to night at 22:00, so doing whatever automation to track cheapest hours, might be thrown off a lot, if market price between 21-22 and 22-23 is reversing the tariffs gain.
One should calculate the, lets say, “cheapest hours” by a table that includes tariffs.
Can we get @arva, @kalapragu, @wjaceh or any other smart guy to show how this nordpool array can be shot through the tariffs template to come up with “final price” graph?
There is an example on how to add (non-fixed) tarrifs in the price on the GitHub page. That way, the graph does not need to contain this logic.
example to the graph or just “current price”?
We have many examples how to take current price and add current tariff to that.
But I see none that go through the whole graph and adjust this to tariffs.
Current is easy. But that does not visualize the day with changing tariffs.
If you check the apex chart integration on this forum you will see many examples
didnt you really read the problem before answering or am i really bad at search?
You say there are examples of nordpool graph that includes in it’s prices not just market price but also changing tariffs prices, on the graph columns throughout the day?
Could you link one please?
I have a template sensor for Võrk4 tariff:
- platform: template
sensors:
el_tariff: #hinnad KM-ita, template arvutiab km-i otsa *1.2
friendly_name: "Electricity Tariffs"
unit_of_measurement: '€/kWh'
value_template: >-
{% macro calc(v) -%}
{%set d = {"operator_margin": 0.000,
"electricity_excise": 0.001,
"renewable_tariff": 0.0113,
"nw_fee_night": 0.0186,
"nw_fee_day": 0.0326
} %}
{%set day_price = v + ((d.operator_margin + d.renewable_tariff + d.electricity_excise + d.nw_fee_day) * 1.2 | float ) | round(4)%}
{%set night_price = v + ((d.operator_margin + d.renewable_tariff + d.electricity_excise + d.nw_fee_night) * 1.2 | float ) | round(4)%}
{% if now().weekday() in (5,6) %}
{{night_price}}
{% else %}
{% if now().hour >= 7 and now().hour < 22%}
{{day_price}}
{% else %}
{{night_price}}
{% endif %}
{% endif %}
{%- endmacro %}
{{calc(0)}}
If you have this, you can use it in Nordpool integration configuration. Example 4: https://github.com/custom-components/nordpool:
additional_costs: ''{{ (states('sensor.el_tariff')) | float(0) }}''
As i havent’t tested it, i cannot tell if it then shows the current value + additional cost (eg. "final price) on the graph, but I’m quite sure it does. Test it out and let us know.
I do have Võrk4 tariff, and you should check yours, since in your example they are old, life got more expensive while you were not looking!
But now i get it, tariff sensor can be added into the additional costs… thank you sir.
But nordpool graph with tariff added this way seems to only look at the tariff entity’s current value and slaps that onto everything. It seems like we cant get away that easy… because the tariff value should change when daytime begins etc, so it cant be just looking at the entitys current value…
I’m guessing that the whole graph will jump now when the tariff changes in the morning. Telling truth about current moment but lies in the long term.
So the solution must be some script that computes through all the nordpool array values and adds appropriate tariff values for the given hour?
Who can put that together?
Or can someone come up with something else I’m dumb enough not to know, that would reach same result?
hmm wait, doesnt the example 5 with the seasonal tariff do similar thing…