I have successfully used the Cayenne-MQTT-Python library to stream a continuous stream of “temperature” data from a raspberry pi 3 to. I see changing values in my widget and am receiving threshold trigger e-mails. It works great!
However, when I attempt to send just a single “temperature” value from a python script, I see no change in my dashboard widgets. What I am doing is just running a python script from the command line to send a single data value. The dashboard bar indicating “offline” disappears breifly, but the widgets do not change:
....
client.loop()
t = randint(1,100)
print("temp: " + str(t))
client.celsiusWrite(1,t)
This code, however, works:
…
while True:
client.loop()
t = randint(1,100)
print("temp: " + str(t))
client.celsiusWrite(1,t)
I also tried:
…
client.loop()
t = randint(1,100)
print("temp: " + str(t))
client.celsiusWrite(1,t)
time.sleep(5)
This just shows the dashboard to be online for the delay time, but does not update the widget/trigger.
So why is the dashboard not picking up the single payload to update the widget or trigger? Is it possible to do this? The dashboard state is certainly changing from offline to online. Is there a response code I need to send or receive?
Thanks,
Greg