Plotting graphs with plot.ly service with luup scene using REST API
-
I gave up on plot.ly. I can no longer send many data to one graph using their API so I started looking in to ThingSpeak.com that @Dwalt mentioned. I seems like you can use plugins to create graphs with multiple series, seems to work nicely.
maybe try the new Maker channel on IFTTT and send data to google spreadsheet.
then just feed your plotting software (or excel) from the data on your google drive.
-
I gave up on plot.ly. I can no longer send many data to one graph using their API so I started looking in to ThingSpeak.com that @Dwalt mentioned. I seems like you can use plugins to create graphs with multiple series, seems to work nicely.
@korttoma said:
I gave up on plot.ly. I can no longer send many data to one graph using their API so I started looking in to ThingSpeak.com that @Dwalt mentioned. I seems like you can use plugins to create graphs with multiple series, seems to work nicely.
Did you get it to work?
-
@korttoma said:
I gave up on plot.ly. I can no longer send many data to one graph using their API so I started looking in to ThingSpeak.com that @Dwalt mentioned. I seems like you can use plugins to create graphs with multiple series, seems to work nicely.
Did you get it to work?
-
Here Plot.Ly has been working:
https://plot.ly/~WhiteRabbit/997About 6 months or so ago it seemed to stop plotting, and it wouldn't resume even if I rebooted the Arduino. So, I requested all new stream tokens, plugged those into the Arduino program, rebooted, and it has been working since. What I like about Plot.ly is that I can both pan and zoom the data.
I'm presently driving Plot.ly using just the Arduino API. I get the impression I'd have finer grained control if I were to drive it using Python instead.
-
@korttoma said:
@NeverDie Thanks for posting, I created a new API key and deleted my old plot and so far so good, it is working again.
Like you I also prefer the UI and plots produced by plot.ly but I'm not convinced by the reliability so far.I share your concern. It has been a bumpy ride. If it weren't for the pan and zoom UI, I would have tried switching to another free service.
-
@Hoffan if you have an APIKey and username from plot.ly all you need to do is to change the following from the first post in this thread:
("urn:micasaverde-com:serviceId:HumiditySensor1", "CurrentLevel", 83) If you don't know what this should be let me know so I can explain further.
<username>
<APIKey>
<nameForGraph>
<graphTitle>You should make sure you remove all the < >
Also I noticed that you can only have one private graph so if you already have one the second one will not get created.
Try changing "world_readable":false to "world_readable":trueNow test your lua code from apps -> develop apps -> test loop code (lua). Do you get any errors?
-
@Hoffan no you should not need to change anything at plot.ly your graph should just appear among "YOUR RECENT FILES" on the right when you go to "https://plot.ly/".
-
-
It seems that plot.ly has new limitations to the free API in their price plan:
- Only one free private graph
- API rate limits: 50 per day or 30 per hour
Then you have to pay 20 USD/month to get unlimited access.
Damn. There goes the cheap solution. -
I converted my code to use ThingSpeak.
It is even simpler to call since the formatting is done on the website. Here is how I use it:local url = "https://api.thingspeak.com/update?api_key=_YOUR_KEY_HERE_" result, status = http.request(url,'field1='..HotWaterTemp..'&field2='..HotWaterPump..'&field3='..HotWaterLimit..'&field4='..PumpTime)On the https://thingspeak.com website you just define the "channel" that receives all the data and copy the example "plugin" and modify it to render your graph.
Quite easy. And free at least so far.. -
I converted some to ThingSpeak now also but I could not get it to work using your example @samppa ,don't know why but this works for me:
local http = require("socket.http") result, status = http.request("http://api.thingspeak.com/update?key=<API_KEY>&field1="..TankTopp.."&field2="..TankMitten.."&field3="..TankBotten.."&field4="..StatTemp.."&field5="..StatMode.."&field6="..Solpanel.."&field7="..Solpump.."&field8="..CirkPump.."", "run=run")``` -
Like others, I've (regrettably) given up on plot.ly, and gone over to ThingSpeak.
I'm using the following Python code to send values from Domoticz:
thingURL = 'https://api.thingspeak.com/update?api_key=_YOUR_KEY_HERE' url = thingURL + "&field1=%s&field2=%s&field3=%s&field4=%s&field5=%s" \ % (inside, target, outside, lounge, heating) f = urllib2.urlopen(url) f.close() -
I converted some to ThingSpeak now also but I could not get it to work using your example @samppa ,don't know why but this works for me:
local http = require("socket.http") result, status = http.request("http://api.thingspeak.com/update?key=<API_KEY>&field1="..TankTopp.."&field2="..TankMitten.."&field3="..TankBotten.."&field4="..StatTemp.."&field5="..StatMode.."&field6="..Solpanel.."&field7="..Solpump.."&field8="..CirkPump.."", "run=run")```@korttoma The only difference I see is that you put the entire url with parameters in the first argument of the http.request call and "run=run" as the second (don't know why you have that?). I use the base url as the first argument and the field list as the second
r, s = http.request(baseUrl, "field1=XX&field2=XX")Hope that fixes the issue.
Also You have to setup the "Channel" and "Plugin" in the website accordingly and name the fields there.