Thursday, February 6, 2014

@SmartThings and #Arduino: Color the Weather

photoI’ve been tinkering with SmartThings quite a bit lately and am loving it.  We’ve added several switches, a smoke detector, and gotten used to the interface a bit more.  For the most part, things have “just worked”.  Lights turn on on schedule, and off when people leave.  That’s cool and all, but one project I’m particularly excited about is the idea of an ambient colored light around chest-of-drawers, closet, coat-racks and the like to indicate the weather.  The idea is that without looking it up, I know if I need to carry an umbrella or jacket right in the place I’m making the decision.

To pull it together, you obviously need a SmartThings hub and some color-changing device that works with it.  I haven’t tested with Phillips Hue, but in theory these should work and certainly be easier than what I describe below. In fact, I suspect you could do similar with some IFTTT recipes and not need SmartThings, but where’s the fun in that?  Instead, I used an Arduino and SmartThings Shield.  A little SmartThings DeviceType and SmartApp code glue it all together.  It’s a little convoluted, but here’s a step by step on getting it running:

  • Put the SmartThings Shield on the Arduino.
  • Clone this project from codebender.cc and push it down to your Arduino
  • Copy SmartThingsShieldDeviceType.groovy from this gist to a new Device Type in your SmartThings environment.
  • Power up your Arduino in a convenient place and let it pair with the SmartHub. 
  • Go to My Devices –> SmartShield –> Edit and change the device type to the one you created above.
  • Copy ColorTheWeather.groovy from the same gist to a new SmartApp in your SmartThings environment.
  • Publish the app
  • On your mobile phone, add the app you just published and configure it.

Whenever you switch on the light, or at the schedule you provide, it will look up the weather and color the light accordingly.  It will also output the weather forecast to the “Hello Home” page in your mobile app (the little notification button on the top-right).

It’s still an experiment and obviously not for the faint-hearted, but I’ve cobbled together enough of a system to share.  One interesting aside related to this project is that it was built entirely using web-based development environments.  The SmartThings app was built using their web-based IDE. The Arduino bit I did using CodeBender.cc- a web based IDE for programming Arduino.   I’ll let that soak in:  I wrote a custom home automation app, including a hardware update, using nothing but my web browser.  No funky downloads or library headaches or path variables.  I do most of my “day job” development in virtual machines these days, but am keeping a close eye on web-based tools like “Visual Studio Online” and similar.  The prospect of never having to install a bunch of “goo” just to write code is pretty inviting to somebody who used to spend days setting up machines for development.

Monday, February 3, 2014

InfoPath is Dead, Long Dead InfoPath

This is just a quick, ill-conceived post about the recent announcement that InfoPath 2013 will be the last version of InfoPath.  I'm still processing exactly what my recommendation to my SharePoint customers will be, but this certainly feeds into my general love/hate relationship with SharePoint.

On the one hand, InfoPath has in theory offered users the ability to build web forms without writing code.  The sales spiel has always been that power users could simply drag a few fields to the page and build business forms without involving developers or "needing to know HTML".  Easy instant form creation FTW!

On the other hand  I have yet to see this materialize in real-world organizations.  What happens in real life is developers end up being the ones to use InfoPath (and workflow), and often end up frustrated by the tools, which by their very nature are not as powerful as coding solutions from scratch.

We don't know yet what Microsoft's next big thing for forms will be.  The official guidance is to keep using InfoPath and wait for more info soon.  Andrew Connell and other SP bloggers suggest that writing HTML+JS forms against the SharePoint API(s) are the way of the future.  This certainly seems like wise guidance to me.  Certainly, HTML+JS is here to stay, and with tools like jQuery, Angular, and Knockout, it's easier than ever to build rich, cross-browser user experiences that InfoPath just can't do.

Maybe it is time to admit that the panacea of a "no code solution" for web forms never really existed, and maybe shouldn't exist.  Maybe you should be expected to know HTML and Javascript if you are to do web based forms reasonably well.