I have a gate and garage door set up through ESP home with magnetic sensors to detect the door state. With the cover template in ESPHome, the doors show up correctly in Home Assistant and the correct buttons are disabled depending on whether the door is open or closed.
However, when I use Google Assistant or Alexa, they ignore whether the door is open or closed. So when I say “close the garage”, it will open it if the garage is already closed. Is this a known issue or am I doing something wrong?
The following is my ESPHome configuration for my gate. The garage is pretty much the same.
switch:
- platform: gpio
pin: 16
id: gate_relay
name: "Gate Remote Relay"
inverted: false
internal: true
binary_sensor:
- platform: gpio
pin:
number: 12
inverted: false
mode:
input: true
pullup: true
name: "Gate door sensor"
id: gate_sensor
internal: true
cover:
- platform: template
device_class: gate
name: "Gate"
id: gate
lambda: |-
if (id(gate_sensor).state) {
return COVER_OPEN;
} else {
return COVER_CLOSED;
}
open_action:
- switch.turn_on: gate_relay
- delay: 1s
- switch.turn_off: gate_relay
close_action:
- switch.turn_on: gate_relay
- delay: 1s
- switch.turn_off: gate_relay