Hi,
I’ve just started using HomeAssistant, and set up a Shelly1 running ESPHome in order to open my garage door (I have a Liftmaster Pro). The garage door requires a debounce on dry contact (aka momentary switch), so I’ve configured an output button, and use a cover template to make it appear as a garage door. In HA, this works perfectly (see ESPHome config below).
I imported it into HA, and when I press “open”, it closes the relay for 200ms, then opens it, triggering the door to open.
I also have the Google Assistant integration, where the device appears when sync’ed (as do my other devices), but the GA garage door is working like as if I’m handling the underlying relay, requiring two actions to work (If I open, then close the garage door in GA, after the second action it works), instead of working the same way the HA cover works.
Is there something I can do to get the GA garage door to behave properly? I know the underlying GA protocol, and I’m reading the code in traits.py, but it’s not clear to me why the cover behavior isn’t taking effect via GA.
esphome:
name: garagedoor
esp8266:
board: esp01_1m
logger:
api:
encryption:
key: SOME_KEY
ota:
password: SOME_PASSWORD
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: SOME_IP
gateway: SOME_GATEWAY
subnet: SOME_SUBNET
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Garagedoor Fallback Hotspot"
password: SOME_PASSWORD
output:
- platform: gpio
pin:
number: GPIO4
id: relay
button:
- platform: output
name: "Garage Door Relay"
output: relay
duration: 200ms
id: door_button
internal: true
binary_sensor:
- platform: gpio
pin: GPIO5
name: "Garage Door Contact Sensor"
id: contact_sensor
internal: true
filters:
- invert:
- delayed_on_off: 500ms
cover:
- platform: template
device_class: garage
name: "Garage Door"
id: template_cov
lambda: |-
if (id(contact_sensor).state) {
return COVER_OPEN;
} else {
return COVER_CLOSED;
}
open_action:
- button.press: door_button
close_action:
- button.press: door_button
stop_action:
- button.press: door_button
text_sensor:
- platform: wifi_info
ip_address:
name: $friendly_name IP Address
sensor:
- platform: wifi_signal
name: $friendly_name WiFi Strength
update_interval: 60s
- platform: uptime
name: $friendly_name "Uptime"
captive_portal: