Get MQTT Topic in Rule

Hi

Using openhab 1.8.x easy to get payload of an MQTT message in a rule. Does anyone know how to get the topic in a rule?

Thank you.

MQTT works identically in OH 2.

Rich,

Thanks, but how do I get the MQTT topic in a rule. I need the topic
string in a rule to change it and publish. I am not familiar with OH 2.

Are you doing this in OH 1.x right now? If so it works exactly the same way. MQTT is identical between the two.

If you are not doing it right now, then you can try to use the MQTT Action. However, be aware that as of a few months ago there was a problem that broke the MQTT binding when it and the MQTT Action were installed at the same time. I hope that has been fixed but don’t know for sure.