MQTT Cover - Shade Issues

I have a ZWave window shade with SmartThings which treats the shade like
a dimmer switch. SmartThings sends and receives MQTT topics

  • /switch “on” or “off”
  • /level 0-100.

When I set this up for MQTT Light, things work fine and control is
bi-directional (can initiate at SmartThings and HA syncs; can initiate with HA and ST syncs).

However when I instead set this up for MQTT Cover I run into problems:

  1. It seems the MQTT Cover command_topic is only for sending MQTT
    and the state_topic is only for receiving MQTT and they both can not
    be the same topic. i.e. can’t use “switch” as the topic for both command and state topics.
  2. I was hoping to get a dimmer slider (to go with the Up/Down arrows)
    in order to control the position of the shade.
    I’ve tried the set_position_topic and assume the
    set_position_template would not be needed. But I don’t get a slider showing up.

Any suggestions appreciated.

After exploring further, item 1) was a configuration error on my part so ignore it.

As for item 2) I still can’t get a slider to show up in the card panel for the shade position.

BTW,
I did set the tilt_command_topic: and I get a slider for the tilt.
Here is my config

cover:
   - platform: mqtt
     name: "Kitchen Sink Window Cover"
     command_topic: "smart/Kitchen Sink Shades/switch"
     payload_open: "on"
     payload_close: "off"
     state_topic: "smart/Kitchen Sink Shades/switch"
     state_open: "on"
     state_closed: "off"
     set_position_topic: "smart/Kitchen Sink Shades/level"
     #set_position_template:
     tilt_command_topic: "smart/Kitchen Sink Shades/level"
     tilt_status_topic: "smart/Kitchen Sink Shades/level"
     retain: true

I saw (and am trying to implement myself) someone else using an independent input_number slider to control the position and then adding it to the card with the blind.

Having automation behind it to then make the blind move accordingly.

No too sure yet if it works as I’m having issues with my sketch and am stuck on that. But I have created the input_number so it’s there to test eventually.

If you know how, can you explain how to add the input_number slider to the existing “Cover” card?

I just made a group card and added the cover and the input_number to it.

  blinds:
    name: Blinds
    entities:
      - cover.front_blinds   
      - input_number.front_blind_tilt

I finally figured out how to get the MQTT cover slider to show up (now running 0.81.6).
The key is the state topic.

The state topic looks for MQTT payload with numeric values 0 to 100 in the payload
and once it receives an MQTT message with the numeric value,
it will suddenly display the slider bar and and will show it as the “current_position”.
The State topic also automatically determines the “open” or “closed” state
of the cover based on the numeric value with “0” as “closed”, and anything else as “open”.

Also if you set the “state_open” or “state_closed” to a numeric value, and that numeric value
is received in the MQTT payload, it will NOT update the “current position”.
I found you simply don’t need to set these (the defaults are there but not used).

Here is an update configuration:

  - platform: mqtt
    name: "Kitchen Sink Window Cover"
    command_topic: "smartthings/Kitchen Sink Shades/switch"
    payload_open: "on"
    payload_close: "off"
    state_topic: "smartthings/Kitchen Sink Shades/level"
   #state_open: "on"
   #state_closed: "off"
    set_position_topic: "smartthings/Kitchen Sink Shades/level"
   #set_position_template: