The macro will try to find the right time_key and value_key itself if it doesn’t match the default, no need to provide it anymore
Added an option to provide attr_all in case the source senor provides an attribute with both the prices for today and tomorrow combined. This defaults to prices which is the attribute provided by the ENTSO-e integration
Hey Martijn, can you give an example, how to use this?
are we supposed to create a template sensor for every “load” we want to know the starting hours, and then use this sensor in an automation with time trigger?
The macro can provide you with datetimes and prices (and combinations of them). It’s up to your imagination how to use it
As you can see a few posts above you can use it on your dashboard, but you can also use it to find the optimal time to start your washing machine, or when to charge your car.
BTW, is your sensor now showing today’s data again for the prices_today attribute? I have an API key now, and for me the ENTSO-e integration is showing the correct data.
BTW lowest defaults to true and hours defaults to 1 and if you only output one hour, the mode time_min will display the same as the default mode start. So this will output the same as your current settings:
{% from 'cheapest_energy_hours.jinja' import cheapest_energy_hours %}
{% set sensor = 'sensor.steven_average_electricity_price_today' %}
{{ cheapest_energy_hours(sensor, mode='max') }}
{{ cheapest_energy_hours(sensor, time_format='time24') }}
Nice, got it !
Another question, I hope you don’t curse me
Would it also be possible to round the price to 3 decimals in the jinja macro? For now I have created a template sensor with