Trying to remove MQTT yaml for sonoff garage cover

With the latest major update I got a warning that I need to remove my MQTT hardcoded yaml references.
Most were easily removed but I had issues with my clothes washer state and garage door. The most concerning is my garage door. I can open/close it as a dumb switch but I don’t know how to configure it to monitor its current status.
I followed Dr Zzs video for this years ago for the install and its been working flawlessly:

I did use the helper to switch the switch type to cover which worked very well but how can i get a status sensor of if its open or closed?

This is the Device info (in the open state which is the same for the closed state):

Other people must be going through the same thing I am right now and help would be greatly appreciated.

I’m finding the same thing myself. For now the cover is still working so i have put it in the “too hard” basket. You are not alone my friend. I don’t have an answer yet though.

Where did you see that? if it’s in the logs can you post the warning you are getting?

the MQTT syntax has changed but I haven’t seen anything about it going to UI only and that you can’t have yaml MQTT devices/entities.

Here is a screenshot of the repair notice.

I just restored my current backup after I couldn’t get it working properly.

I love the HA backups but I’m going to have to fix this eventually.

Maybe post your current config, then we can say what needs to be changed.

Here is the cover section in my configuration.yaml.

cover:

  • platform: mqtt

    name: “sonoff_sv_garage”

    state_topic: “cmnd/garagestate/POWER2”

    command_topic: “cmnd/sonoff_sv_garage/POWER”

    payload_open: “ON”

    payload_close: “ON”

    payload_stop: “ON”

    state_open: “ON”

    state_closed: “OFF”

optimistic: false

retain: false

Sorry about the code format. I’m replying on my phone at work.

I migrated to the new syntax and it is working (status included):

mqtt:
  cover:
    - name: "Garage1"
      state_topic: "cmnd/3/POWER2"
      command_topic: "cmnd/NodeMCU06/POWER"
      payload_open: "ON"
      payload_close: "ON"
      payload_stop: "ON"
      state_open: "ON"
      state_closed: "OFF"
      optimistic: false
      retain: false

My problem is that I have done this for sensors, switches, lights, covers, but still having the same alert that is something wrong.

have you restarted Home Assistant?

Right. That notice says nothing at all about removing hard coded yaml configuration.

it says that the MQTT yaml syntax has changed.

did you follow the link to the docs to see what needs to be changed? It’s not nearly as hard as people are making it out to be.

it’s literally from this:

cover:
  - platform: mqtt
    name: something
.
.

to this:

mqtt:
  cover:
    - name: something
.
.
1 Like

Yes. Sure.

1 Like

Thank you very much I will make this change when I get home from work tonight.

In my defense the error says my manual configured cover and move to the mqtt integration key. I read that as use the integration not yaml. I’m sorry and thanks again I really appreciate how great this community is.

Yes, pretty much everything in HA is configured via an “integration”.

Some integrations are configured via the UI and others are configured via yaml. And still others can be configured either way per the users preference.

And “key” indicates the way yaml is written. it uses key:value pairs. Which can be further broken down into lists (using the “-” to denote list members) and dictionaries. And even lists of dictionaries.

so when it said to move it to the mqtt key it meant to move it from the “sensor:” key to the “mqtt:” key.

there are no “keys” per se when moving to the UI. It’s just configured via UI fields and drop-downs.

1 Like

This works for the cover and removes the error / repair notice but I have still lost the state of the garage door. I did rename the topic but I believe I updated it correctly because the button to open / close does work.

Updated code:

mqtt:
  cover:
    - name: "garage_cover_sonoff"
      state_topic: "cmnd/garage_cover/POWER2"
      command_topic: "cmnd/garage_cover/POWER"
      payload_open: "ON"
      payload_close: "ON"
      payload_stop: "ON"
      state_open: "ON"
      state_closed: "OFF"
      optimistic: false
      retain: false

Tasmota mqtt settings:

Sensor info:
garage2

But the switch does work:
switch

Use the button image in order to keep code identing correct.
I don´t know what the problem could be, since the syntax is the same but “mqtt: > cover:” thing.
Mine worked out of the box, including states. Posting the correct identing may help.

Thanks for the tip. I will look into this more tonight.

I’m not really sure why just updating the config syntax would have broken that portion only. As far as I know nothing else changed.

But looking at the mqtt cover docs it says that the state_topic can only be “State topic can only read (open , opening , closed , closing or stopped ) state.”

So I’m not sure why it worked before and not now even tho your payloads weren’t correct even before.

First tho, I see a couple of things…

It’s been a while since I’ve messed with tasmota stuff but I tyhought the state topics all started with “stat/something…”. So again make sure the state topic is correct.

another thing is that the two cover topics for the before and after are different.

the before was

state_topic: “cmnd/garagestate/POWER2”
command_topic: “cmnd/sonoff_sv_garage/POWER”

now they are:

state_topic: "cmnd/garage_cover/POWER2"
command_topic: "cmnd/garage_cover/POWER"

which is correct and why are they now different?

1 Like

I renamed my the switch in tasmota when I was initially trying to get this working. Yes I should have just left it alone.

details from tasmota:

MQTT Client	Garage_door_cover
MQTT Topic	garage_cover
MQTT Group Topic 1	cmnd/sonoffs/
MQTT Full Topic	cmnd/garage_cover/
MQTT Fallback Topic	cmnd/Garage_door_cover_fb/
MQTT No Retain	Disabled

I believe is everything is correct but I’m home from work now and will start to review all my changes.

Since I changed the topic name, I needed to update more than just the configuration.yaml.
There were two references one in the customize.yaml and the other in groups.yaml

You guys have been awesome and supportive thank you so much. The main solution was posted by finity with a simple yaml code update.

2 Likes