Cheapest Energy Hours - Jinja macro for dynamic energy prices

Just an idea. What if you use the macro with lowest set to false and hours set to 1 hour. That way you will find the most expensive hour of the day. Then you can use that as input for end in your actual macro.

So I can use the sensor for most expensive hour as end time instead of the number value? That should accomplish what iā€™m after. I will try that, thank you!

Good suggestion, looks like exactly what @lemehavit needs

Can confirm that it worked just as intended. Thanks again for the assistance, greatly appreciated!