Tilt status of MQTT cover

I am struggling to get Home Assistant to update the state of my MQTT blinds and was hoping that someone could point me in the right direction. I’ve set the blinds up in configuration.yaml as:

cover:
  - platform: mqtt
    name: "Living Room Center Blind"
    qos: 0
    retain: true
    tilt_command_topic: '/raw/esp8266/13892103/in'
    tilt_status_topic: '/raw/esp8266/13892103/out'
    value_template: '{{ value_json.position }}'
    tilt_min: 0
    tilt_max: 100
    tilt_closed_value: 0
    tilt_opened_value: 100
    tilt_status_optimistic: false

The blinds show up in Home Assistant as a cover with diagonal control arrows and I can tilt the blinds open and closed through home assistant, but the status shows “Unknown”. and is never updated, even though commands are successful sent to the blinds.

The blinds send an MQTT status update to Home Assistant of:

/raw/esp8266/13892103/out { "set":100, "position":100 }

Any help would be greatly appreciated!

I have never used it, but I assume you have to define a tilt_status_topic to receive messages indicating the tilt. It doesn’t look like this has a template associated with it, so it would have to receive values 0-100 in the payload.

If your esp8266 doesn’t send out such messages indicating the tilt level, set the tilt_status_optimistic: to true, so that HA does not expect a status message after it has sent the command.

I have just tried tilt_status_optimistic: true but the status still shows “unknown” after issuing a tilt command from HA.

I had already defined a tilt_status_topic in configuration.yaml. The status update has two values:
{ “set”:100, “position”:100 } and I was trying to use a value_template: ‘{{ value_json.position }}’ to return just the position.

My understanding is that the cover assumes that in the case of blinds, that it can not only tilt, but also
go up (open) and down (close), and that the “state” is intended for up and down. So normally one would
use the command topic and state topic to reflect the up/down state. If the state topic is not specified,
then its state is “unknown”.

My setup is my blinds only tilt, but I want the cover state to reflect
the status of the tilt position where tilt position 0 is closed (off), otherwise is open (on).
To do this, I make the state topic the same as the tilt status topic
and use the template to change the tilt’s position number 0 to 100 to a state on or off.

  - platform: mqtt
    name: "Nook Blind 1"
    state_topic: "MK-SmartHouse/utilities/MK-BlindsControl1/state"
    state_open: "on"
    state_closed: "off"
    value_template: '{% if value == "0" -%}off{%- else -%}on{%- endif %}'
    set_position_topic: "MK-SmartHouse/utilities/MK-BlindsControl1" #needed for scenes
    #set_position_template: 
    #payload_stop: "STOP" #Doesn't apply to tilt.
    tilt_command_topic: "MK-SmartHouse/utilities/MK-BlindsControl1"
    tilt_min: 0
    tilt_max: 100
    tilt_closed_value: 0
    tilt_opened_value: 50
    tilt_status_topic: "MK-SmartHouse/utilities/MK-BlindsControl1/state"
    #tilt_status_optimistic: true #not needed if tilt_status_topic is used.
    availability_topic: "MK-SmartHouse/utilities/MK-BlindsControl1/available"
    payload_available: "online"
    payload_not_available: "offline"
    retain: true
    #optimistic: true
1 Like

Fantastic! Thanks very much, that looks like the way to go for me.

@MartinB did you get this to work… i am bumping my head against this… unable to update the tilt status