There are instances where a graph might not be appropriate. I might simply want to display the current temperature outside. I don’t want any fancy formatting I simply want to embed the value in one of my posts. Which value though? The temperature is only meaningful if you know the date and time at which the reading was taken.
Last known temperature reading is 5.4C taken at 2019-12-30 13:56:50
It is possible to display both using the [ mqttcogs_get ] shortcode. In it’s most basic form it will return the most recent datetime or payload field. Here’s the code to display the text above:
Last known temperature reading is [ mqttcogs_get topic='mysensors_out/99/2/1/0/0' field='payload']C taken at [ mqttcogs_get topic='mysensors_out/99/2/1/0/0' field='datetime' dateformat='Y-m-d H:i:s' local='false']
What about other days?
It’s also possible to specify a ‘from’ and ‘to’ attribute and a sort attribute. This would allow you to get the start and end temperature for a given date range. I’m not sure why you might want to do this!