Timestamped data

You will have to send the payload manually. I still have a project here that is not using the Cayenne library (instead uses paho), you can get an idea of how to send the data there.

topic = "v1/" + username + "/things/" + clientid + "/data/json"
payload = '[{"channel":100,"type":"rssi","unit":"dbm","value":10,"name":"RSSI"},{"channel":101,"type":"snr","unit":"db","value":10,"name":"SNR"},{"channel":1,"type":"temp","unit":"c","value":10,"name":"Temperature"},{"channel":2,"type":"rel_hum","unit":"p","value":10,"name":"Humidity"},{"channel":4,"type":"lum","unit":"lux","value":10,"name":"Luminosity"},{"channel":5,"type":"motion","unit":"d","value":motion,"name":"Motion"}, {"channel":6,"type":"co2","unit":"ppm","value":10,"name":"CO2"},{"channel":107,"type":"voltage","unit":"v","value":8,"name":"VDD"}]'
mqttc.publish(topic, payload=payload , retain=True)

*I didn’t test the format of the payload varaible in Python. It’s been a long time since I did any Python programming so take that as a hint rather than copy this and it will work

1 Like