Wouldn’t it be cool if you could use your voice on your mobile device for retrieving information about your Cosm feeds (and activate a trigger maybe)? This way you can learn about your room’s temperature (or whatever else you might be monitoring using your favorite microcontroller platform) while driving, jogging, etc.!
When this idea came in my mind I first thought of Siri. Then I turned on the WiFi on my iPhone and tried to find out Siri’s knowledge about IoT and Cosm. The first question was very general, to see if Siri had any idea of what I am talking about when I want to find out my room’s temperature. The response was completely disappointing!
One could say that I should not be expecting Siri to be able to answer such a question (well, at least it could search google for temperature :P) so I tried again with a more..let’s say..fundamental question!
(Side note: I am expecting from such a voice recognition system difficulties in understanding my greek-english accent, but despite Cosm being much more easily to pronounce than Pachube, Siri thought on every attempt that I was asking about ‘cousin’ and not ‘cosm’. I had to manually edit the query and correct it.)
Siri has thought that I am just kidding around, then I realized that maybe Siri is not familiar yet with the new name of Cosm:
That was only just a bit closer! Cosm guys, if you read this, you need to talk to Apple
Since there is no official voice application for Android I gave up and considered to build one myself. Since I didn’t want to jailbreak my iphone and and I am not very familiar with objective-C, I have used Android for that purpose.
I have developed a small app that requires from you only the tap of a button and then will ask you for the feed id you are interested in. It will look for available datastreams, will ask you which one your are interested in and will report you the current datastream value. Finally it will ask you whether you like to activate a trigger or not (not Cosm trigger, just a REST call to a remote server). Voice recognition works pretty well, the voice sdk needs improvement, but it is quite acceptable for a proof of concept!
See a small demo video here:
The trigger is just a REST call on a website, not an actual Cosm trigger!
The complete Android source can be found here. Warning: Code is really a mess, just made it for proof of concept, works quite well, but definitely could be optimized, and implemented using threads! Feel free to use it, modify it, improve it!