I'm trying to create a script reading Modbus coils and registers with the new command, transceive and publish it with MQTT to a broker.
In the Terminal, the values return as expected using the transceive command, but cannot publish it with MQTT.
This is the line I use for the ModBus query:
Code: Select all
:local modbus ([/iot modbus transceive address=1 function=3 data=00090010]->"values")
Code: Select all
:local message "{$[:tostr $modbus]}"
/iot mqtt publish broker=$broker topic=$topic message="{\"Values\":\"$message\"}"
Is there an option to get the values from the ModBus qurery? (The "old" read holding registers is not an option, because I must use other than 3 codes also.)
Thank you!