-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Afternoon rank #32
Comments
Yes, your use case seems to reasonable. Maybe something like below would suite your needs? That could be used as an automation condition to decide whether to turn on/off heating. You give start time, stop time and desired "rank" X. The code searches for Xth cheapest hour during the desired period and stores the price of that hour to variable "limit". And finally the code checks whether we are in currently in the desired time period and whether the current electricity price is lower than the limit found. This way you don't need to calculate ranks for each hour and store the results of that. Maybe not the most elegant solution but this should give you needed tools to fulfill your use case. Please test this thoroughly as I just wrote the code quite quickly as an starting point for you.
|
Thanks for the comments and code example. I've used this feature now for few months and can confirm it works. Few observations: Also as I didn't want to heat every afternoon on cheapest hours (in case there's been cheap hours in afternoon anyway), I've added a check to see how many hours the floor has been heated during previous 6 hours. So the condition to heat based on afternoon rank is that afternoon rank is on AND floor is cold (has not been on for more than 3 hours (=value of the slider) during past 6 hours).
|
And sorry for violating your good naming principle, by adding shf in my own sensor names as well. I thought it would be handy to find all sensors related to spot prices easily (own or coming from the package), but didn't think of possible future conflicts at that point... If anyone else uses code above, please don't make the same mistake. |
Sorry but I have trouble believing that this would work. To be clear: I have not tried it. update: after recalling Finish governments recect "clever" decision to raise VAT to 25.5% I change my mind: best would be if all the EUR/kWh prices were actually rounded, but all to 5 decimals - this would keep the same resolution the original Nordpool prices have and would not add extra digits due to e.g. VAT calculation. |
The default features are great and I can do most what I want by using/copying price_or_rank binary sensor. However I would like to have a separate rank calculation for a specific time period, that might be useful for others as well.
Use case: I use price_or_rank to heat up the bathroom floor when price is lowest. The floor stays quite warm for few hours, but quite typically the heated hours are in the morning or late evening. For morning showers this is fine, but I would like to have a separate afternoon rank to find the cheapest hours from 2pm to 22pm for example. But would not like to keep the floor heated during the expensive hours of the day.
The text was updated successfully, but these errors were encountered: