Hi, I have several temperature sensors. I would like to poll the current value every 5 minut and store it in a database so I can create graphs etc.
The only part I need help for is how to get the value? Is there an Web API I can use and get the values?
Somewhere around there. Not sure about the Web API part, but more than likely you’d have to do this via a Smartapp and push it out to your own Google Docs or DB.
I use a Basic CoRE Piston with a SmartThings contact switch that has a temperature attribute. The contact monitors the temperature of our hot tub mechanicals area, mostly in the winter time & when we travel, to ensure the hot tub is online and staying heated. I also grab the outside weather using the AccuWeather SmartApp for comparison.
One could either set a CoRE timer to fire every 5 minutes or use the condition of “changes” which will send a reading value at every different temperature level and then route the digital output as I do below to an email, notification or as a SMS text as below.
CoRE Piston
IF
● Hot Tub Temp temperature changes
THEN...
Using Hot Tub Temp...
► Save attribute 'temperature' to variable {temperature}'
Using AccuWeather (45385)...
► Save attribute 'temperature' to variable {outside_temp}'
Using location...
► Send SMS notification 'Hot Tub Inside Mechanicals temperature is {temperature}°F and outside temperature is {outside_temp}°F' to 555-555-5555
SMS Message Log
Hot Tub Inside Mechanicals temperature is 69°F and outside temperature is 37°F
Hot Tub Inside Mechanicals temperature is 68°F and outside temperature is 36°F
Hot Tub Inside Mechanicals temperature is 67°F and outside temperature is 36°F
Hot Tub Inside Mechanicals temperature is 66°F and outside temperature is 35°F
Hot Tub Inside Mechanicals temperature is 65°F and outside temperature is 33°F