I am following the Legacy binary_sensor template deprecation warning instructions to migrate all of my binary_sensor templates to templates.yaml from binary_sensors.yaml.
I have moved the following from binary_sensors.yaml
- platform: template
sensors:
living_room_tv:
friendly_name: 'Living Room TV'
value_template: >-
{%- if is_state("binary_sensor.livingroomtvping", "on") %}
On
{% else %}
Off
{%- endif %}
icon_template: mdi:television
and placed this in templates.yaml as instructed:
template:
- binary_sensor:
- default_entity_id: binary_sensor.living_room_tv
icon: mdi:television
name: Living Room TV
state: '{%- if is_state("binary_sensor.livingroomtvping", "on") %} On {% else %}
Off {%- endif %}'
When I do this, the binary_sensor template error goes away, but the following error appears instead:
Invalid config for ‘template’ at templates.yaml, line 121: Entity ID ‘binary_sensor.living_room_tv’ does not belong to domain ‘sensor’ for dictionary value ‘sensor->19->default_entity_id’, got ‘binary_sensor.living_room_tv’
Can someone please explain what this means?