I’m trying to split my sensor templates configuration, but when I move working templates to a separate file it no longer works.
I know there are ways to merge directories etc. But I would like this simple way to work.
It’s documented on Splitting up the configuration - Home Assistant (search for multiple top-level
).
Why does this work:
configuration.yaml
template:
- binary_sensor:
- name: "Living Room HVAC Off"
state: >
{{ is_state('climate.living_room_hvac_2', 'off') }}
- sensor:
- name: Heating Living Room
state: >
{{ state_attr('climate.living_room', 'temperature') }}
icon: >
{% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
mdi:radiator
{% else %}
mdi:radiator-disabled
{% endif %}
But this doesn’t:
configuration.yaml
template:
- binary_sensor:
- name: "Living Room HVAC Off"
state: >
{{ is_state('climate.living_room_hvac_2', 'off') }}
template heating: !include heating.yaml
heating.yaml
- sensor:
- name: Heating Living Room
state: >
{{ state_attr('climate.living_room', 'temperature') }}
icon: >
{% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
mdi:radiator
{% else %}
mdi:radiator-disabled
{% endif %}
I’m not getting any errors. The sensor just does not show up…
Thanks.