MQTT Modbus to Thingsboard

Hello,

Could you please clarify your intended workflow a bit further, especially regarding why you need to read data from MQTT? Is the goal to retrieve the current relay state via MQTT messages and then act upon it?

If so, this could actually be handled locally using a simple script. For example, you can query the relay state via CLI with:

ubus call ioman.relay.relay0 status

and then, based on the returned value, publish an MQTT message using mosquitto_pub in your preferred JSON structure.

Additionally, here are some relevant topics that might be helpful or bring insights:

If this is not the intended setup you’re looking for, could you clarify it a bit more? Thank you.

Best regards,