#─────────────────────────────────────────────────────────────────────────────── # Description: #─────────────────────────────────────────────────────────────────────────────── # Card to display solar production forecast for the next 24 hours including # details on energy import and export rates. # # A sensor with the hourly weather forecast stored as attributes is required. # As of version 2024.4, the weather integration no longer includes forecast data # as attributes. A new template sensor must be created to get the forecast data. # See more here: # # https://community.home-assistant.io/t/update-from-using-weather-attributes-with-the-new-service-weather-get-forecasts/702736/1 # # Solar forecast is based on the Solcast integration: # # https://github.com/oziee/ha-solcast-solar # # Energy import and export rates are based on the Energi Data Service # integration: # # https://github.com/MTrab/energidataservice #─────────────────────────────────────────────────────────────────────────────── type: markdown content: > {%- set import_rates = "sensor.import_rates" -%} {%- set export_rates = "sensor.export_rates" -%} {%- set solar_forecast0 = "sensor.solcast_pv_forecast_forecast_today" -%} {%- set solar_forecast1 = "sensor.solcast_pv_forecast_forecast_tomorrow" -%} {%- set hourly_weather = "sensor.weather_hourly" -%}
Tidspunkt |
Timepris for køb / salg | Estimeret produktion |
|
|---|---|---|---|
| Nu | {{ "%.2f"|format(state_attr(import_rates,"raw_today")[now().hour].price)}} / {{ "%.2f"|format(state_attr(export_rates,"raw_today")[now().hour].price)}} | {{"%.0f"|format((state_attr(solar_forecast0,"detailedHourly")[now().hour].pv_estimate*1000))}} W | |
| |
{{ d }} {{w.datetime | as_timestamp | timestamp_custom('%H.00', local=True) -}} | {% if d=='I dag' %}{{ "%.2f"|format(state_attr(import_rates,"raw_today")[h.hour].price)}} / {{ "%.2f"|format(state_attr(export_rates,"raw_today")[h.hour].price)}} | {{ "%.0f"|format((state_attr(solar_forecast0,"detailedHourly")[h.hour].pv_estimate*1000))}} W | {{ "%.2f"|format(state_attr(import_rates,"raw_tomorrow")[h.hour].price)}} / {{ "%.2f"|format(state_attr(export_rates,"raw_tomorrow")[h.hour].price)}} | {% else %}{% endif %} | {{ "%.0f"|format((state_attr(solar_forecast1,"detailedHourly")[h.hour].pv_estimate*1000))}} W | {% endif %} {% endfor -%}