Cool cats: Home automation part 1

My partner recently got a new job in DC, so I’ve been taking short trips down there every couple weeks. We are also fostering a couple of cats from our local shelter, Social Tees. The heat will continue to rise this summer, so I needed to figure out a way to keep the cats cool when I’m not there. Leaving the AC on Eco mode the whole time I was gone was one option, but I didn’t really trust it, and it also seemed like a waste of electricity and money.

Instead I purchased a Rasberry Pi 3, a Wemo switch, and this little usb thermometer. These things are all you need to remotely check the temperature in your apartment and turn your AC off and on, and together they cost around $100.

The first step was setting up the Pi. By the way, if you’re a first time Pi buyer, here are the basic items you’ll need to get it up-and-running. And here are the instructions for the noobs installation.

  1. Raspberry Pi 3
  2. Case to hold it
  3. Micro USB to USB cord (or Micro USB charger)
  4. Wireless mouse
  5. Wireless keyboard
  6. MicroSD card with standard SD card adapter

Next I got the Wemo switch set up. This entailed installing the app for my smartphone. Wemo actually allows you to turn the switch off and on from anywhere by using a setting called “Remote Connection.” I turned this off since I had read about some security issues with the way Belkin handles remote connections to your home network.

Instead I used this bash script to control the Wemo. It worked right away. I then setup an alias commands for turning off, turning on, and checking the state of the Wemo switch.

The usb thermometer, though I thought it was going to be a pain, was fairly simple to install. First I plugged it into the pi. I used the usb extension cord that came with it, to help normalize the temperature reading, since I think the device gets hot if plugged in directly. I also used these handy instructions to get a temperature reading from the usb thermometer.

Finally, to gain access to my home network from the outside world, I used Weaved. There are many alternatives here, including setting up port forwarding or maybe using a tool like ngrok, but I chose Weaved because it was easy and it seemed fairly secure.

By using Weaved to ssh into the Pi, I was able to check the temperature in the apartment and power on/off the ac accordingly. Obviously there is a ton you can do here with some basic scripting, including hacking your own little Nest thermostat. More importantly for the furballs, you can set up alerts if the temperature gets too high, or if the AC stops responding. You can even use a free dev account at Tropo to text a neighbor who can come and check on them.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: