Garage Door State opening & closing state from mqtt sensor

Hi there,

I’m setting up an MQTT Cover with two sensors and a button to create a Garage Door opener.

While HA triggers the opening and closing states when I use HA to control the Garage Door, I could not find a way to send the opening or closing commands over MQTT from my sensors to HA when I operate the Garage Door manually. This way, when I open the door manually the state in HA will be OPENING when I open the door from it’s closed position or CLOSING when I close the door from its opened position.

Is this possible?

This is my setup:

cover:
  - platform: mqtt
    name: GarageDoor
    friendly_name: Garage
    state_topic: "stat/GarageDoor/DOOR"
    command_topic: "cmnd/GarageDoor/power1"
    availability_topic: "tele/GarageDoor/LWT"
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_closed: "CLOSED"
    state_opened: "OPENED"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false
    retain: false
    value_template: '{{ value }}'

 homeassistant:
    customize:
      cover.GarageDoor:
        device_class: garage

I’ve tried adding to the cover config:

state_closing: "CLOSING"
state_opening: "OPENING"

But that didn’t work unfortunately.

Do your sensors report information in HA? If so, you need to make an automation that publishes the opening and closing to the correct topic. If the sensors do not report information in home assistant, you need to make something that gets the sensors to publish information to the topics.

The sensors report OPENED & CLOSED
And they can also publish OPENING or CLOSING but the mqtt plugin in HA does not pick up the these commands.

Do I need to create an automation to manually set the Garage Door’s state when the OPENING or CLOSING commands are received on mqtt?