Use hourly temperature forecast and electrical price to automate

I am trying to combine the electrical price combined with weather forecast to automate my heat pump. Lets say I have a four hour window, I can set the indoor temperature down a couple of degrees for the most expensive our, and then reset to normal when the price is better.

This could easily be done with only price, but if I want to check of it is going to be colder, then I want to run now even if it’s expensive.

I can see the hourly forecast in the weather integration, but I don’t know how to use it in automation.

For example, my base outdoor temp is 15 degrees C, and if it is colder, i use the delta t and divide the price with the delta

I’ll join you here with permission. I’m dealing with something similar. Unfortunately, the hourly forecast is not visible as an entity after the last udpate (at least for me ), but only like this in the popup window. I think the way will be using the API and GET from http Met.no. only then I’m stuck with the function in Node Red.