Use MQTT retained value as condition?

Hey,
Google wasn’t too helpful, so here’s my question for all of you lovely folks.
As far as I see it right now it is not possible in an automation condition to ask for an MQTT state, something along the lines of (and I’m completely making this up)

condition:
  - condition: template
    value_template: '{{ mqtt("my/topic") > 0 }}'

Am I correct in that assumption? I would guess I’d have to incorporate an input_number into that automation?

Best regards and happy new year
Halest

Create an MQTT sensor. Sensor subscribes to the topic on MQTT, and your automations work off the sensors state

1 Like

Ah, so that’s what the other Google results meant. I thought they were talking about actual physical sensors.
Thanks, I’ll try that out

Yeah. An MQTT sensor/switch/binary sensor is nothing more than a “fake” device subscribing/publishing on topics.

1 Like