MQTT Engine gateway event script when message received


I have a project with MQTT messages sent by Automatons.
With a python script, I would like to INSERT data in my DB when a MQTT message is received.
Is it possible ?


It's definitely possible. You'll probably use either system.db.runPrepUpdate or system.db.runNamedQuery in your script.

I'm not super familiar with MQTT in Ignition, but I'd guess you'd put the script on a Gateway Tag Change Event.


With Gateway Tag Change problem is you can specify a tag in your MQTT Engine provider.
I would like to insert a new value when coming in my MQTT Engine.

But You have to list manually all the MQTT Engine tags.
Is it possible to write a folder tag path ? I would like to use gateway event script if any tag in the folder has changed.

Gateway tag change events allow a wildcard in the last element of a tagpath in their list.

1 Like