I wrote a script to send data from indigo up to pachube. From there you can make some interesting graphs and others of the data.
You can find the script and instructions at
http://www.dial911anddie.com/weblog/200 ... -software/
Matt wrote:This is going to be awesome if I can get it to work
I created a Pachube.com account and started a manual feed with two data streams.
I copied and pasted your code and changed a few variables around. I entered my Pachube account keys where they belong, but I get an error everytime the time/date action triggers.
I had to change around a lof of " characters as the ones in your applescript were making my computer choke. I also noticed a bunch of ' or something so I got rid of those, and the applescript still does not run.
The log error is this: Problem with posting to pachube. curl result is:Unauthorized
The applescript I am using looks like this:
set myPachubeAPIKey to "myAPIKey"
set myPachubeFeed to "http://www.pachube.com/api/feeds/####.csv"
tell application "IndigoServer"
set myTemp to value of variable "outside_Temp"
set myHumidity to value of variable "outdoor_humidity"
end tell
try
set myRes to do shell script "curl –request PUT –header "X-PachubeApiKey:myAPIKey" & –data & myTemp & "," & myHumidity & " " & myPachubeFeed
if myRes is not equal to " " then
log "Problem with posting to pachube. curl result is:" & myRes
end if
on error
log "Error execting curl to post to pachube.com: Result was " & myRes
end try
That has got to be close, I just can't figure out what is wrong. I have a hunch it has to do with the " and ' that I replaced or removed from the applescript.
Can you please help?
set myTemp to (Thermotemp as real)
try
set CommandString to "curl -m 120 -S --request PUT -H "X-PachubeApiKey: " & myPachubeAPIKey & "" " & "--data " & myTemp & " " & """ & myPachubeFeed & """
set myRes to do shell script CommandString
if myRes is not equal to " " then
log "Problem with posting to pachube. curl result is:" & myRes
end if
on error
log "Error execting curl to post to pachube.com: Result was " & myRes
end try
log "ran the temp log script temp=" & myTemp
Users browsing this forum: No registered users and 4 guests