Format a multi key-value MQTT message in Python
Here's the code to formulate a multi-attribute (multi key-value) MQTT message in Python
mqtt_message = "{\"value\":\"" + str(light) + "\",\"serialNumber\":\"" + str(loopCount) + "\",\"sensorType\":\"light\"}"
Comments
Post a Comment