If set to 12: The device will run the 12 cheapest hours (24-12), ie. median
If set to 6: The device will run the 18 cheapest hours (24-6)
If set to 4: The device will run the 20 cheapest hours (24-4)
If set to 2: The device will run the 22 cheapest hours (24-2)
My pool needs at minimum 12 hrs circulation.
You can obviously set your helper to your needs. I do recommend to use even values between 2 and 22, else you may need to change the template.
I copied your code to my configuration.yaml and replaced sensor.nordpool_kwh_se3_sek_3_10_025 with my sensor.nordpool_kwh_fi, however, template sensors remain unvailable, i.e. do not produce any value. My sensor.nordpool_kwh_fi is working and showing correct values.
I’ve changed that to shorter format for easier use. As I said, it shows correct values. I’ll try to change that back to default and will report the outcome.
EDIT: Changing the sensor name to default did not solve the problem. Unfortunately HA does not give any information why the sensors are unavailable…
I tried using the FI region and it works, but when trying that I noticed that there are two line break errors in my posted code. I updated my script here, but if you want to fix directly in your config file, look around line 10-11 and you’ll see that the lines break in the middle of the Nordpool sensor name.
Sure I use all templates outside config in templates.yaml and use this code:
- sensor:
- name: Dagen Timpris SE3 fem billigaste timmarna
state: >
{% set x = states("sensor.time") %}
{% set l=state_attr('sensor.nordpool_kwh_se3_sek_3_10_025_med_moms', 'raw_today')|sort(attribute='value') %}
{{ (now() >= l[0].start and now() <= l[0].end)
or (now() >= l[1].start and now() <= l[1].end)
or (now() >= l[2].start and now() <= l[2].end)
or (now() >= l[3].start and now() <= l[3].end)
or (now() >= l[4].start and now() <= l[4].end) }}
Since nordpool updates the prices around lunch here in Sweden I try to create a sensor that will show the cheapest X hours today and tomorrow for the next 24 hours.
Lets say I trigger the sensor to update every day at 13:55.
I would then like to combine and sort:
raw_today: Cheapest prices between 14:00-00:00
raw_tomorrow: Cheapest prices 00:00-14:00
Once the cheapest hours are identified and sorted in order I could then automate stuff to run on those X hours for the next 24 hours and the process will repeat next time the sensor updates at 13:55.
I played around in dev tolls with the template editor but I’m way to novice with the templates to figure it out.
Here is a dummy example that is totally just to illustrate what I want:
Hi! I have solar panels and nordpool addon.
In the energy tab, I have exported enegy+nordpool (floating price)
So I see how much I get when exporting the energy.
Now I want this in a card? It can’t be hard, but I have tried everything for a week, and I’m stuck.
Was also thinking of making an automation, so I get a notification every evening how much I have sold.
Im a total beginner, both regarding HA and codingand hope I can ask for some guidance to solve this thing. I usually get by reading forum posts and putting pieces of the puzzle together but this proved to be too much.
The main reason for me to start using HA was to try to create a notification/widget based on future prices. What I am trying to do is to get a notification (and hopefully a “widget”) that tells me with how many hours of delay I should start any household appliance that supports delayed timers. The widget would ideally keep up with current time and update itself, rounding off to the nearest half hour.
The widget would basically say: Delay your appliances by X hours (in order to hit the 3 cheapest, consecutive hours - or something like that)
I use Tibber but realised that they dont include future prices anywhere so I managed to install Hacs and the Nordpool sensor which is basically the same data I need to determine any period of lower prices. I see @sepahewe s post about future prices and all but I really have no idea where to start here.
Well, I thought I could at least ask so here it is…
I think this tutorial teaches you what you need to know about loops: https://www.youtube.com/watch?v=g01tJiL-hkk&t=69s. I don’t know exactly how to do this myself, but I hope this gets you started. Smart Home Makers has a bunch of nice tutorials.
Could someone explain to me the attributes Peak, Off Peak 1 and Off Peak 2 ? What are these and what do it give me? What I understand they give the avg price on certain hours a day. But do that give you and how do you use that information?