Garage door template cover without entity_id

I know that the use of entity_id has been depricated and am trying to tidy up my config to get rid of someof the errors. My garage door covers follow the template cover example given in the documentation - which still uses the entity_id for the action:

cover:
  - platform: template
    covers:
      left_garage_door:
        device_class: garage
        friendly_name: "Left Garage Door Controller"
        value_template: "{{ is_state('binary_sensor.left_garage_door_sensor', 'on') }}"
        open_cover:
          - service: switch.turn_on
            data:
              entity_id: switch.left_garage_door_open_switch
        close_cover:
          - service: switch.turn_on
            data:
              entity_id: switch.left_garage_door_close_switch
        icon_template: >-
          {% if is_state('binary_sensor.left_garage_door_sensor', 'on') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}
      right_garage_door:
        device_class: garage
        friendly_name: "Right Garage Door Controller"
        value_template: "{{ is_state('binary_sensor.right_garage_door_sensor', 'on') }}"
        open_cover:
          - service: switch.turn_on
            data:
              entity_id: switch.right_garage_door_open_switch
        close_cover:
          - service: switch.turn_on
            data:
              entity_id: switch.right_garage_door_close_switch
        icon_template: >-
          {% if is_state('binary_sensor.right_garage_door_sensor', 'on') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

So if I remove the entity_id, how can the script identify which script to turn on? Thanks!

I don’t understand your question. The entity_id deprecation was for template sensors/binary sensors not for covers and especially not for actions.

1 Like

Hmmmm…OK. Perhaps it was a stupid question and I was looking in the wrong place. I must have another entity_id somewhere in a sensor…

Does it work?

Do you get any errora in the logs regarding entity_id? To find them check all your template sensors and temolate binary sensors.

The cover works fine… I think the issue is my irrigation automation which sits in a separate file - it has a time based template. I have commented out the entity_ids from there and will see if the log error goes away…

Please don’t blindly comment out entity_id from your automations. Try to understand what you’re doing.

The entity_id deprecation was for template sensors as @Burningstone has already mentioned twice.

1 Like

OK - got it. I was being stupid. The ones that I have commented out were in template binary sensors and the error appears to have gone.

My bad. Thanks for the help.

1 Like