Good Morning. I’ve stood up HA about 3 weeks ago and have multiple switches and lights working, but I can’t seem to get both garage doors working. I’m using the cover template because I want to have some logic about when up and down can be used. If I create this code it works great.
indent preformatted text by 4 spaces
cover:
- platform: template
covers:
garage_door:
friendly_name: “Neals Garage Door”
icon_template: “{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) %}mdi:garage-open{% else %}mdi:garage{% endif %}”
value_template: “{{ is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) }}”
open_cover:
service_template: >
{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘off’) %}
switch.turn_on
{% endif %}
entity_id: switch.Neals_Garage_Door_Switch
close_cover:
service_template: >
{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) %}
switch.turn_on
{% endif %}
entity_id: switch.Neals_Garage_Door_Switch
But when I try to duplicate it for the second garage door, only the last door shows up.:
cover:
-
platform: template
covers:
garage_door:
friendly_name: “Neals Garage Door”
icon_template: “{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) %}mdi:garage-open{% else %}mdi:garage{% endif %}”
value_template: “{{ is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) }}”
open_cover:
service_template: >
{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘off’) %}
switch.turn_on
{% endif %}
entity_id: switch.Neals_Garage_Door_Switch
close_cover:
service_template: >
{% if is_state(‘binary_sensor.Neals_Door_Contact’, ‘on’) %}
switch.turn_on
{% endif %}
entity_id: switch.Neals_Garage_Door_Switch -
platform: template
covers:
garage_door:
friendly_name: “Theresas Garage Door”
icon_template: “{% if is_state(‘binary_sensor.Theresas_Door_Contact’, ‘on’) %}mdi:garage-open{% else %}mdi:garage{% endif %}”
value_template: “{{ is_state(‘binary_sensor.Theresas_Door_Contact’, ‘on’) }}”
open_cover:
service_template: >
#{% if is_state(‘binary_sensor.Theresas_Door_Contact’, ‘off’) %}
switch.turn_on
#{% endif %}
entity_id: switch.Theresas_Garage_Door_Switch
close_cover:
service_template: >
#{% if is_state(‘binary_sensor.Theresas_Door_Contact’, ‘on’) %}
switch.turn_on
#{% endif %}
entity_id: switch.Theresas_Garage_Door_Switch
What am I doing wrong?
Thanks,
Neal