Retrieving device from MQTT in Action

Retrieving device from MQTT in Action

@Andrés

Hello,
I am facing an issue with MQTT triggered actions. I need to trigger an Action in Tago when a message in MQTT set topic is received, then this action will either publish in another MQTT topic the receive data + the device which the data was received from in the first place or run an analysis to do the same thing basically.

I will have several devices publishing some data which will be receive in Tago, each device has it’s own device created in Tago so it will use it’s corresponding token to publish data through MQTT. I need to extract (either from an analysis, or the action itself) the device this data is coming from.
Right now I am solving this issue by naming the topic as the device name, but then, to manipulate data from the device in Tago I need to get the device list and loop comparing the name which is slow and I need this to be as fast as possible.

Is there any other way to get the device the data is coming from?

Thanks,

Andrés