JSON payload in MQTT message
-
Hi there, hope someone can point e in the right direction with this. I'd like to modify the mqtt client in a way that it posts json payloads containing the sensor id and possibly other information in the message. Where and how would I go for this?
Thanks, jjk -
I don't mind at all ;)
The idea is to post the sensor data to an uninformed controller/service, possibly web-based. Currently, the service would need to know what sensors are available and subscribe to the corresponding mqtt topics to get the sensor value as the message. I'd like it to simply subscribe to the top-level mystt topic and get all necessary information (like sensor id etc. ) in the actual message. There might be other ways to do this, I'm just experimenting and using a json container seems like a clean solution.