Thanks, that works perfectly!
I would like to extend it to also show the forecast for yesterday (as it shows the yesterdays production anyway), but I am struggling to find a way to do so.
Unless I am missing something, the Solcast integration doesn’t provide historical data of the detailedForecast attribute so I am trying to copy it to another entity like this:
template:
- trigger:
- platform: time_pattern
hours: 0
minutes: 0
- sensor:
- name: "Solar Forecast Yesterday"
state: "{{ states('sensor.solcast_pv_forecast_forecast_today') | float(0.0) }}"
attributes:
detailedForecast: "{{ state_attr('sensor.solcast_pv_forecast_forecast_today', 'detailedForecast') | list }}"
I am not completely sure I have the trigger correct but main issue is, that whole on the original entity the data looks like this:
detailedForecast:
- period_start: '2023-09-14T00:00:00+02:00'
pv_estimate: 0
pv_estimate10: 0
pv_estimate90: 0
- period_start: '2023-09-14T00:30:00+02:00'
pv_estimate: 0
pv_estimate10: 0
pv_estimate90: 0
On the copy the formatting seems to be lost:
detailedForecast: [{'period_start': datetime.datetime(2023, 9, 14, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague')), 'pv_estimate': 0, 'pv_estimate10': 0, 'pv_estimate90': 0}, {'period_start': datetime.datetime(2023, 9, 14, 0, 30, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague')), 'pv_estimate': 0, 'pv_estimate10': 0, 'pv_estimate90': 0},
As expected the ApexCharts card is unable to extract data from that
Any advice what am I doing wrong?