Ryan Finnie

Home Sweet Home: The "Things"

It all began a year ago with a dot.

Late last year, when replacing all my home’s lights with LEDs (among other projects), I had been spending a lot of time at Home Depot and Lowes. While at Lowes in November 2016, I noticed they sold Amazon Echo products, and the Echo Dot was only $50. I picked one up and started playing with it.

Echo mostly works as you’d expect from a Siri-like device: you say “Alexa, …” and it responds. The full-sized Echo supposedly has decent sound, but the Dot is compact and has, at best, satisfactory sound for music. However, if you want you may hook it up to a speaker via Bluetooth, and that works well. I’ll usually wake up with “Alexa, play some music”, and it often does a good job figuring out music I would like to hear. “Alexa, what’s the weather like?” “Alexa, what movies are playing?” Etc. A little limited in day to day functionality, but worth the $50 as a novelty.

But I was drawn to the developer functionality. I wrote a few apps, one of which I tried to get submitted for publication, but they kept coming back with technical rejections to fix, and I never completed the process. But it’s still an interesting platform.

I was also curious about the “smart home” integration possibilities. I had mostly dismissed the the whole “Internet of Things” idea as gimmicky, but there was one specific use case I could think of for me personally. The backyard patio lights are a string of overhead lights which run to the side of the house and attach to a standard outdoor outlet which is in a slightly inconvenient location. I had been thinking of ways to fix this, and a weatherproof remote controlled relay switch would be useful.

SmartThings screenshot The Samsung SmartThings hub was on sale on Black Friday 2016 for $50 (which as of 2017 is now its regular price), got good reviews, and seemed to have the best variety of device support. Its two main supported protocols are ZigBee and Z-Wave. Both are point-to-point mesh networks: you can pair both Device A and Device B to your hub, and if, say, Device B is not within range of the hub but can talk to Device A, Device A will relay the commands for it. It also supports several other Internet-connected services, such as the thermostat I already happened to have.

I bought the SmartThings hub, as well as a weatherproof control module. The pairing process was simple: press a button on the module to initiate pairing, accept it on the smartphone app, and now I could turn the patio lights on and off from my phone. It also has Alexa integration, so once those were paired, I could say “Alexa, turn on patio lights”.

A week later, I saw that Lowes had their Iris ZigBee (indoor) outlet control modules on sale, and bought a few to play with. Iris is a competing home automation platform to Samsung SmartThings, but as I understood it, SmartThings supported Z-Wave and ZigBee devices from any manufacturer (which gave it a leg up on competitors which tend to be walled gardens). I began the pairing process and… problem. It simply showed up as “Thing” and I couldn’t do anything with it.

I was all set to return them, but it was then I learned about the full extent of SmartThings compatibility. While the app has a very simple interface and limited information and actions available, it turns out there is actually a web interface for developers. Not only does this interface give you a lot more information (radio levels, debugging events, etc), but it actually allows you to write your own device handlers, in a scripting language called Groovy, which is basically the Java equivalent of Lua, and is often used in Jenkins plugins.

With enough work, I could have reverse engineered the Iris outlet and written my own device handler, but SmartThings has a large developer community, and it’s likely someone has already written a device handler for nearly every Z-Wave and ZigBee device out there, even if it’s not part of the core SmartThings platform. I quickly found an Iris outlet handler, imported it, and then was able to pair the outlets.

An interesting feature of these Iris outlets is, while they are controlled via ZigBee, they also have a Z-Wave radio in them and can act as Z-Wave repeaters, strengthening the Z-Wave mesh as a whole. However, SmartThings does not know about Z-Wave devices which literally do nothing but act as a repeater, so when I added the Z-Wave side, it would fall back to a switched outlet. Not really a problem (in the phone UI, it would show a switch to toggle which did nothing), but it did inspire me to learn Groovy and how to write device handlers, and I wrote a proper device handler for Z-Wave repeaters. It was actually a surprising amount of work to write a handler for a device which does literally nothing.

Temperature graph

Since then, I went a little overboard in the novelty of it, and have bought a number of additional devices. As of now, the current list is:

  • Honeywell Wi-Fi thermostat - Previously mentioned; I happened to have this for a few years before I bought the SmartThings hub. It integrates with Alexa, but also with SmartThings, so I have it paired with SmartThings, which exports everything to Alexa and gives me more options than Alexa directly. But honestly, it’s rare I even touch the thermostat beyond its normal schedule.
  • GE Z-Wave outdoor module - Previously mentioned, currently serving the backyard patio lights. They turn on each day at sundown, and off at 11:30PM. (SmartThings supports dynamic “sunrise” and “sundown” in addition to static times.)
  • Leviton Z-Wave appliance module - Currently serving some LED strip lights I have mounted in the alcove above the TV in the living room; I have them listed as “movie lights”.
  • Iris ZigBee (Z-Wave) smart plug - Previously mentioned; I have two of these but they’re not controlling anything at the moment.
  • Iris ZigBee smart fob - A little fob with four buttons. I can’t remember what I’ve set them to do as I never use it.
  • GE Z-wave in-wall light dimmer and GE Z-Wave in-wall light switch - Z-Wave switches which are meant to replace traditional in-wall light switches. They work like normal light switches (and in the dimmer’s case you can hold on/off to increase/decrease the light level), but are also Z-Wave controllable. I have the dimmer on the front porch light and the normal switch on the outdoor rear wall light.
  • Cree ZigBee 60w equivalent LED bulbs - Yes, the light bulb itself is ZigBee compatible. I have four of them, two for the living room lights and two for the bedroom night stand lights. I’ve got each of the pairs in device groups, so each night, it’s “Alexa, turn off living room lights”. As for the bedroom, I have it set to turn them on at 11PM, as I’ll usually go to bed shortly after and read for awhile. Then “Alexa, turn off bedroom lights”. They’re even dimmable (“Alexa, set living room lights to 50%.”) These are the devices I use most often day to day.
  • SmartThings ZigBee multipurpose sensor - This battery powered sensor has several measurements: ambient temperature, contact (like those small battery powered alarms you can add to windows), axis rotational position, and motion. I currently have two, one mounted to the inside of the front door to monitor when it’s opened, and one mounted to the garage door. The device handler’s “garage door” mode is interesting; rather than use the door contact sensor, it uses the axis rotational sensor. When the sensor is vertical, the garage door is closed. When it’s horizontal, the garage door has been rolled up.
  • Zooz Z-Wave 4-in-1 sensor - Another sensor, though this provides some different measurements than the previous: temperature, humidity, light level and motion. It even, oddly, has a tamper protection switch within the case which trips if opened, and is exposed as an acceleration event. Mounted in the hallway, it’s actually sensitive enough that you could figure out when I take a shower by graphing the humidity levels a few rooms over.
  • TP-Link Wi-Fi smart plug - This is actually neither Z-Wave nor ZigBee, but straight Wi-Fi. Normally it calls home and uses a separate app for control (“Kasa”), but it has a local port open, and accepts obfuscated commands (people, XOR is not encryption). I wrote a device handler and proxy to allow SmartThings direct control of it, and it currently controls a floor fan in the living room during the summer.

Be Happy!

I was recently on a date and was asked the most embarrassing thing about myself I would admit to the world. I told her my favorite song, and let me tell you. But first…

My favorite musical artist is They Might Be Giants, and has been since the early 2000s. The circumstances around being exposed to TMBG involved a person and family I want nothing to do with these days (and don’t want to go into here), but suffice it to say the enjoyment in the music itself endured.

I have nearly every album, including oddities such as Flood: Live in Australia. I could probably recite all the lyrics to Flood itself. I play When Will You Die from the album Join Us whenever a prominent Terrible Person dies. (♫ School children stay at home (yeah!) and all the banks will close (yeah!), each year will mark the date on which we celebrate ♪).

I’ve been to several concerts, including arguably the best experience: They opened for themselves in San Francisco as a TMBG cover band, Sapphire Bullets (“the only They Might Be Giants tribute band that matters”). They performed Flood start to finish, left the stage, came back as TMBG and played their main set.

I have a payphone in my kitchen which (besides being fully functional) is programmed to play a random TMBG song when you dial (718) 387-6962, the old Dial-a-Song line.

And yet my favorite song is not a They Might Be Giants song.

There are a number of other artists and albums I enjoy. The Flaming Lips. Joan Jett. Blue Man Group’s studio albums. I have all the albums by Boris the Sprinkler, a relatively obscure punk rock band from Green Bay. (There’s actually a few entertaining stories involving coincidences and them, but that’s for another time.)

I have a thing for female singer-songwriters, usually one-hit wonders who I later discover have other really good content. Sara Bareilles. Dido. Colbie Caillat. My current fling is KT Tunstall.

Often I’ll find an artist and discover an album, get really into it, start looking at their other albums and discover I don’t like their other stuff as much. Architecture in Helsinki and In Case We Die. Björk and Post. Spoon and Ga Ga Ga Ga Ga.

But my favorite song is not by any of the artists I’ve mentioned so far.

Many years ago, I read a series of short stories by a woman named Ali Davis, True Porn Clerk Stories. These were originally a series of blog posts which are no longer available; she later compiled them into a book. Ali worked at one of those “Family Video”-style stores which ostensibly looked like a normal video rental store, but had a large back section for porn rentals which comprised most of their business. The stories are both hilarious and sad, in a similar style to Acts of Gord, which chronicles the adventures in managing a video game store. I definitely recommend reading both.

In one of Ali’s stories, she describes her 7AM opening routine, and her love for Aqua’s 1997 album Aquarium.

What keeps me awake is Aquarium, by Aqua. You may remember Aqua - they were a Danish-Norwegian technopop group that won both worldwide fame and my heart by pissing off Mattel with the song “Barbie Girl”. […] And that’s when I discovered that I love Aquarium. It’s the very finest in Scandinavian synth-pop dance music. It’s incredibly chipper, in a modern Abbaesque sort of way.

She would play Aquarium every morning, from start to finish. The first song is Happy Boys and Girls, and, fittingly for her employment, is about how sex is fun. Needless to say, this album annoyed the customers and pissed off the employees. But it made her happy.

After reading that, I bought the album myself, and grew to love it. And Happy Boys and Girls epitomizes the album as a whole. It’s driving and unabashedly upbeat and happy. I have a few other favorites on the album (I’ll often loop Doctor Jones when running, as the driving tempo lines up well), but Happy Boys and Girls has grown to be my favorite song.

(Before you ask, in my opinion Barbie Girl is not a bad song per se, but is not in my top half of songs on the album. Oh, and go listen to the full album. If you’ve heard Barbie Girl, you probably assumed the girl and guy were putting on over-the-top voices for that song. No, that’s actually their real singing voices.)

I bought a launch day Apple TV 4K... and returned it the same day

I have a big fancy Vizio 65” 4K HDR TV in the living room. My guiding principle on TVs is I won’t buy a TV that I can’t move myself. Problem is, they keep making them larger, but thinner and lighter. So over the decades that limit keeps getting pushed up: 27” CRT, then 37” LCD, then 42”, then 55”, then 65”. But at this point the bezel is basically nonexistent and my arms are only so long, so I think I’ve hit the permanent limit. Besides, I can quit whenever I want.

I have a few entertainment devices hooked up to it, all controlled by a Harmony remote setup:

  • Apple TV 3rd generation (2012)
    • YouTube content, mostly pop science/engineering videos, and watching grown men and women play video games
    • Streaming my ripped DVD collection from a 6 year old Mac Mini in the office
  • Xbox One S
    • Gaming, mostly Hitman these days
    • Twitch (again, watching grown men and women play video games for my amusement)
    • 4K Blu-Ray player
  • Xbox 360
    • Previous generation games, when I feel the desire
  • Wii U
    • Super Mario Maker, plus the previous Wii games I have

When Apple announced the Apple TV 4K a few weeks ago, I decided to order it. I never got the 4th generation because it didn’t really offer anything I needed beyond my current use case. However, the few UHD Blu-Ray titles I’ve bought have come with iTunes codes, so I’ve got them downloaded to my Mac Mini to be served to the Apple TV (albeit at 1080p), and Apple announced they will be upgrading purchased 1080p titles to 4K, so I figured I’d give it a shot and pre-ordered it.

I watch a lot of YouTube content, usually in short bursts of 10-20 minute videos between doing other things, so the YouTube experience is important to me, more than movies or gaming. Here’s a summary of the experience of the YouTube app on the older 3rd generation:

  • Home shows a changing array of videos YouTube thinks you may like, and is generally good at this
  • Subscriptions shows latest video activity from channels you subscribe too, as well as a list of channels
  • My YouTube shows your view history, your videos, your playlists, etc

When watching a video, you have several actions available:

  • Left/Right to rewind/fast forward.
  • Select to pause/unpause. While paused, it shows you a menu of the Up Next video and a few Related videos, the ability to thumbs up/down the video, and to go to the video’s channel.
  • Up/Down to show video position, along with basic information about the video (title, channel, views, release date). Down is quite useful: when you press it, the seek bar is divided up into about 15 hash marks, and you can go left/right to quickly seek to a general point in the video.
  • Back to exit out of the video.

Now, here is how I discovered it works on newer models, including the Apple TV 4K:

  • Home, Subscriptions and My YouTube generally look and work the same as before.
  • Left/Right will still rewind/fast forward, but I rarely use those as it takes too long and can be inaccurate. Mind you, I’m talking about using a Harmony remote here, not the touchpad remote which comes with it, which seems to be a slightly better seeking experience.
  • When you press Select to pause, the video menu is completely missing. No way to browse related videos, or go to the video’s channel. While paused, you can use left/right to go back/forward a fixed 10 seconds, no matter the length of the video.
  • When you press down, the hash mark navigation no longer exists. Instead it now shows you the title and screenshot (no release date or view count), and “Visit this video on your computer or laptop and click the flag icon to submit a claim” followed by the video’s URL. What?

The lack of hash mark navigation is annoying but I could have lived with that change. But the lack of the Related menu is a deal breaker for my use case. First of all, it’s useful to find, well, related videos. If you let a video run to the end, it will go on to the next related video, but that’s not always what I want to watch.

But more importantly, most YouTube videos have about 30 seconds of junk at the end which I don’t want to watch. On the 3rd generation, once the content portion of the video was done, I could press Select to pause, then immediately go to the next video or pick a related video, or go Back. With the 4K, my only options are to go Back, or wait until the end for whichever video YouTube has chosen for me.

So for my primary use case, the YouTube app is basically broken, removing half the features I use. Funny enough, the primary reason I bought it (4K iTunes purchase upgrades) is also broken, or at least not what I expected. Turns out you can’t download the 4K movies, only stream them from the Internet, which can be hit or miss. And I’ve already got the 4K Blu-Rays, so I may as well watch them with a consistent experience via the Xbox One.

And so ends the journey of a launch day Apple TV 4K. It spent a week traveling from Hong Kong to my front door, then a few hours later from my front door to the Apple store a few miles away. The five year old 3rd generation Apple TV will continue to be my primary multimedia source, until 1) YouTube improves its app, 2) it dies, or 3) planned obsolescence forces me to upgrade.

Amy, the Above Average Gaming PC

Amy, the Above Average Gaming PC

As I mentioned in a previous post, my home systems are named after Futurama characters. The only hard rule I’ve had is I’ve never used “the big three” because I didn’t want to assign assumed significance to them, but other than that, the only loose sub-convention is women tend to be laptops and desktops.

Amy, the Above Average Gaming PC leo and inez (Amy’s parents) are the G4 Mac Minis. nibbler is the main router and “omniserver”. linda (Morbo’s newscast co-host) is my laptop, a Lenovo ThinkPad X250. ndnd (Lrrr’s wife) is a (“modern”; 6 years old) Mac Mini media server. And amy is my Windows gaming PC. When I replace a “standard” computer, I’ll keep the same name; for example, my main laptop has always been named linda.

(While I don’t anthropomorphize my computers, I found it awkward to write the rest of this post while mixing e.g. amy and “it” in the same sentence. So for the sake of convenience and narrative, sometimes I’ll be using gender pronouns, sometimes I won’t.)

amy had been getting a little outdated. Normally what I tend to do is make incremental upgrades of desktop computers every other year or so. A full list is here at pcpartpicker.com, but in general, all of the main components were 4 to 5 years old:

  • Intel Core i5-3570K
  • 32GB DDR3 RAM
  • Dual AMD Radeon HD 7790
    • Unless you’re seriously into a single game which has good support for SLI/CrossFire, I’d recommend not doing it, as overall compatibility can be a nightmare.
  • 250GB Samsung 840 Pro SSD + 2TB WD Black HDD

A pretty decent system at the time, but it’s dated. Notably, a month or so ago I bought and tried to play Player Unknown’s Battlegrounds. Even at lowest settings, it was nearly unplayable. That was the first time I took advantage of Steam’s refunds.

So this month I decided to build a new gaming PC (also to be named amy). AMD Ryzen is the new hotness, so I went that route. I don’t think I’ve built an AMD system since Intel introduced its Core CPUs; the last AMD system was probably an Athlon 64 X2. And while the AMD Vega video cards were just released, they’re not very price competitive. Nvidia GeForce 10 series are somewhat expensive too due to Bitcoin miners, but an okay deal can be had on a 1060.

As previously mentioned, I have tended to do incremental builds: buy about 30-50% new components to replace, and re-use 50-70% of an existing system’s components. I don’t think I’ve ever spent more than $750 at a time on computer components. But as it’s been more than a few years since I’ve done this, I decided to build a completely new system, from the case up.

Let’s just say, I spent a bit more than $750. It wasn’t exactly “money is no object”, but I did suppress my urge to try to save little bits here and there. “Hmm, the Western Digital 256GB NVMe drive is $100 and should work OK… But I know the Samsung 960 EVO will be good and is only $20 more.”

Of course, those little splurges add up over the course of an order, and the initial cost after shipping and tax ended up being $1,599.95 (no, really). It’s not exactly a top of the line gaming PC, but it’s comfortably above average in every respect. Hence the name.

Amy, the Above Average Gaming PC

Amy doesn’t like to brag. She’ll freely admit she’s not a Threadripper with triple 1080 Tis and liquid nitrogen cooling. But she’s pretty good. Sufficient. Above average. She once wrote a song which her friends liked, but doesn’t plan to go pro or anything. She enjoys dim sum. She has a 780 credit score.Amy, the Above Average Gaming PC

Amy, the Above Average Gaming PC I’ll admit, I went with the Fractal Design Define C Tempered Glass case because I thought it looked sexy, in an understated way. Of course, the RGB lighting which happened to come on the motherboard and graphics card belies that understated tone, but it still works.

This is the first time I’ve ever put even modest effort into cable routing and presentation in a case. Ten years ago, nobody would have considered routing most of the system’s cables behind the main motherboard tray, but now you have cases which are built with that in mind, with cable management channels, rubber grommets between the front and back, and PSU/hard drive basements. The result is a clean, simple layout in the front which lends itself well to display behind glass.

The specs are very respectable and should last awhile:

  • AMD Ryzen 5 1600X
  • 32GB DDR4 RAM
    • 2x 16GB sticks with 2 slots free; I believe since it’s at 2400MHz, 64GB should be possible in the future
  • Nvidia GeForce GTX 1060 6GB
  • 250GB Samsung 960 EVO NVMe SSD + 2TB Seagate FireCuda SSHD

I had originally ordered a Cooler Master Hyper T4, but realized after it arrived that the only native AM4 mounting direction is vertically, which would have blocked 3 of the 4 memory slots. Luckily I had a new Arctic Freezer 7 Pro, which I don’t even remember buying, but it was in a box in storage. It fits, and goes with the black/white aesthetics of the Fractal Design case.

I still don’t like how the cooler is mounted vertically, and will probably go with a Hyper 212 EVO and AM4 bracket eventually. The problem is the AM4 bracket must be ordered directly from Cooler Master, so it may take awhile. But thermals aren’t a problem; I’m not overclocking, have two 140mm intake fans and one 120mm exhaust, so air is constantly moving within and out of the case.

The first game I played on the new system? Flaunting technology, I played the original Half-Life, which is 20 years old this year. The graphics card didn’t even bother to turn on its fan.

Big Brother in Motion

A few weeks ago, I installed a networked security camera overlooking the front yard. It performs three functions:

  1. It continually records a 640x480 10fps low-bitrate stream.
  2. When motion is detected, it saves a 2304x1296 20fps high-bitrate recording of the event. The camera can do 30fps, but only at 1920x1080 or lower, so lower framerate is an acceptable trade-off for a higher resolution.
  3. When motion is detected, it saves a series of three 2304x1296 JPEG images, one second apart each.

The motion detection normally activates when a car drives by, so most of the burst shot images were of a car at three different positions. I decided to average each of the sets together from a three day period, and the result was pleasing.

convert 00001a.jpg 00001b.jpg 00001c.jpg -evaluate-sequence mean 00001.jpg

From there, I converted the sets of averaged images into a video.

ffmpeg -framerate 5 -i %05d.jpg -c:v libx264 -profile:v high -crf 20 \
    -pix_fmt yuv420p -s 1920x1080 -r 30 output.mp4

The invocation converts the images into a 5fps video, forces yuv420p color (as the night shots were true greyscale), downscales to 1080p, and upconverts from 5fps to 30fps (as I wasn’t sure if YouTube would properly handle a 5fps video). The music was added post-upload from the YouTube audio library, and I’m very pleased with how well that track syncs up with the events in the video itself.

The input images were actually hand-curated a bit before making the video. I removed all images of me (walking to the mailbox, backing out of the driveway, etc) and all images where it’s unknown why the camera motion detection occurred (which are rare).

A large number of removed images were due to the separate security light underneath the camera, which has its own motion detection and is more sensitive and prone to false trigger, especially around dusk. The security light will turn on, causing a camera event. The camera will then realize it has enough light to switch from greyscale to color, causing another event. A few minutes later, the light will turn off; third event. The camera will switch from color to greyscale; fourth event. Repeat a few times until both the light and camera settle on “really, it’s dark now”.

Also of note is the first day was a rare day (for Northern Nevada) when it rained. A remote friend pointed out the craziness of it raining three times during a single afternoon, completely wetting the roads each time, and then completely drying out each time before the next rain. Yeah, that happens.

« All posts