A simple question for config

Hi,

I know that I have missed something simple but I cannot for the life of me remember what I have done wrong (I have had this working in the past as well… :grimacing:)

I am trying to get the garage door card to work, I can get the arrows to send the correct command but both arrows are always black (ie one doesn’t grey out)

This is my config

cover:
  - platform: mqtt
    name: "Chicken Coop"
    command_topic: "cmnd/tasmota_201B22/POWER"
    payload_open: "ON"
    payload_close: "OFF"
    payload_stop: "ON"
    state_topic: "cmnd/tasmota_201B22/POWER2"    
    state_open: "ON"
    state_closed: "OFF"
    optimistic: false

Can anyone help with where I am going wrong?
Regards
James

I wonder if the fact that the ON and STOP payloads are identical is your problem

You didn’t specify a position_topic, or define what position it is in.

Additionally, you’ve set optimistic mode to false. So it will NOT ever track the state and will never grey out any button.

Your options are:

  1. Define the position topic. If available, your device can report its position. It will use this to know if it’s currently opened or closed and grey out the right button.
  1. Turn on optimistic mode. This means that if you say “open”, it assumes it is open and will grey out the open button. Likewise, you say “close”, it assumes it is closed. It has no way to know the true state…so hopefully your open/close commands worked.

Many thanks for your replies. I’ve removed the payload stop and changed optimistic to true. The icon now changes to the correct state, but the arrows still don’t grey out.

cover:
  - platform: mqtt
    name: "Chicken Coop"
    command_topic: "cmnd/tasmota_201B22/POWER"
    payload_open: "ON"
    payload_close: "OFF"
    state_topic: "cmnd/tasmota_201B22/POWER2"    
    state_open: "ON"
    state_closed: "OFF"
    optimistic: true

Regards
James

If a state topic and position topic are not defined, the cover will work in optimistic mode. In this mode, the cover will immediately change state ( open or closed ) after every command sent by Home Assistant. If a state topic/position topic is defined, the cover will wait for a message on state_topic or position_topic .

Not sure why you are using a cmnd/ topic for state. You probably want a stat/tasmota_201B22/XXX state. Or, don’t put a state topic at all.

The state topic is telling the device “when you see this phrase on this topic, mark this as open” Likewise for closed.

If it never sees that message on that topic, even in optimistic mode, it will still wait for ‘something’ on that state topic.

So, unless that state topic is actually useful, just get rid of it and the state_open/state_closed lines.

Following what you mentioned I have amended my code and removed state;

cover:
  - platform: mqtt
    name: "Chicken Coop"
    command_topic: "cmnd/tasmota_201B22/POWER"
    payload_open: "ON"
    payload_close: "OFF"
    optimistic: true

But the arrows still don’t ‘grey out’!

Regards
James

Try setting a device class?

Maybe to ‘garage’? Just guessing here.

cover:
  - platform: mqtt
    name: "Chicken Coop"
    device_class: garage
    command_topic: "cmnd/tasmota_201B22/POWER"
    payload_open: "ON"
    payload_close: "OFF"
    optimistic: true

Maybe the default undefined cover doesn’t ever grey out the buttons. But I know a garage door does.

Thank you for your suggestion, I added garage device class and rebooted. The icon has changed to a garage door but the arrows still don’t grey out!

cover:
  - platform: mqtt
    name: "Chicken Coop"
    command_topic: "cmnd/tasmota_201B22/POWER"
    device_class: garage
    payload_open: "ON"
    payload_close: "OFF"
    optimistic: true