Stromligning for Home Assistant integrates Day Ahead spotprices for electricity, from the Stromligning API.
The integration automatically recognises tariff settings from the Home Assistant home location coordinates and allows you to select your electricity vendor.
Use the custom template to show the next x cheapest hours
My Home Assistant shortcut:
Or go to Home Assistant > Settings > Integrations
Add "Stromligning" integration (If it doesn't show, try CTRL+F5 to force a refresh of the page)
Copy the custom_templates/FindCheapestPrice.jinja
to the custom_templates
directory in your config folder (if it doesn't exist then create the folder)
Reload Home Assistant and use the Jinja template by inserting the example below in a template sensor helper
{% from 'FindCheapestPeriod.jinja' import FindCheapestPeriod%}
{% set earliestStartTime = now() %}
{% set latestStartTime = now() + timedelta(days=2) %}
{% set periodLength = timedelta(hours=3) %}
{{ FindCheapestPeriod(earliestStartTime , latestStartTime , periodLength, false) }}
This will result in a sensor showing the cheapest 3 hours within the known prices