Scott Vanderlind


everything happens so much


Cheap Android Phones as Home Automation Remotes

I've been on a home automation kick recently. It's fun! Since I'm cheap, I've been going the way of smart bulbs. They're LED bulbs that fit in standard lamps but are controlled from a home automation hub and accompanying app.

The biggest usability issue is that light switches have to be always-on. So when you're half-naked in the middle of the night, you can't just feel for the switch and flip the light on. To replace that functionality, you need a controller of some sort. You can get nifty Lutron remotes to do this (if you have a compatible hub), but they're about $20-30 each if you get the wall mounting kits.

Or, if you're a coder like me, you can write an Android app and throw it on a $9 prepaid phone and then tape that phone to the wall. :)

The $9 Samsung Galaxy Centura. Don't you just ADORE my Photoshop skills?

That's a photo of three (of my five?) remotes. Don't you adore my Photoshop skills? Also those are kinda selfies which is pretty cool.

The system supports theoretically any number of "remotes" (phones) each with their own unique configuration. Currently, configuration options include defining the number of available buttons and their background and font colors. The cooresponding actions are also defined in a configuration file which maps the action name to a customizable REST request. Since it's just an HTTP request, you could use this system to control anything that has an API.

much color very wow

The basic configuration file looks like this. There are fields that don't do anything yet (the "settings" block, the "order" attribute). I had great dreams for those, but I've been happy enough with the system as-is that I never felt the need to sit back down and implement them on the Android side.

{
   "commands" : {
      "lamp_on" : {
         "url" : "http://192.168.0.113/2/",
         "data" : "",
         "method" : "POST",
         "type": "text/plain"
      },
   },
   "remotes" : {
      "default" : {
         "remote_id" : "default",
         "buttons" : [
            {
             "order" : 0, 
             "title" : "Lamp On", 
             "command" : "lamp_on", 
             "bgcolor" : "#000000", 
             "text_color" : "#FFFFFF"
            }
         ],
         "settings" : {
            "display_sleep" : 0,
            "display_brightness" : 100
         }
      }
   }
}

I have mine talking to a few things:

They work surprisingly great when velcroed to the wall, assuming they have a reliable Wifi connection and are kept charged. I keep mine plugged in 24/7, so I can't speak to how long the batteries might last.

If you have some phones laying around, know how to compile an Android app, and have a place to run a Node.js service, you are welcome to try the system out yourself. I've put everything needed in repos on Github:

A note on the Android phones themselves: Please don't go buying a bunch of new phones for this. I was bad and bought the first one new from Amazon ($9, Prime, you do the math), but in an attempt to redeem myself I bought the next few used from Ebay, and even traded an unused Wifi router for my friend's old phone. Try to use broken phones, old phones, hand-me-down phones, etc. and give these electronics a second life!


comments powered by Disqus