Can someone help me figure out how to write the below in a way that satisfies home assistant? I am getting all of the warning/ errors shown in the second code post below when checking the config in developer tools.
Thank you all.
It should be worth noting that I have other platforms in the same yaml file.
Also, how do you know when to use “sensor” or “sensors” as a key. I am seeing both through the reviewing of other code blocks.
- platform: template
trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecasts
data:
type: twice_daily
target:
entity_id: weather.home_accuweather
response_variable: x
sensors:
name: Current Forecast
state: "{{ now().isoformat() }}"
attributes:
forecast: >-
{{ x['weather.home_accuweather'].forecast[0] }}
temperature: >-
{{ x['weather.home_accuweather'].forecast[0].temperature }}
templow: >-
{{ x['weather.home_accuweather'].forecast[0].templow }}
wind_bearing: >-
{{ x['weather.home_accuweather'].forecast[0].wind_bearing }}
wind_speed: >-
{{ x['weather.home_accuweather'].forecast[0].wind_speed }}
precipitation: >-
{{ x['weather.home_accuweather'].forecast[0].precipitation }}
Configuration warnings
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 102: 'action' is an invalid option for 'sensor.template', check: action
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 110: expected dictionary for dictionary value 'sensors->name', got 'Current Forecast'
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 111: expected dictionary for dictionary value 'sensors->state', got '{{ now().isoformat() }}'
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 112: required key 'value_template' not provided
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 113: 'forecast' is an invalid option for 'sensor.template', check: sensors->attributes->forecast
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 115: 'temperature' is an invalid option for 'sensor.template', check: sensors->attributes->temperature
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 117: 'templow' is an invalid option for 'sensor.template', check: sensors->attributes->templow
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 119: 'wind_bearing' is an invalid option for 'sensor.template', check: sensors->attributes->wind_bearing
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 121: 'wind_speed' is an invalid option for 'sensor.template', check: sensors->attributes->wind_speed
Invalid config for 'template' from integration 'sensor' at packages/weather.yaml, line 123: 'precipitation' is an invalid option for 'sensor.template', check: sensors->attributes->precipitation