Cheapest-energy-hours: outputs time outside start/end window

Hi all, I installed the cheapest-energy-hours macro to predict the best times to charge my home battery. I use the following helper:

{% from 'cheapest_energy_hours.jinja' import cheapest_energy_hours %}
{{ cheapest_energy_hours(sensor='sensor.zonneplan_current_tariff', hours=4, start='06:00', end='17:00', include_tomorrow=true) }}

This worked fine until today. The current output is: “2026-03-25 01:00:00+01:00”. As It happens energy prices in the coming night are lower/equally low as tomorrow during the day.

This time is outside the specified start and end times in the call. I must be missing something, what am I doing wrong?

Please note, I have tried to include look_ahead=true but that doesn’t solve it as 1:00h is also in the future. I can also exclude today with include_today=false but then the current day will be completely skipped every midnight.

Answering my own question: it is sufficient if the macro looks at today.

So removing the “include_tomorrow=true” did the trick.

The only downside is that the macro will only output the correct time for tomorrow after midnight.

If you are in Europe then the energy.marlwts have almost all moved to a 15- minute window instead of an 1-hour window, but some of the older integrations are not maintained that well and have not been updated to take this change into account.

Thanks, my provider (Zonneplan) is still on 1-hour windows.