I recently updated HA (to 2021.11.5) and am noticing that on startup my garage doors cover group does not seem to be consistent with the individual covers, but I’m not 100% sure it wasn’t doing this before. I’m wondering if I’m doing something wrong here or am missing a configuration option to avoid this issue.
Problem
On startup, the cover group shows an open state, but both individual covers have a closed state. It seems to correct itself after some interaction, but ultimately it seems like the cover group is not behaving correctly. See screenshot below:
Configuration
The garage doors device is a d1 mini lite, with hardwired reed switches and a 2 channel relay that hooks into the garage door controllers on the wall. Here is the important portion, but the ESPHome device and individual covers defined in HA work fine.
ESPHome
esphome:
name: garagedoors
platform: ESP8266
board: d1_mini_lite
# ...removed all the unrelated config here
binary_sensor:
- platform: gpio
id: garage1_sensor
pin:
number: GPIO12 #D8
mode: INPUT_PULLUP
inverted: True
name: "Garage Door 1 Sensor"
device_class: garage_door
filters:
- delayed_on: 20ms
- platform: gpio
id: garage2_sensor
pin:
number: GPIO13 #D7
mode: INPUT_PULLUP
inverted: True
name: "Garage Door 2 Sensor"
device_class: garage_door
filters:
- delayed_on: 20ms
switch:
- platform: gpio
id: relay
pin:
number: GPIO5 #D1
inverted: True
restore_mode: ALWAYS_OFF
- platform: template
name: "Garage Door 1 Switch"
icon: "mdi:garage"
turn_on_action:
- switch.turn_on: relay
- delay: 0.5s
- switch.turn_off: relay
- platform: gpio
id: relay2
pin:
number: GPIO4 #D2
inverted: True
restore_mode: ALWAYS_OFF
- platform: template
name: "Garage Door 2 Switch"
icon: "mdi:garage"
turn_on_action:
- switch.turn_on: relay2
- delay: 0.5s
- switch.turn_off: relay2
- platform: restart
name: 'Garage Door REBOOT'
Home Assistant
The home assistant configuration. I can’t recall why I defined the covers in home assistant, rather than esphome, but here is the home assistant portion:
cover:
- platform: template
covers:
left_garage_door:
friendly_name: "Garage Door (Left)"
value_template: "{{ is_state('binary_sensor.garage_door_1_sensor', 'on') }}"
open_cover:
- service: switch.turn_on
data:
entity_id: switch.garage_door_1_switch
close_cover:
- service: switch.turn_on
data:
entity_id: switch.garage_door_1_switch
icon_template: >-
{% if is_state('binary_sensor.garage_door_1_sensor', 'on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
right_garage_door:
friendly_name: "Garage Door (Right)"
value_template: "{{ is_state('binary_sensor.garage_door_2_sensor', 'on') }}"
open_cover:
- service: switch.turn_on
data:
entity_id: switch.garage_door_2_switch
close_cover:
- service: switch.turn_on
data:
entity_id: switch.garage_door_2_switch
icon_template: >-
{% if is_state('binary_sensor.garage_door_2_sensor', 'on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
- platform: group
name: Garage Doors
entities:
- cover.left_garage_door
- cover.right_garage_door