cool… thank you!
same issue here… Now , I’ve created the new sensor that includes the forecast info. it has all the data
But how do you replace the code you mentioned at the beginning with “new version” to keep Plotly working as before?
filters:
- fn: |-
({ meta, vars }) => ({
xs: […meta.forecast.map(({ datetime }) => new Date(datetime))],
ys: […meta.forecast.map(({ temperature }) => temperature)],
})
(note that since the get_forecasts service places the forecast under hourly > ‘weather.weather_channel’ which itself contains a period, I have to use square bracket indexing [ … ] instead of the dot (.) operator to access the forecast list. “hourly.weather.weather_channel.forecast” will not work)
In the chart card
- entity: sensor.weather_channel_forecast_hourly
unit_of_measurement: °F
filters:
- fn: |-
({ meta, vars }) => ({
xs: [...meta.forecast.map(({ datetime }) => new Date(datetime))],
ys: [...meta.forecast.map(({ temperature }) => temperature)],
})