Topic for mqtt node?

I'm a newbie to node red and I just can't seem to work out the correct topic value for an MQTT node, I am using Tasmota on a Sonoff device and Mosquitto MQTT.

If I use "#" as the topic value I get

tele/sonoff/SENSOR : msg.payload : string[91]

"{"Time":"2019-10-19T17:50:44","SI7021":{"Temperature":14.6,"Humidity":68.7},"TempUnit":"C"}"

This makes sense to me and. if I use "tele/#" as the topic it works as well, however if I use either "sonoff" or "tele/sonoff" I don't get any response.

In Tasmota I have the topic set as "sonoff" and "%prefix%/%topic%/" as the full topic.

Everywhere I look it seems to imply that "sonoff" as the topic should work, what am I doing wrong?

Hope someone can tell me where I am going wrong.

Gordon

this should be it:

1 Like

Keeping things simple, # is a wildcard.
So # matches anything
tele/# matches anything starting with tele
tele/sonoff/# matches anything starting tele/sonoff

1 Like

Thanks, I had tried "sonoff/SENSOR" earlier but not since I worked out it needed to start "tele" rookie mistake!

when connecting to the sonoff device, the topic(s) can be seen at the console output during logging events

1 Like

Try mqtt explorer to get a better view of the topics in the broker (can also be copied from there)

1 Like