IFTTT and Twine (logging with Google Spreadsheets)
For all of you looking to add more functionality beyond SMS and email I recommend setting up IFTTT recipes. For instance, I have my magswitch logging every time my door opens to a google spreadsheet.
Answers
If you'd like a walk-through, which parts are sticking points? The Twine rules or IFTTT? Jud's example on IFTTT is almost exactly like my own, here: https://ifttt.com/recipes/67075
you get back good JSON from the supermechanical website (like: {"gs_version": "Oct 3 2012-11:35:08", "age": 10.875224113464355, "ts": 1357246592.0, "values": [["00004999f257830700", "1.1.4"], ["00004999f257830701", 2600], ["00004999f257830703", "bottom"], ["00004999f257830705", 2615144], ["00004999f257830706", 0], ["00004999f257830707", 0]], "last_poll": 1357245824.0, "rssi": 178} )
see twine.sh below:
wget -o log.txt --quiet -O temp.txt --keep-session-cookies --save-cookies cookies.txt --no-check-certificate --post-data="email=REPLACE_WITH_YOUR_LOGIN&password=REPLACE_WITH_YOUR_PASSWORD" https://twine.supermechanical.com/login
wget -o log.txt --quiet -O temp.txt --load-cookies cookies.txt --no-check-certificate https://twine.supermechanical.com/rt/REPLACE_WITH_YOUR_TWINE_ID?cached=1
DATE=`date`
TEMP=`cat temp.txt | awk -F"," '{print $7}' | awk -F"]" '{print $1}' | tr -d ' '`
echo "$DATE|$TEMP"
GSHEET='https://docs.google.com/spreadsheet/formResponse?formkey=REPLACE_WITH_YOUR_FORM_KEY&REPLACE_WITH_YOUR_FORM_ELEMENT_NAME='$TEMP
wget --quiet -O temp.txt $GSHEET
In IFTTT, set up a rule that says when you receive emails from your twine, add its subject line as a new row in a Google Spreadsheet.
The shell script grabs the same json used to render the Twine dashboard, gets the temperature from that, then posts it to cosm. Seems to work, but it's a hack (and I didn't feel like doing the math in the script to make not-really-hot temperatures )
(the script: http://hastebin.com/lilicavuhu.sh)
I was kludging some things together in a similar fashion I think. I couldn't get your script tho; not sure if I'm just blocked ATM due to some network settings as I'm on the road tonight. Can you let me know if the HB location is working, otherwise? I'd like to compare notes or share what I'm doing
I guess there was a short expiration on the hastebin link; this should stick around: https://gist.github.com/2ec052638855b3a3d6c3
I'd like to do it the right way(tm) at some point, but it sounds like official logging might be coming in the future.
There should be a row for every degree change between 62 and 76 degrees. I've already had to change the battery once. The network doesn't seem to be the problem, as I can log in and view my Twine's condition without a problem.
Is there a central thread where this is being discussed? I've read about it as addenda to other issues a few times.
Thanks for the script. I set it to send only the first two characters to cosm and threw it into a cron job to update on a set interval. Seems to work really well.
Anybody else seeing this?