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

Popular posts from this blog

How to create an organizational chart in your webpage using Google Organization Chart Tools

How to add Diggit, Technorati, Del.icio.us, Stumbleupon, Reddit and pInterest buttons to your Blogger posts