Once I started to understand what they meant by messing up example after example, I was ready to try some code. I grabbed their python example and updated it to save one of my devices. Since I'm a power usage freak, I chose my real time measurement of power usage. It worked. That was actually really cool, so I added outside temperature. It worked too. Then I went a little nuts and added the rest of my house data to it.
Then I was on a roll. I modified the code again to use the techniques I used on the other cloud services. I put it under the APSscheduler to do one minute updates, added it to the init table so it would restart if it had trouble and let it go. It's running right now keeping track of the data I collect around the house for me. So, what about a chart to look at? Well, they have a dashboard like some of the other services and I created one to hold some charts; these charts are embeddable:
Pretty slick. We've seen this before, but it's nice to see a new service like this implement it first instead of years later. They also have other 'widgets', gauges and things. What impressed me about this site is the versatility. They have capabilities that I won't have time to try out. They can derive data from other data and present it. It should be possible to build a chart based on my power usage and the billing charges multiplied together and actually show graphically how much money it's costing me to keep cool in the summer. That's actually a little depressing when you think about it.
They even have alerts that can send SMS and email to you. I created an alert to tell me when my house power usage goes over 10kWh. It was annoying when it came in the first time and even more annoying when it came in the second time. I actually have real time notification that I'm wasting money that comes in on my phone. I could easily expand this to alert me when the garage door is open after sundown. That would help a lot keeping the pack rats from stealing my tools and burying them in a mound outside.
Here's the code I'm actually running to update my house data on their site:
Yes, in my usual form, it's got way too many comments. It's also very inelegant; I'm not a big fan of strange statements that run really well but take an hour to understand so I just brute forced the URL and body creation of the request sent. Notice that there isn't a library with obscure calls and methods and stuff. This is all python code that I simply stole from them and added my particular items to. Makes it nice that I don't have to learn how to use some special library. I also put in a variable to control debugging so you can see what is happening. It gets a little complex at a couple of points.
I didn't stop there. I took their arduino example and modified it to update some items as well. It worked first try. The example had a little trouble since Grovestreams used Strings as a way of making the code more easily read and it started losing memory. The poor little arduino has so little memory that I knew it would die over time, so I sent them a note describing the problem. Guess what? They responded!
Yes, in this 21st century world of minimal text messages, they actually answered me and came up with a new example that works better. Unfortunately, I didn't save that one as an illustration for you, you'll just have to go to their site and get it yourself. However, I did save the first version I tried:
This worked really well, but like I said above, it will die over time because the Streams library will run the arduino out of memory. I left the code in it that I used to check memory usage and also the random number generation I used to test it.
Notice that the call to send the data is different? Of course you did. The call is part of their batch update API that is much simpler to use than the JSON call I used in the python example. This makes getting the data up there much easier for the arduino folks. They're even working on improvements to make the API more easily understood. The python folk seem to like infinitely complex data structures, so I'm leaving that example as it is.
They even have a full blown tutorial on hooking the arduino up to their service. Unlike a lot of the tutorials out there, this one can actually be read. You don't even have to click on page after page like the darn instructables we've all learned to love.
I really like this site. Like I said, I haven't gotten past the very surface of its capabilities, and probably never will, but it was nice to see a site where the folks running it actually care if people can use it.