Automating a MQTT device to trigger a non MQTT device

Hmm…I’ve done that and chose WLED as the target. It does work when hitting run, but doesn’t work when opening the door. It seems it is just running the action without waiting for the trigger, and either the opener isn’t pulling the mqtt state from the ratgdo or something isn’t subscribed to it to pass it to WLED?

Open the RATGDO in home assistant and then manually open the garage door with the wall switch. Watch the status of the RAGTDO in HA and see if it changes.
It should be an instant status change. I Believe it will show as opening first and then opened after it is fully open.

Whenever possible avoid using devices. Use entities instead.
Devices might have its state linked to another of its entities than you expect and devices will cause you head aches if you have to replace them at a later time, because automations have to be redone completely, not just edited.

I changed trigger to state (I’ve already tried mqtt and device)/entity ratgdo door, with the call service light action but it doesn’t work

Both up and down arrows are available in HA and don’t change. Both arrows can be clicked for up and both arrows can be clicked for down. I think it’s my older opener or wiring issue.

Post the automation in YAML format.


Great you see the device, but can you actually see the ratgdo mqtt device changing state as well??
If the sensor is available in HA, it should react on open/close :thinking:

You could also skip the sensor altogether and only listen to the mqtt topic?

from file editor/homeassistant/automations.yaml

- id: '1704057702842'
  alias: Garage Gym Open WLED On
  description: ''
  - platform: state
    - cover.ratgdo_24534_door
  condition: []
  - service: light.turn_on
      entity_id: light.wled
    data: {}
  mode: single

I have read through that link and this a part I don’t understand. I can’t flash ratgdo with the esphome version (easiest option) because it won’t give me the “dry contact” option.
So I flashed with the mqtt version to give me dry contact option.
In the esp I set the topic prefix to /home/garage/gym/ratgdo
In an mqtt app under my broker I see HA and 2 ratgdo even tho I only have 1, I flashed multiple times getting setup right but 28243 is no longer in HA and was deleted, but it’s showing online.
If I look at homeassistant, this is what I see (screenshots) for ratgdo
What do I listen for?

The automation you posted is designed to turn on light.wled when it detects any change in the value of cover.ratgdo_24534_door.

Run the automation manually (using its Run command). That won’t test the automation’s trigger but it will test the automation’s action. In other words, the light should turn on. If the light fails to turn on then there’s a problem with it and has to be fixed before proceeding with any additional testing of the automation.

If the light does turn on, turn it off and then open the garage door. The state of cover.ratgdo_24534_door should change (you can check its state value in Developer Tools> States).

If it does change, it will trigger the automation and produce a trace containing all the details of the automation’s execution. It should also turn on the light.

If it doesn’t change then there’s a problem with the cover entity and needs to be fixed before proceeding with any additional testing of the automation.

Yes we tested and clicking run in the automation still triggers and turns on WLED. However you are onto something. In developer tools/state the ratgdo door and light state are unknown. I tried setting the state to “close” and it didn’t work.

I think it’s safe to say that the following step, in my suggested testing procedure, produced a 100% failure.

The state of cover.ratgdo_24534_door should change (you can check its state value in Developer Tools> States).

unknown implies the entity (cover.ratgdo_24534_door) has not received any data from its integration. So now we’re at the last step:

If it doesn’t change then there’s a problem with the cover entity and needs to be fixed before proceeding with any additional testing of the automation

Given that the cover entity relies on the MQTT integration, you should now focus on confirming that it was correctly installed and configured.

Go to Settings > Devices & Services > MQTT > Configure > Re-Configure.

The form that is displayed contains the Username and Password that Home Assistant will use to connect to the broker. Take note of it. Alternately, if it doesn’t exist, let me know and I’ll explain what to do next.

Having taken note of the Username, restart the MQTT broker Add-on then, after about 15 seconds, check its log for any record of Home Assistant connecting to the broker. Look for the Username.

If there’s no evidence of it then Home Assistant’s MQTT integration is still misconfigured.

I’ll do that now. I had created a person mqtt user and password.
Also in settings/devices/mqtt/ it says there is 1 device and 3 entities (door, light, obstruction) but when I click device there is only 1 sensor (obstruction =clear) no sensor for door. If that helps.

In devices/mqtt/devices/ratgdo logbook it shows obstruction became cleared but light and door went from became unavailable to became unknown.

I think it must be a wiring or config issue with ratgdo itself.

Do you mean a User account?

What did you name the User account? Is it MQTT_user? Your broker’s log shows two different clients have connected using the same account. In other words, one account has been used to create two separate connection sessions (one session is evidently the ratgdo and the other is unclear, perhaps Home Assistant).

FWIW, I created several User accounts for connecting to the MQTT broker. One is dedicated for use by Home Assistant. Another is shared by all Tasmota devices. Yet another is used by MQTT Explorer. It makes it easy to see (in the log) who is/isn’t connected and easy to revoke access for one MQTT user without affecting other MQTT users.

Yes I created a person MQTT_user in settings/people. It also added it to users along with my name, home assistant content, and supervisor.
I’ve used those credentials in the ratgdo mqtt config. In that config I also set the topic to home/garage/gym/ratgdo-24534
In my MQTT analyzer app I see messages for ratgdo-24534 and also home/garage/gym/ratgdo-24534
Could it be connecting twice?

Why? That’s for actual people who might have multiple device_trackers associated to them.

Anyway, the screenshots you posted show that ratgdo is publishing MQTT Discovery payloads. In other words, it’s attempting to create entities in Home Assistant. In a previous screenshot, it shows that those entities were created. That means Home Assistant is connected to the MQTT broker. So far, so good.

The cover entity is configured is configured to receive its status via this topic (or at least I think it ends with state because that part is cutoff in the screenshot):


Use an MQTT client, like MQTT Explorer, to check that topic, it should contain values representing the garage door’s current state.

I installed mqtt explorer. I cleared a couple retained topics from what I believe were previous failed installs and that removed the duplicate ratgdo from the left side.
I see state topic on the right is status/door.
But on the left I onky see status for availability or obstruction, not opened or closed.

The MQTT Discovery payload creates an MQTT Cover designed to subscribe to the following topic:


That topic is not displayed in MQTT Explorer which implies nothing has ever been published to it yet.

I don’t know why the following three topics are present (possibly related to some previous configuration attempts?) because they don’t have the structure defined in the MQTT Discovery payload.


The MQTT Discovery payload creates topics that all begin with:


That’s the meaning of the first line in the discovery payload:

"~": "/home/garage/gym/ratgdoratgdo-24534",

Your ratdgo device doesn’t appear to have published any status information yet.

Well then that takes me back to either the opener doesn’t provide that status, or it’s not wired correctly. I’ll keep reading about the ratgdo and see if I can find something I missed.
The good news is that I have learned a ton about mqtt, and reading logs, I really appreciate the help thank you.