Tuesday, December 31, 2019

Two generations of Shirey boys in graph form

Growing up, my parents marked my brothers' and my heights on a 1x4" board they kept in the hallway closet. Generally around our birthdays, they would scratch a line in it with a pen and write the date. This seems pretty standard practice, as I know of several other families that do this.

When our boys were little, Andrea and I inherited the board that my parents started a generation ago. Since Jake and Reed's heights are tracked on the reverse from mine and my brothers', it's quite easy to compare how they stack up against us.

And for a moderate amount of effort, it's also easy to input these data into Excel* and draw some lines. I knew that both my boys were roughly tracking Nate's height (and are actually a little taller than he was at their ages). I hadn't realized that for the longest time, I lagged by that much:

For what it's worth, I about caught up to Nate's height, though it didn't occur until after my parents stopped marking our heights on the board. I also hadn't realized that Matt and I were tracking at about the same height.

*Yes, this graph is actually drawn in PowerBI - it turned out to be easier there using the appropriate dimensions than in Excel)

Sunday, September 29, 2019

Back to Stone Gardens

After a long time away, we finally made it back to Stone Gardens as a family. The boys outgrew the shoes we bought for them for Christmas a few years back, but no matter.

Most the afternoon was bouldering:

But Reed got back into the autobelay that he loves:

Both the boys even tried some top-roping with me belaying them -- a great occasion for me to teach them climbing commands. (No photos, of course, since we were on-belay at the time.)

I also discussed with the boys that, back in college, we had to mark our gear in some way to discriminate between your gear and mine. We used cheap nail polish to identify our gear. Turns out I still have gear from my college days -- yellow and green was me.

This morning, we were all sore according to the climbing we did. And we're all looking forward to the next go.

Monday, July 15, 2019

Internet of things air conditioning

The last few summers have gotten warm enough here in the Pacific Northwest that we got ourselves a free-standing AC unit, but even it can't really keep up for me. Most summer nights, it's cool enough outside, but the house retains enough heat that we have to ventilate. While Andrea and the boys were in Minnesota these last two weeks, I decided to get around to a project I'd been rolling around for a while: automate the monitoring of inside and outside temperatures, and when it's cool enough outside, kick on one fan for intake and one for exhaust.

Bill of materials

Making the temperature sensor

The first step was, compared to my kegerator project, significantly simpler. My DHT11 sensor already has its pull-up resistor built-in, so wiring this up was little more than connecting ground-to-ground, voltage-to-voltage, and one-pin to a somewhat arbitrary GPIO. Had the microcontroller not come with header pins, I probably could have done away with the PCB.

I played around with getting this working on a breadboard before soldering it up, but this whole process was the least interesting of the whole project, so I'm omitting this info. At the end, I had a component that looks like so:

I had planned to flash the NodeMCU to use MicroPython, but it ended up being a fairly significant pain in the ass to do, and it turns out you can make wifi, temperature readings, and MQTT messages work in just under 60 lines of C code (and C is far from my strong suit). The DHT11 can apparently read at 0.5 Hz (one reading per two seconds), but this is far faster than I need, so I configured it to take a reading every minute.

I already had Home Assistant running on one of my laptops with an MQTT broker, so plugging this sensor into the wall and letting it sit for a while gives me the temperature over time inside our house:

I put this sensor in the boys' room because that's the place I want to make sure is properly climate-controlled.

Next, I debated how to deal with a second temperature sensor outside. Our backyard is on the south side of the house, and it can get a lot of sun. A sensor sitting out there could bake in the sun and get ruined. The front of the house would be protected from that, but there's only one outlet, and it's in a rather inconvenient place.

I decided instead to make an API call to OpenWeatherMap. Their data are updated every ten minutes or so. Having lower time granularity is no big deal to me, and they provide a lot more data than I'd get with a DHT11 and at no cost, to boot. So I setup a cron job to run every ten minutes, publishing the temperature to my MQTT topic. Another 40 lines of code, this time in Python.

Again with the data, but this time, I'm doing a ten minute average of my own sensor with the external data overlaid:

While I've had Home Assistant installed, I haven't been doing much with it, and I've found their nomenclature and configuration to be pretty wonky, and the UI is jarring as well, making it pretty hard to figure out. It took some time, but I was able to get two of my smart switches setup thanks to a contributed VeSync component for Home Assistant. There are certainly some kinks to work out, though I'm not sure if it's with VeSync or with Home Assistant's Lovelace UI. I renamed my switches for this project, yet they're still showing up with some default values:


 No matter. I'm not using the UI for this, anyway. I added a new automation in my automations.yaml to, kick on both smart switches when HomeAssistant receives an MQTT message to the "ventilate" topic with payload "on". Similar for turning it off. From a console, I could turn on and off the fans with a simple command:
$ mosquitto_pub -h localhost -t ventilate -m "on"
$ mosquitto_pub -h localhost -t ventilate -m "off"
The final piece was to automatically send this message under the right circumstances. There's more code to my script, as it's handling both DHT11 and OpenWeatherMap MQTT messages, but the relevant code for comparing recent inside/outside temps is here. Basically, if it's at least five degrees cooler outside than inside, it'll start ventilating. If it's the same temp or warmer outside as inside, it stops. I also added some time bounds so we're not running a rather loud fan in the morning when we're enjoying each others' company.

VoilĂ  ! I have yet to measure how effective this setup is for actually cooling the house, but for a paltry $25 or so and a few hours of time, I'm rather excited by what I find.

Tuesday, May 28, 2019

Intergenerational height comparisons of Shirey men

Today is Reed's 10th birthday, and we started off with a little treasure hunt for him to find his gifts. Here, he discovers the clue on Felicia, the flamingo in our flower garden:

As often as we remember and feel like it, we measure our boys' height on a 4x1 board – the very same board, in fact, that my parents used to track our growth over an 11-year period. So we took measurements, and I decided to track how the boys are doing compared with me and my brothers. I took two photos of the board and did a quick edit in Paint.NET to put the front and back next to each other. Jake wanted to pose in there as well:

Not the birthday boy, but just as awesome.

In the photo, you'll see five superimposed colored lines marking the heights for each of five Shireys at approximately ten years old (some measurements when we grew up weren't on the birthdays). The vertical tranches are, from left to right: Nate, me, Matt, Jake, and Reed. Three points to make:
  1. Jake and Reed are, controlled for time, pretty darn close to each other in height. (Not sure about weight, as we haven't compared.)
  2. Both of them are a good inch taller than Nate was.
  3. I'm the shortest of the whole lot at this age.
I'm suddenly very interested in seeing these data in a single graph to see when each of us really hit our strides. I'm just about the same height now as Nate (maybe just a bit shorter?), so I apparently hit my growth spurt later.

Anyway, Reed's come a long way. Not just in height, though that's a nice, observable metric, isn't it?

Monday, May 13, 2019

Ramping up travel

Every few months, I go through our finances with a magnifying glass. Every transaction posted to our checking account and to our credit card gets categorized. There's some squishiness to the classification -- should the transaction at Target be Groceries or Household? But it gets us pretty reasonable insights into what we're doing.

A few years ago, I discovered that we had been paying $11/month to Amazon for Kindle Unlimited - a service we had never used. Armed with the data, I was able to get them to refund me 12 months of the service; so let it never be said that my penchant for data analysis is for naught.

This most recent trek through our data, Andrea asked me how much money we're putting into travel. Because our money is grouped by month, we can look at this either on the whole or as time series. As expected, our percentage of all expenditures tracked dedicated to travel has risen sharply in the last few years:


 NB, one of the intentional approaches we're taking here with how we're categorizing things is that basically everything we spend our money on when we're traveling (at least abroad) is considered Travel. The meals out aren't Meals Out; gifts, groceries, gas, and everything else is done wholly in service to traveling and as such falls into that category.