Triggers bring 'push' capabilities to Pachube

As promised a few weeks ago, we're going to be rolling out a whole host of new features that take Pachube to a whole new level. The Pachube dev team has been hard at work the past few weeks and we're delighted to announce the first of these new features, something we've been planning for months: triggers.

Also known as webhooks ("User-defined HTTP callbacks for push, pipes and plugins") and notifications, we're calling them triggers because we want to make clear that they enable Pachube datastreams actually to plug into and provoke (i.e. trigger) remote actuators, devices, scripts, buildings, etc. Skip here for a short tutorial on using triggers or read on for why you should be using them!

Up until now, Pachube has largely been a "pull" service: you've been able to send data to us as and when you want (i.e. "push" to us) or have us request data from you as necessary (i.e. we "pull" from you), but in order to get data out of Pachube you had to repeatedly poll (i.e. you could only "pull" from) Pachube to discover datastream changes. With the introduction of triggers, Pachube is now just as good at receiving (and storing) data as it is at acting upon (and sending out) data to remote devices, actuators and buildings: just what a "patchbay" should be!

With triggers, you set up conditions on datastreams (on anyone's datastreams, not just your own), and when those conditions have been satisfied (e.g. change of value, value is greater than threshold,value equals etc.) Pachube will push (by HTTP POST) a notification to the URL of your choice. This might be a php script that sends an email; or that posts to twitter; or connects to an SMS gateway to send a message to your mobile phone; or it might be a microcontroller that is able to act on the HTTP POST to actuate some physical device (like a lightswitch, a garage door, a window louvre, etc.).

You might build an alarm system: put a trigger on a datastream that measures temperature in your home and, when the temperature exceeds a certain amount, have it send you an SMS, switch on a alarm light in your office and switch off the heating system in your home. Or create a quick PHP script that sends you an email when your electricity consumption exceeds a certain amount. Or draw inspiration from BERG London and build a toy that stands to attention when your lover comes online by using the Status2Pachube Pachube.app combined with a trigger to alert to changes of online status, pointing at an Arduino hacked with an inexpensive toy. Triggers also make PachTweet even more useful: now it's much easier to use Twitter (private) direct messages to trigger physical artefacts and devices remotely.

See a short tutorial on creating triggers here for further information on adding and using triggers via Pachube feed pages; or skip the web interface and use the API to create your triggers.

For us, this is a major leap forward towards our vision of providing a planetary "patchbay" -- we're closer than ever to being able to plug anything into anything else!

In other news, we've also:

  • made it much easier to access history, archive, PNG graph and Flash graph code from individual datastreams, by providing an "embed,history,triggers,etc" link for each datastream.

  • updated the feed registration/edit page so that you can now add and specify units using the web interface -- long-requested, it just took us a while to get round to implementing it!

Do let us know what you think!

Re: Triggers bring 'push' capabilities to Pachube

Congrats! Looking forward to try this.

Re: Triggers bring 'push' capabilities to Pachube

We're looking forward to see what you make of them!

Re: Triggers bring 'push' capabilities to Pachube

First of all, congratulations with this impressive application. A great step towards the Internet of Things.
What I wanted to ask: the application now focuses on reading data from sensors. Are you also thinking about the other direction, i.e. manipulating the real world through the Pachube interface?

Re: Triggers bring 'push' capabilities to Pachube

Yes, of course, that's why it's called "Pachube" (i.e. "patchbay"...) and that's exactly what 'triggers' are all about! The reason that sensors have tended to predominate is that (a) they're much easier to comprehend conceptually; (b) it's much easier to understand technically how they 'connect' to the web and (c) because their data is coming inwards to the website, they are much more evident on the website itself. However, there is just as much data going outwards. Interestingly, we are getting many many thousands of API requests per hour (i.e. far more is going on machine-to-machine than people accessing the website) but we have no real track on exactly what type of systems the data is going outwards to, we don't have a great handle on what kind of physical manifestations these are having in the physical world. (That's why we released this video: http://community.pachube.com/node/225 which shows how much data we're getting both inwards and outwards). Having said that we do know that there are people triggering physical objects remotely, switching on and off lights, actuating building control systems, making remotely coupled devices, etc.

Re: Triggers bring 'push' capabilities to Pachube

Even better! Thx for your quick response.

Re: Triggers bring 'push' capabilities to Pachube

I've created a simple Sinatra web app that I've pushed up to http://www.heroku.com to handle the trigger and send me an email. Fork away and extend. http://github.com/kitplummer/pachutarget