Combine attributes from multiple sensors to a weather forecast sensor

Since 2021.3 introducing Template Weather Provider, i want to make a custom weather card base on my local weather station’s api

Below is the weather forecast attribute from openweathermap

forecast: 
- datetime: '2021-03-10T04:00:00+00:00'
  condition: cloudy
  temperature: 21
  templow: 19.4
- datetime: '2021-03-11T04:00:00+00:00'
  condition: partlycloudy
  temperature: 22.7
  templow: 18.7

i can’t figure out how to replicate the weather forecast format (multiple array) by using attribute_templates

thanks

Any help? thanks

The forecast atttribute contains a list. Each item in the list contains one day’s worth of weather data.

Paste this into the Template Editor and change the name of the entity to match your openweathermap entity:

{{ state_attr('weather.openweathermap', 'forecast')[0].temperature }}

It will report the value of temperature from the first (zeroth) item in the forecast list.

I believe the question is the other way around.
Have values but how to create the same output (list as attributes).

If the question is the other way around then the OP should create a template that generates a list in the format required by forecast.

Challenging to provide more guidance until more information is provided.

You are right, a couple of values from local weather api to rest sensor but in difficult to create the attribute of weather forecast

I have a list of rest sensors, e.g.
sensor.forecast_0_date
sensor.forecast_1_date
sensor.forecast_0_temp
sensor.forecast_1_temp
sensor.forecast_0_condition
sensor.forecast_1_condition
but i cant figure out how to use attribute_template to make a whole new weather forecast sensor to match the format as the first post