Waiting for user's reply
MQTT: Convert data before sent/receive
Tanapol E. 6 years ago in Server Solutions / UMC Server • updated by Ilya Markov (expert) 6 years ago • 1
My MQTT sent/receive command by string "ON" and "OFF" not 0 1
Is it possible to convert them?
when receive string "ON" from Feedback
just convert to 1
and when send 1 to MQTT Tag just convert and send out "ON" string
Customer support service by UserEcho
you can use js script for this task. You can subscript to this tag via global listener or event tag change and then convert it.
var device = IR.GetDevice("MQTT")
IR.AddListener(IR.EVENT_TAG_CHANGE, device, function(name, value)
if (name == "MQTT Feedback")
if (value == "ON")
//Here you should set 1 to your varibale
//Here you should set 0 to your varibale