How can I modify MQTT: Publish: Measurement Action?

Is it possible to modify the MQTT action of the Input Configuration? I want to include other fields in the message such as sensor id, longitude, latitude and DateTime

1 Like

Here is the MQTT Action for Inputs:

You can copy that file, change at a minimum ACTION_INFORMATION[‘name_unique’] to something different (this needs to be a unique string), modify the rest of the action to your liking, then import it on the Import Actions configuration page. Then your new action will be available for use with all Inputs.

1 Like

I wanted to test whether the new action would be working therefore I only changed the ACTION_INFORMATION[‘name_unique’] and ACTION_INFORMATION[‘name’]. After I import the action, I found out that the new action is not working.

The image below is the action configuration section, pH value is being published by using the built-in action while the EC value is being published by using the new action.


Only the pH value appears in the terminal
image

Did I miss out something on the code?

Right now the new action is working, I am able to receive the value from the new action. Not sure what happened, but I will list down what I did.
My daemon suddenly stops working, so I restart the system. And I also enable remote access for the MQTT by following this tutorial

1 Like

There’s also a Mosquito setup tutorial here on the forum.

1 Like