How to generate Action MQTT topic from variables

I’m using an Action based on a Push Button change to Publish to MQTT.
I wist to generate the MQTT topic to publish to from variables in my bucket.
How do I reference the contents of a variable in a bucket to build the MQTT topic?
Note: This is not the variable associated with the Push Button change.

For example:
I have a variable called ‘gateway’ in my bucket. In ‘gateway’ is the gateway name “Gateway1”.
The desired topic to build from this is: “Acme/Gateway1/control”
I have tried:

  • “Acme/gateway/control”
  • “Acme/BUCKET.gateway/control”
  • “Acme/DEVICE.BUCKET.gateway/control”

Nothing seems to work! (Note: There should be dollar signs surrounding the above “gateway”, “BUCKET.gateway” and “DEVICE.BUCKET.gateway” items, but it appears they are removed when this was submitted!)
The intent is not to hard-code the MQTT topic to be able to dynamically send to the gateway being communicated with.

Hi @dlkarm123456

The MQTT services not accept template variable from MQTT topic, only on body.

But I think it is a nice behavior for TagoIO actions! so, I also added that issue as suggestion for new feature at MQTT service, thanks!