MQTT Config

Need a wee bit of help with this one please, the config was changed on last update. I followed the new details on the MQTT integration page and after a bit of whitespace nonsense I got it to check correctly, below is the new config which is seemingly fine and passes the check, but now the blinds are greyed out in the dahsboard and thus unavaliable. Banging my head against the wall for this one, but I bet I have missed something silly and I can’t see it. Very much thankyou in advance!

mqtt:
  cover:
    - name: "Bedroom Blind"
      command_topic: "cmnd/bedroomblind/TuyaSend4"
      position_topic: "tele/bedroomblind/RESULT"
      set_position_topic: "cmnd/bedroomblind/TuyaSend2"
      availability:
        - topic: "tele/bedroomblind/LWT"
      payload_open: "1,0"
      payload_close: "1,2"
      payload_stop: "1,1"
      payload_available: "Online"
      payload_not_available: "Offline"
      position_open: 0
      position_closed: 100
      position_template: >-
        {% if value_json['TuyaReceived']['DpType2Id3'] is undefined %}
        {{ 100 - state_attr('cover.shades','current_position') | int }}
        {% else %}  
        {{ value_json['TuyaReceived']['DpType2Id3'] | int }}
        {% endif %}
      set_position_template: "2,{{ position }}"

Trying changing the availability config to:

availability_topic: "tele/bedroomblind/LWT"

Thanks,

This has indeed worked, but im curious as to why on teh integration page for the cover https://www.home-assistant.io/integrations/cover.mqtt/ in MQTT it shows to specifically, write it this way. Here is the excerpt from the page. Does that mean its incorrect or just hasn;t been implimented yet?

# Example configuration.yaml entry
mqtt:
  cover:
    - name: "MQTT Cover"
      command_topic: "home-assistant/cover/set"
      state_topic: "home-assistant/cover/state"
      availability:
        - topic: "home-assistant/cover/availability"
      qos: 0
....

I’m not entirely sure, but I think the integration is providing two ways to detect availability, one is using LWT and using the method I suggested, and another is by listening in on some other topic of your choice. The docs provide both ways.

You’re trying to combine two different things:

When set on the cover entity like you’re showing above, these fields only apply when you set availability_topic. They do nothing if you use availability.

availability is more flexible then availability_topic as it allow you to use multiple topics to set availability. For each one you can provide a value for what the payload looks like when the entity is available or unavailable. To use that you would change yours to this:

    availability:
        - topic: "tele/bedroomblind/LWT"
          payload_available: "Online"
          payload_not_available: "Offline"