I guess this could be done with two flows. One that runs each new day that calculate the diff between max price and min price and store the value in a variable. The other flow runs each new hour and calculates the gain value.
daypricediff = maxdayprice-mindayprice
gain= (maxdayprice-currentprice)/daypricediff
this will give a zero value when currentprice=maxdayprice and one when currentprice=mindayprice like you specified in the post.
But there is a scaling problem. When there is days that have for example high price in every other hour but one. The scaling then makes that only on that one hour would have the gain value 1 and all others are close to 0. If one uses this for heating control the house would be cold
I have also missed that this app has the possibility to add a āextra time of day markupā. This is excelent feature. Thanks @Gruijter for developing this app constantly.
Not true. The ranking has no weight. So 1 cheap hour and 23 expensive hours still has each hour ranking 1 through 24. So say you want 6 hours of heating per day, just select all ranks below 7 ( which is equal to selecting the 6 cheapest hours of the day) , and weigh the actual hour e.g. as 1/rank). Or whatever weighting scheme you can come up with, such as 3/(rank+2).
That means that you want the gain value to be centered around the average price? I.e. temperature to be set to 21 degrees when you have the average price.
Not sure if this is the simplest formula but it might work.
Flow1(run at midnight):
daypricediffaboveaverage = maxdayprice-averagedayprice
ENTSOE is indeed migrating their API. I now implemented a change to support the new API, but there seems to be a bug on their end. Any day that has consecutive hourly prices that EXACTLY match are skipped in the response. This messes up the data and thus PBTH disregards it all.
I contacted ENTSOE support about this and am awaiting their responseā¦
Thank you Gruijter for your work!
After update, no changes - todayās electricity market prices are not renewed.
Do they have to be restored instantly, or do they have to wait a while?
How can I use the total like in the card/widget above? Can I use a logic variable to send the current usage (so energy EM + solar output EM) to a PBTH device?