Home Automation With An iPad

Home Automation With An iPad

Here's another interesting use case for my ongoing coverage of Pythonista. From the Pythonista Community Forums, user nlecaude shares a script and a demo video showing how he managed to control the lights in his house using Pythonista (thanks, Gabe).

The Pythonista app is pretty simple, it's basically crossfading between different images to show the current state of the lights. I have one layer for each state (3 lights so 2^3) and I have invisible layers that I use as buttons to trigger the lamps and transition on and off. I'm quite fascinated by the possibilities of Pythonista.

If you watch the video below, it basically looks like magic. This guy is tapping on a photo of his room on an iPad to turn the actual lights on and off. In practice, he's using a Python library to control a Philips Hue system that reacts to touch input from Pythonista.

For those unaware of Philips' product, Hue is a personal wireless lightning system that can be remotely controlled and programmed to offer different lightning settings and color combinations for every occasion. Philips isn't offering an SDK for developers yet, but the Python library manages to directly connect to the Hue wireless bridge and send input commands.

As nlecaude writes, this is just a script put together in 10 minutes with an unofficial library. The possibilities for home automation programmed from an iPad are seriously intriguing.

Source: omz-software.com