Does it work like this?
{% from 'cheapest_energy_hours.jinja' import cheapest_energy_hours %}
{{ cheapest_energy_hours('sensor.dynamische_prijzen_elektriciteit_average_electricity_price_today', attr_today='prices_today', hours=1, lowest=False, mode='max', value_key='price', time_key='time') }}
You were missing time_key
and value_key
in your template. The macro should have told you that, but there was an issue which should be fixed in 3.0.1 now