Press "Enter" to skip to content

Category: Home Automation

Home Automation Dashboard – Version 3

Over the past two years, I’ve had a few iterations on my home dashboard project. All of the integrations for a “smart home” have been rather dumb in the sense that they’re just handling static transactions or act only as a new channel for taking actions. I wanted to change this and start bringing actual intelligence into my “smart” devices. A major problem in the current smart device landscape is the amount of proprietary software and devices that are suffocating innovation and stifling the convenience and luxury that a truly “smart home” can bring to consumers/homes of the future — this means improving my standard of living without effort, not just being a novelty device (a “smart” lightbulb that can be controlled through another novelty device like Amazon Alexa). In this vein, I’ve been connecting my devices (not just my smart devices) into a single product that enables devices to interact with each other without my intervention. This project has slowly morphed from a UI that simply displayed information and allowed on/off toggling to an actual dashboard that will take actions automatically. There’s not much special behind many of these actions at the moment but it’s a starting point. Home…

Consuming RTSP Stream and Saving to AWS S3

I wanted to stream and record my home security cameras to the cloud for three reasons: 1) if the NVR is stolen, I’ll have the footage stored remotely, 2) (more realistically) I want to increase the storage availability without having to add hard drives, and 3) I want to increase the ease-of-access for my recordings. There are a number of services that do this for you (such as Wowza) and you can also purchase systems that do this out-of-the-box. The downside to services like Wowza is cost — at least $50/month for a single channel streaming without any recording – and the out-of-the-box solutions are expensive and run on proprietary platforms that limit your use and access…plus it’s more fun to do it yourself and learn something. The solution I arrived at was to use AWS Lightsail and S3. This gives me the low cost, ease of scale, and accessibility I desire. Due primarily to the transfer rate limits, Lightsail will only work for small, home setups but you could “upgrade” from Lightsail to EC2 to mitigate that. After all, Lightsail is just a pretty UI that takes away all the manual config work needed to setup an EC2 instance…

Indexing my movie collection

#FirstWorldProblems – having so many DVDs that you forget what you already own and end up buying multiple copies of the same movie.  While 126 movies isn’t a massive collection, it’s enough for me to sometimes forget what I have when I’m pillaging the $5 bins at Best Buy and Target. To solve for this, I created a Google Sheets list of my collection so I could check what I have from my phone.  After typing all the titles into the list, I realized it’d be very easy for me to use the code I wrote for my DirecTV project to scrape additional details for the movies and create a nice, simple UI….so I did: What it does Using The Movie DB API, I pull several pieces of information about the film and store it locally: title, image, release date, rating, budget, revenue, runtime, synopsis, genres, cast, etc. Storing it locally reduces repetitive, slow API calls and allows me to cleanly add additional attributes like whether it’s DVD, Blu-Ray, Google Movies, Amazon Video, etc. Adding new titles is easy – I just type in the name and the rest of the details populate immediately.   There are two views: one shown…

Home Automation and NFC Tags

NFC has proven to be a pretty useless technology for cell phones (unless you’re one of the people who use you Google Wallet/Apple Pay).  Nevertheless, I decided to buy some tags and play with them because they’re so damn cheap (just over a dollar each, depending on the type). One useful application of NFC tags is setting “scenes” using my existing home automation setup.  By setting a tag where I usually place my phone at night, I can trigger several events all at once.  When I play my phone on my nightstand, the following events are triggered: If it’s a weekday, set my alarm for 7:00 AM. If an alarm was set, the phone will adjust its volume and say “Alarm set to 7 AM”. Using the same text to speech, the phone will say “Goodnight, Kevin.” After pausing for a few seconds, it’ll POST to a simple script I wrote  and turn all the lights in the apartment off before setting it’s volume to mute for the remainder of the night. It’s a simple way of automating my night time routine and is likely the most practical use of NFC tags with home automation (and it’s not super practical, at that).  If you…

Expanding the Home Dashboard

In the previous post, I outlined the Home Dashboard touchscreen for controlling lights, temperature/humidity, displaying Amazon Echo information, displaying who’s home (via bluetooth sniffing), and displaying what was being watched on DirecTv.  As this dashboard is intended to be a sudo remote control for my home, I thought it made sense to be able to actually control the TV with it. After a bit of tweaking and some UI work, the end result is a super-quick (HTTP response is ~30 milliseconds which feels nearly as quick as the standard DirecTv remote) interaction between device and DirecTv receiver. From my home dashboard/touchscreen controller, I can select the title that’s currently playing to launch the remove control (pictured above).  You’ll notice that the touchscreen controller can do everything the standard remote can do, including guide browsing, DVR browsing, etc.

Home Dashboard using a Raspberry Pi

After creating a desktop home automation dashboard and, later, a live stream “digital picture frame”, I got the idea to combine the two into an always-on control panel that condenses everything I care about into a single kiosk which can sit on my end table or nightstand. What it does It’s essentially a condensed UI of the desktop version linked above which uses the same databases and processes. Current indoor temperature and humidity (via DHT11 sensor) If my Amazon Echo is playing music, it’ll display the artist, song, and album If I’m watching TV, it’ll show the title, channel, and image/movie poster Display unique icons for each person in the house (by sniffing for their phone’s bluetooth signal) It’ll show the status of my lights (on/off) and update if that status changes (using the Wink API) Through touch screen, allow me to control my lights in near real-time. Materials Used A Pi3 Pi display A case Indirectly, I also engage my Wink Hub, Amazon Echo, and DirecTv receiver. How it works Much of this (temperature, humidty, DirecTv and Wink control) is covered in “The Foundation” post.  Specific to collecting information from the Amazon Echo, I use IfTTT and the Maker channel.  Each time my…

Using a Pi to measure TV habits

As noted here, I’m using the the DirecTV SHEF API and a Raspberry Pi to poll my DirecTV receivers every minute and store what they’re doing into a MySQL database. After ~6 months of storing that data, I thought it’d be interesting to analyze some of it.  After all, do I really watch enough HBO and Starz to warrant paying for them every month? Channel Preferences 25,900 minutes of TV watched (~2.25 hours per day…eek; still less than the national average!). 2,612 minutes of that was recorded (10%). NBC is our favorite channel (3,869 minutes watched, 15%). E! is our second favorite channel (1,911 minutes watched, 7.37%). Gotta keep up with those Kardashians. Premium movie channels (HBO, Starz, Encore, Cinemax, etc) were watched 6,870 minutes (26.52%) – apparently worth the money. Premium movie channels were recorded only 571 minutes (lots of ad hoc movie watching, I guess). NBC is our most recorded channel (479 minutes) followed by HGTV (391 minutes) and ABC (330). Time Habits Sunday is the most watched day (no surprise here) with 7,157 minutes watched (28%) Saturday is the second with 5,385 (21%) Wednesday is the least watch with 1,144 (4.4%) April was our biggest TV month with 6,413 minutes…

A month of tinkering

New Design The original design wasn’t “clean” feeling and didn’t function too well on mobile or even tablet displays.  I changed that up a bit and the new design has a lot of transparent divs, bokeh background images, and some jquery to make actions a bit smoother. Wink Integration Improvements The initial integration of the Wink API wasn’t that great.  I was using PHP to trigger shell scripts which would then make the API call – quite messy and had several opportunities for failure.  This method also made a new request for a bearer token each time an action was taken so if I turned on three lights, I requested three unique tokens from the API.  I’ve since cleaned that up and now use a single token per session and the API calls are all made in a single PHP file.  This still isn’t the cleanest or safest way to do this but it works for my usecase. While doing this, I also added the ability to dim some lights (such as the kitchen light which we leave on during the night).  The next step is to fetch the current state of the lights so that we can eliminate the…

The Foundation

Purpose Let’s just get it out of the way now — there’s no true practical purpose or value in doing this.  I took this on as an experiment and opportunity to learn something new. What is it? Using a Raspberry Pi, some sensors, and a lot of Googling with trial and error, I took my first step into custom home automation (Wikipedia).  I can control lights, DirecTv receivers, some appliances, measure indoor temperature and humidity, determine who is home, and view indoor/outdoor webcams through a single UI. Materials and Cost Raspberry Pi 2 – $38 GE Link A19 Bulbs x7 – $11 ea USB Bluetooth Dongle – $9 DHT11 Sensor – $5 RPI Camera – $23 Some jumper cables – $3 Screenshots   Control Lighting Control Each tailed light uses a GE Link bulb which is connected to a Wink hub.  This allows for on/off control, dimming control, on/off scheduling, and dimming scheduling (such as gradual increases in brightness in the mornings).  Wink comes with a nice app but I opted to use their API so I could incorporate it into the custom UI/dashboard along with everything else. Cameras I’m using an old D-Link camera to gain outdoor views and…