This is probably easier than I’m making it in my head…
I have an entity with an attribute that is an array of numbers (hourly energy prices with the Nordpool integration). I can figure out how to store each hour into a separate entity using a for loop.
But what I want to do is rank them. So let’s say 6am is the cheapest rate, I want [0] to be “6”. Any tips on how to go about this? I would end up with 24 entities per day, from cheapest electricity to most expensive.
Then what I want to achieve is that I can tell an automation to run only if “rate < 5” for example, or not to run if rate > X.
This is a step more than simply telling an automation to run during the cheapest hour, because that’s quite simple, but won’t achieve my goals.
Anyone done this before or have any tips how to procees?
Thanks!