For my Garage Door, I have a simple ESPHome ESP32 controlling a single relay to simulate the Garage Door Controller button. The pressing of the button toggles the garage door to open or close.
switch:
- platform: gpio
id: relay
pin: GPIO17
restore_mode: RESTORE_DEFAULT_OFF
button:
- platform: template
name: "Garage Door Control"
on_press:
- switch.turn_on: relay
- delay: 650ms
- switch.turn_off: relay
binary_sensor:
- platform: gpio
device_class: garage_door
icon: mdi:garage-variant
pin:
number: GPIO16
mode: INPUT_PULLUP
inverted: true
name: "Door Status"
For voice control via my voice satellites, I have a voice-sentence - triggered automation. When the sentence is said, the automation presses the button to open or close the garage door. I have taken this approach as the Garage Door ESP Home device is currently not a “Cover” and hence, I cannot directly issue a “Open or close Garage Door” voice command. But this approach works well.
I would like to make my Garage Door device or the button a “Cover” device/entity, so that I can then expose the button to the Voice Assistant directly and use the standard cover commands directly, avoiding the need for an automation.
I explored the ESPHome Cover component, the Simple Garage Door example and various Garage Door posts which are mostly around getting more precise status of the door. I also can’t assign the device_class for the button as “Cover” either as that is not valid for buttons.
Wondering if anyone has a simple ESPHome garage door toggle example that makes the ESP device and/or the button a device_class = cover, that I can use as a base to change my code.
Is there a more efficient/simpler approach to getting the voice assistant to push a ESPHome button? Or is my current approach via an automation already optimal?
Hope this makes sense … any help would be much appreciated