Hi all,
I am trying to clean up errors and issues identified in my HA logs. One warning I have a lot of is, “WARNING (MainThread) [homeassistant.components.template.binary_sensor] The ‘entity_id’ option is deprecated, please remove it from your configuration” and “WARNING (MainThread) [homeassistant.components.template.sensor] The ‘entity_id’ option is deprecated, please remove it from your configuration”
These are two of the entity templates I have:
binary_sensor:
- platform: template
sensors:
downstairs_lights:
friendly_name: Downstairs Lights
device_class: light
entity_id: group.downstairs_lights
value_template: "{{ is_state('group.downstairs_lights', 'on') }}"
icon_template: >-
{% if is_state('group.downstairs_lights', 'on') %}
mdi:lightbulb-group
{% elif is_state('group.downstairs_lights', 'off') %}
mdi:lightbulb-group-off
{% else %}
mdi:alert
{% endif %}
- platform: template
sensors:
## Zooz Switches
kitchen_light_switch:
friendly_name: Kitchen Light Switch
device_class: connectivity
entity_id: light.kitchen_lights_15
value_template: "{{ is_state('light.kitchen_lights_15', 'on') }}"
icon_template: >-
{% if is_state('light.kitchen_lights_15', 'on') %}
mdi:toggle-switch
{% else %}
mdi:alert
{% endif %}
If I comment out the ‘entity_id: group.downstairs_lights’ line (for example), then the icon stops working in Lovelace. I tried to figure out how to change the code to work without using ‘entity_id’ from reading the online docs, but I am not seeing what I am doing wrong. Can someone help?
Thanks,
Rick