Get MQTT position state on start automation

Sorry if this has been answered, I can’t seem to find it.

I have blind controllers which are covers in home assistant.
Everything seems to work OK but I can’t get the state of the blinds at ha startup.

I have read I can do an automation that triggers on start but what action do I need to call the mqtt position_topic.

Note. I can use the retain flag in my blind firmware as it is not supported by the Adafruit mqtt library.

Thanks

1 Like

I guess you could try adding ‘homeassistant.components.mqtt: debug’ under the logger component to see the topics that are being published by your blind controllers. This might help find out the state topics. If the controllers do subscribe to their state topics, you can add an automation triggered at HomeAssistant start event to publish a topic requesting for the state, something that looks like this -

  • alias: “Power state on HA start-up”
    trigger:
    platform: homeassistant
    event: start
    action:
    • service: mqtt.publish
      data:
      topic: “cmnd/sonoffs/state”
      payload: “”

In addition to @ANKY06
Read this https://github.com/arendst/Sonoff-Tasmota/wiki/Home-Assistant

From what i understand you also need to add auto discovery
add the discovery lines to your current mqtt block

mqtt:
  discovery: true
  discovery_prefix: homeassistant

Edit:

I see now you are probably not using Sonoffs with Tasmota so don’t think this is going to work this way.

Perhaps just change the topic to your blinds topic and not add the discovery_prefix: homeassistant part