Can HM periodically post data to a URL?


 

Andrew Flusche

TVWBB Member
I am using two HeaterMeters to run two WSM's for a church group I'm in. We'd like to be able to access the HM graph / temps remotely so we can monitor the smokers at church while we're at home. :)

I doubt we will be allowed to port forward on the church's wifi, so I'm looking into other options.

I know web development, so I'm thinking if the HM can post data periodically to a URL, I could just stick it into a database and create my own website to monitor the smokers. We could then also have the data from both HeaterMeters on one web page.

Is this possible? Or is it something that I could maybe setup from the command line on the HM?

THanks!
 
I used to have my stats pushed to thingspeak and it could be viewed remotely. You can still see the old data at https://ww0.ca/thingmeter/

You can setup a cron job on the heatermeter to run the script every minute.

The script is here and the html to view it is here.

Place the HTML file anywhere you can reach it in a browser ie: google drive.
 
My new dashboard is online and working. You can see the testing data here:

http://www.andrewflusche.com/knights/smokers.html

I was able to modify Steve's code, put two graphs on one page, customize it a bit, and be done!

I may add a little message box at the top of the page that I can update via Twitter or something... That way I can easily notify volunteers how the smoke's going and when we need helpers to return to the church.

Thank you Steve!!
 
I wanted to add to this to include sending a tweet. I took @Steve_M code here and with a whole bunch of help (from Steve) and a lot of time - I tossed this together. It also tweets the uptime of the unit. If it's desired to send via IFTTT then un-comment that line and comment out the ThingTweet line.

Via some ssh terminal (Putty, JuiceSSH, etc) You'd want to put the file in /mnt/mmcblk0p4 name it something like temps.sh
Make the temps.sh executable by
chmod +x /mnt/mmcblk0p4/temps.sh

Then in the interface from System -> Scheduled Tasks put how often you'd want to run it. For example I run mine every 20 minutes. Make sure it is the first line - or put below any other cron jobs you may have.

*/20 * * * * /mnt/mmcblk0p4/temps.sh

and finally back to the terminal - restart cron.
service cron restart


Code:
#!/bin/sh
#field1 = set point                                                                                                         
#field2 = lid state                                                                                                         
#field3 = fan speed                                                                                                         
#field4 = probe0 temp                                                                                                       
#field5 = probe1 temp                                                                                                       
#field6 = probe2 temp                                                                                                       
#field7 = probe3 temp                                                                                                       

starttext="System has been up for: "                                                                                        
startdate=$(uptime | awk -F'( |,|:)+' '{print $6,"hours,",$7,"minutes."}')                                                  
NL=$'\n\n'                                                                                                                  

stats=$(lmclient \                                                                                                                  
    | tr "{," "\n" \                                                                                                            
    | grep -e set -e lid -e \"c\" \                                                                                            
    | awk -F: '{print $2}' \                                                                                                    
    | sed 's/null/0/g')                                                                                                 
   
# only let the lid be 0 or 100                                                                                              
lidstate=$(echo $stats | awk '{print $2}')                                                                                  
if [ "$lidstate" -gt "0" ]                                                                                                  
then                                                                                                                        
stats=$(echo $stats | awk '$2 {$2=100; print}')                                                                             
fi                                                                                  
stats2=`echo $stats | awk '{print "Pit Target Temp: " $1 "\r\n" "Lid State: " $2 "\r\n" "Fan Speed: " $3 "\r\n" "Pit Temp: " stats="${stats2}${NL}${starttext}${startdate}"                                                                              

#uncomment and modify your event and key if using IFTTT
#curl --data "value1=$stats" https://maker.ifttt.com/trigger/<event_name>/with/key/<your_IFTTT_Key>                  

#below is for using thingspeaks thingtweet replace api_key with yours
curl -q -k -d "api_key=<thingtweet key>" -d "status=$stats" https://api.thingspeak.com/apps/thingtweet/1/statuses/update
 

 

Back
Top