As you may know, I’m using local calendar these days to run specific automations when the electricity price is the cheapest on each day. However, this time I want to heat my outdoor hot tub when ever the electricity price drops below certain point. And for that, I want to use the same local calendar as with the other electricity schedules. (Ps. If you haven’t read the previous article yet, I’d suggest to do that first since this is kind of continuation on that).
In more details, this automation is going to fill the local calendar for the next day with heating schedules to fully heat my hot tub after the electricity prices are received. In fact, I’m just going to play with high / low range of the Balboa spa to toggle between 20°C (low) and 37°C (high) during the cheap hours, but that’s not the main point of this automation.
The biggest change regarding the previous advanced cheapest hours automation is that this time the calendar entries might not be sequential. However, I don’t want to have separate entries of each hour on the calendar either if the prices happens to be sequential. That would cause some odd behaviour of the devices if in the same second the automation triggers off and on again. So I just got to join the sequential entries with each other before actually adding them to calendar.
Hopefully a picture will explain the situation a bit more, so here it goes. In the picture below you can see my heating schedule of the hot tub for today and tomorrow!
Note: This solution might be a bit overkill, since you could just easily check the current price of nord pool sensor and act regarding that state. However, I would like to have a general overview of my electricity schedules through the calendar, so that’s why a bit over-engineering the whole system 🙂
Creating the calendar
Ok, I’m not going to repeat the same things as in previous posts, so you can check out the local calendar creation from previous Advanced Cheapest Hours article 🙂
Installing the package
Pre-requisites for this package to work is to have Nord Pool integration installed. You can look for integration installation guide from the original cheapest hours article or directly from Nord Pool integration GitHub page. Once that is done, continue reading..
Advanced cheapest hours package can be found from my Cheapest hours GitHub page, so download it and copy it on your Home Assistant ‘config‘ folder.
After copied, find the homeassistant: -block from your configurations.yaml file and add the package include on it. If you don’t have homeassistant: -block, just copy the whole block in any root level of configuration.yaml file:
cheapest_hours_price_limit: !include cheap_hours_limit_price.yaml
More details about Home Assistant packages can be found from here. Or if in doubt, leave a comment on the comment field and I’ll try to help you out 🙂
Configuring the package
Once the package is in place, it’s only about to configure your own preferences of it.
In this package there are only few configurable entries:
- price_limit: limit price when to create the calendar entry
- sensor: your nordpool sensor id
- grace_period: how long grace time we add if the hour is last of the day. We can’t merge the events between two days so in this case, we want to add a little delay so the off- and on-entries are not triggered at the same time. e.g. the last hour entry would be something like 23:00-23:55.
Those entries can all be found under the first template sensor, just below ‘attributes’!
And one final and most important configuration required: what is being done when the calendar event triggers! Under the automation “id: ‘Energy: Cheap hours schedule entry'” there are couple of #CHANGE-ME tags where you can change your own actions what ever you like to do with the automation!
When these changes are done, the entries should appear to your ‘electricity‘ calendar once the next day prices are published on the Nord Pool integration!
A bit overkill maybe, but I like to keep my schedules under a calendar so I can have a quick look of the upcoming energy schedules! So far this automation has been working a bit more than a week with zero issues, hopefully it will continue that way as well.
I might still need to do some tweaking with the grace period. I could just keep the automation running during the grace period and not to turn off the device if next period starts just after the grace time.
Anyhow, in my opinion, this is a good start to go forward with energy optimisations and maybe the next step could be (finally) to enable non-sequential cheapest hours using relative energy price of each day 🙂