That doesn’t seem to work, either. I load my sensors thru yaml includes via sensor: !include_dir_merge_list includes/sensors
.
Using this block:
- platform: template
# Old weather style
trigger:
- platform: time_pattern
hours: /1
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.openweathermap
response_variable: daily
sensor:
- name: Old forecast style weather
state: "{{ states('weather.openweathermap') }}"
attributes:
temperature: "{{ state_attr('weather.openweathermap', 'temperature') }}"
dew_point: "{{ state_attr('weather.openweathermap', 'dew_point') }}"
temperature_unit: "{{ state_attr('weather.openweathermap', 'temperature_unit') }}"
humidity: "{{ state_attr('weather.openweathermap', 'humidity') }}"
cloud_coverage: "{{ state_attr('weather.openweathermap', 'cloud_coverage') }}"
pressure: "{{ state_attr('weather.openweathermap', 'pressure') }}"
pressure_unit: "{{ state_attr('weather.openweathermap', 'pressure_unit') }}"
wind_bearing: "{{ state_attr('weather.openweathermap', 'wind_bearing') }}"
wind_speed: "{{ state_attr('weather.openweathermap', 'wind_speed') }}"
wind_speed_unit: "{{ state_attr('weather.openweathermap', 'wind_speed_unit') }}"
visibility_unit: "{{ state_attr('weather.openweathermap', 'visibility_unit') }}"
precipitation_unit: "{{ state_attr('weather.openweathermap', 'precipitation_unit') }}"
forecast: "{{ daily['weather.openweathermap'].forecast }}"
The YAML check complains:
Invalid config for 'template' from integration 'sensor' at includes/sensors/weather.yaml, line 257: required key 'sensors' not provided
Invalid config for 'template' from integration 'sensor' at includes/sensors/weather.yaml, line 264: 'action' is an invalid option for 'sensor.template', check: action
Invalid config for 'template' from integration 'sensor' at includes/sensors/weather.yaml, line 271: 'sensor' is an invalid option for 'sensor.template', check: sensor
Changing sensor
to sensors
gives different validation errors:
Invalid config for 'template' from integration 'sensor' at includes/sensors/weather.yaml, line 264: 'action' is an invalid option for 'sensor.template', check: action
Invalid config for 'template' from integration 'sensor' at includes/sensors/weather.yaml, line 271: expected dictionary for dictionary value 'sensors', got [{'name': 'Old forecast style weather', 'state': "{{ states('weather.openweathermap') }}", 'attributes': {'temperature': "{{ state_attr('weather.openweathermap', 'temperature') }}", 'dew_point': "{{ state_attr('weather.openweathermap', 'dew_point') }}", 'temperature_unit': "{{ state_attr('weather.openweathermap', 'temperature_unit') }}", 'humidity': "{{ state_attr('weather.openweathermap', 'humidity') }}", 'cloud_coverage': "{{ state_attr('weather.openweathermap', 'cloud_coverage') }}", 'pres
...