Hi,
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:
Then publish this with MQTT:
This produces an empty string.
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!
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:
:local modbus ([/iot modbus transceive address=1 function=3 data=00090010]->"values")
Code:
: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!
Statistics: Posted by mrangics — Mon Jan 29, 2024 7:23 pm