What’s the stupidest/weirdest project you used a RPi for?

This thread on reddit has some really fun ideas for a Raspberry Pi. Some of my favorites:

The NoIR module is a camera for the Raspberry Pi with no infrared filter, which means you can use IR LEDs to light up a room without anyone seeing.

Photo credit: Multicherry (CC) BY-SA

Smart Home Advice At The End of 2016

 

My friend, a recent dad, asked me for some advice on what smart home stuff he should get. I figured I’d share my response with everyone. This is just an overview of the stuff I recommend for him, a savvy dev-turned-leader. He’ll be reading this, so if you have suggestions or alternatives, leave them in the comments.

To start with, the whole smart home thing is still in the hobbyist phase. I define “hobby” as something you throw time and money at in order to fix problems you created for yourself. Smart homes are a great way to turn time and money into problems!

When things work, however, it’s great to have the house anticipate your routines.

Hub: SmartThings

It’s possible to roll things together without a hub but I like having a central place for everything. By centralizing all your smart home gizmos with a hub, they can talk to each other.  Metcalf’s Law means that the more you add to your hub, the better it gets.

SmartThings is The Wirecutter’s pick. SmartThings is also reasonably open and easy to get started with;  I like the SmartRules app for simple conditional programming. It works with most stuff, has a healthy ecosystem and can be hacked through their dev portal.

You can set up “routines” which are basically saying “turn this stuff on/off”. The routines can be tied to triggers like time of day, sunrise/sunset,or leaving/coming home.

There are a few drawbacks. The SmartThings-branded hardware is slightly cheaper but locks you into their ecosystem thanks to the looseness of the Zigbee protocol. If you stick to more open protocols like Z-Wave (I like stuff from Aeon Labs and Jasco/GE;  Monoprice has some cheaper stuff too), you’ll be fine if you decide to switch systems later on. SmartThings is also cloud-based, but their availability has been pretty solid lately.

It doesn’t support HomeKit natively. You’d need to install the Node.js app Homebridge on a computer in your house. HomeKit is what allows Siri to control things, and also give you a nice swipe-up control panel for lights in iOS 10.

While I use currently SmartThings, I’m really looking forward to moving to Home Assistant as my hub. It’s open source and supports a ton of platforms. Home Assistant is a whole other time suck and so you may not want to start off with it. The biggest thing that’s stopping me (aside from the time thing) is the iOS app. We use the Widgets in Notification Center to trigger routines, and the iOS app detects whether we’re home or not. When it’s solid I plan on migrating all my SmartThings stuff to Home Assistant.

Lights: Not Smart Bulbs

If at all possible, use Z-Wave in-wall switches and plug-in outlets (Wirecutter’s recommendations). One of my goals with home automation is that you should never have to use a phone to do anything. Guests will appreciate not needing an instruction manual to turn on the light.

In SmartThings you can set plugs and switches to turn on/turn off/dim together, so you can have multiple lights in a room all controlled by a single switch. Another nice thing about smart lighting is turn everything off from bed. The plug-in outlets are great at Christmas time too.

In-wall switches require a neutral wire. Open up your switches and look before you buy anything. My house has neutral wires for the overhead lights but not for the switches that control outlets, which makes things much more difficult.

Thermostat: Ecobee 3

I don’t have this thermostat (I have a super-dumb Z-Wave thermostat controlled by rules from SmartThings). The Wirecutter recommends the Nest. That said, the Ecobee has a big following and has impressed me by supporting occupancy sensors (that work with Home Assistant) to make sure that the temperature is right where people are. I’ve hacked some stuff together a poor facsimile with a Z-Wave temperature sensor, but this is a much more straight forward way to go.

I am a fan of smart thermostats in general. Being able to reduce energy usage when you’re out of the house is a no-brainer in terms of efficiency. Being able to turn up the heat from bed is pretty great too.

You will want to check if your thermostat has a C-wire – if not you’ll need to plug the thermostat into the wall. The reasons I went with my thermostat is partly because I don’t have a C-wire and partly because Z-Wave doesn’t rely on the cloud.

Cameras: I dunno, maybe a Foscam?

You’ll probably be happy with one of the Wirecutter’s choices.

Checking whether a kid is up without opening the door is fantastic. That’s all I really use my cameras for.

I have these Insteon-branded Foscams and the video quality is pretty bad but they were cheap and they work. They don’t require any cloud anything – they host their own webserver right on board. They work great at night and if the kids mess with them I can steer them back into position. Here’s a cheap HD Foscam.

Everything else:

Smart locks can be neat. There are some security concerns, but there are also security concerns with consumer-grade dumb locks and first floor windows so you’ll probably be fine if you get one. Never getting locked out of your house is pretty nice too.

Motion sensors can be handy too, for triggering scenes or turning on lights. I like my Amazon Echo but the Google Home looks like it’ll be really good in the near future.

Did you happen to notice my continuous digs at the cloud? I’m a big fan of keeping control of my home in my home and having the lights keep working even if the internet is out. I don’t want to have to dig my switches out of the wall when a cloud company goes out of business. Personal preference.

That’s it for the stuff. Next up will be actual automation rules that to tie the stuff together.

2016 Harold Hotelling Memorial Lecture

The video from the 2016 Harold Hotelling Memorial Lecture has just been posted. This is an annual lecture that Lawrence Technological University hosts in my father’s memory since his passing in 2009. He was a faculty member there and I was fortunate to be able to attend in October before the election.

This year the lecturer was Julianne Smith, former Deputy National Security Advisor to Vice President Biden. It’s a really valuable look at some of the issues that our next president is going to face and I encourage everyone to watch.

The first 9 minutes is an introduction that covers some memories of my father, and every year I’m amazed at how fresh the wounds of losing him are. I have tears running down my cheeks listening to stories about him, reminding me of how much I miss him.

Scott also remembers that shortly after Harold died, and for many months after, he would have this need to go and speak to him. We were in an economic crisis in 2009 and he would start down the hall to go to his office and then regret that Harold was not there anymore.

That’s something I still experience to this day.

Keeping up with “modern web technology”

Chris has a pretty good point. When you sign up to be a developer, you are signing up to never stop learning. That is true no matter what you do in life, but doubly true in computers, and triply so in 2016 putting things on the web.

The fatigue is real. And the meta-fatigue. But each complication that we add to our toolbox needs to justify its existence. Especially new tools. Are we adding them because we need them or because we want an excuse to try them out?

When talking about “modern web technology” you could easily be talking about React, Angular, Angular 2, TypeScript, elm, async/await, Web Sockets, Web Workers, microservices, GraphQL. I can come up with some pretty good reasons for not using them.

When you find out what technologies Chris is trying to use–

https://twitter.com/saltnburnem/status/788755118191677445

–you may get a little more sympathy for his predicament. I did.

What can you do in a situation like this? Part of the job of a software engineer is to be able to justify your decisions. That means being able to point out the benefits that outweigh the costs, and being cognizant of both. The reason the build chain is so complicated is because each link in that chain adds value. If you want to use it you need to be able to explain the problems it solves.

That said, sometimes you just have to recognize when you’re in an environment that doesn’t want to change. Given that your career hinges on changing and learning, you should give a good hard look as to whether your current environment is long-term beneficial for your career.

One last thing on the subject of using work projects to try out new technologies – I kind of like the Choose Boring Technology camp. It’s may actually be better stated as “Choose Mostly Boring Technology” since it’s about limiting yourself to a one or few new technologies. But it’s critical to always be trying out new things. It’s critical that companies need to ensure that people have space to try new things. It’s critical to your career to have that space to try new things.

Photo credit Ashim D’Silva

Testing Code: Intentional vs. Incidental Behavior

Sometimes a maintenance programmer is another developer with an axe. Sometimes the maintenance programmer is ourselves after we have forgotten all about the project. I want whoever gets it to be happy and confident when they make changes.

Having inherited projects in the past (both from others and from past-George), I think it’s important to make sure that a project comes with good automated tests.

Hopefully, in 2016 that isn’t a controversial statement. I do want to explicitly enumerate some of the value tests provide the maintenance programmer:

  1. Testing forces us to simplify and decouple our code, which makes maintaining a system easier. If it’s hard to test, it’s going to be hard to maintain.
  2. Tests provide example usage of the code, so they serve as living examples of how to use the code.
  3. Testing infrastructure. It’s easier to add one more test when they already have tests for other parts. It also provides examples to mimic when someone is getting up to speed.
  4. Good tests define what behavior is intentional.

Let’s talk about #4.

Virtually all code has is intentional behavior and incidental behavior. Incidental behavior is what you get when a detail doesn’t matter to the functionality being developed. An example would be when your UI displays a list in whatever order the datasource provides it. You probably shouldn’t write a test for that; there’s no specified behavior.

In a codebase with tests for the intentional behavior, a maintainer can be confident that any changes they make aren’t unknowingly undoing past decisions. The tests answer the question “is it supposed to be that way?”

When retroactively adding tests (post-hoc testing) you run the risk of documenting the code instead of the requirements. If you find yourself writing tests with the goal of verifying the code works, you aren’t confirming that the code meets the requirements. You’re confirming that the code is the code.

Should you find yourself writing post-hoc tests, what can you do? Try to put yourself in the shoes of the original author. Use git blame to discover why the code was written. Write a test that verifies the original feature and no more.

Finally, I suspect that only testing intentional behavior is in conflict with 100% (or any) code coverage targets. If you have 100% coverage, either you are writing tests to cover code that isn’t part of the specification or you have a specification that is comprehensive to a fault.

Cyber roundup

The Cyber is big again. Huge. I think that Trump’s talk about The Cyber at this week’s debate got a bunch of people talking about cyberpunk. At least, that’s what it looked like in my feeds. I noticed a lot of posts about cyberpunk stuff which I’ve collected here:

Someone built an Ono Sendai Cyberspace 7 deck (the computer used by the protagonist in Neuromancer):

Cyberdeck64

They replaced the keyboard on a Commodore 64 case and stuck a Raspberry Pi 3 in it, but the design is obviously the best thing about it.

Someone else is using the cyberpunk aesthetic for designing their computer space:

Cyberpunk VR Battlestation

And of course someone took the time to adapt the concept art from Cyberpunk 2077 for the Trump campaign:

Cyberdrumph 2016

I wonder if cyberpunk is going to have a kind of retro-futurism revival. It is a sad reminder of the unstoppable march of time to think that the thing that was futuristic in high school is now retro. Time to invest in trenchcoat and mirrored sunglasses.

How to put Amazon Echo shopping list items in Wunderlist

First off, if you use iOS and don’t have an Echo, use Kitchen Sync for your shopping list. It’s organizes everything by area and works with iCloud so it’s super easy to share a list with your family. Plus Adam is a good guy.

We use Wunderlist for our shopping list, so I set up an IFTTT recipe to put our Echo’s shopping list into Wunderlist.

Here’s how you can too:

  1. Go to Mail to Wunderlist Settings and set your Gmail address to go to your shopping list.
  2. Add this recipe (be sure to put me@wunderlist.com as the email address):IFTTT Recipe: Add Alexa shopping list items to Wunderlist connects amazon-alexa to gmail

Some caveats: IFTTT checks the shopping list roughly every 15 minutes, so if something is time sensitive you’re better off using the Wunderlist app. It also doesn’t update the Alexa shopping list when you check it off in Wunderlist, but who looks at the Alexa shopping list anyway?

What I’m Drinking: Bell’s Oktoberfest

Bell's Oktoberfest LabelIt’s September so tonight I’m drinking Bell’s Oktoberfest.

Oktoberfests are sometimes generalized as VMOs because of the overlap between the Vienna Lager, Märzen, and Oktoberfest styles.

Bell’s Oktoberfest is a great beer for when the evenings are getting colder, or in our case just as warm but rainy.

The main thing you notice from an Oktoberfest should be the malt. I enjoy a caramel sweetness in the finish that stays with you, almost cloying, and when the color also evokes caramel. There are definitely dryer and lighter takes on the style too. Bell’s hits the malt notes I love.

The malt should be balanced with noble hops. I couldn’t tell you what Bell’s is using, however I recently had Devil’s Backbone’s Vienna Lager and loved the taste of Saaz hops in the style. As a point of reference, Saaz is the signature hop taste of Bell’s Oberon.

Another Oktoberfest I’ve loved, at the suggestion of my brother Charles, is Ayinger Oktober Fest-Märzen. That my be the best example of the style available. If you can find a bottle this fall I strongly recommend you pick one up. I also really enjoyed Flying Dog’s Dogtoberfest although I haven’t seen it in Southeast Michigan in a few years.

On the flip side is Sam Adams’ Octoberfest. It’s a super tasty beer! But it doesn’t have the toasty sweet malt or noble hops I’m looking for in an Oktoberfest. It might be because I have killed my taste buds and need more malt & hops, but I look for more in an Oktoberfest.

Are there any other VMOs I should check out?

Man Caves and Men

This Guy Studies Man Caves for a Living; Here’s What He’s Learned

There’s a lot of good stuff in here, but the most interesting thing to me was that a man caves are an aspirational space driven by loneliness. If you build it they will come.

Almost every guy tells me he’ll use it to “have people over and entertain.” The conversation gets awkward, though, when I ask him who he’ll have over. Because often, the men will explain, “I don’t have time to have friends over right now. I work a lot and I have children, so I don’t really have friends. But eventually this will be a neighborhood hangout for guys.”

I think it plays into the idea of man caves being a fantasy — a fantasy of male friendship and camaraderie. Research shows that men don’t have as many friends as women, and the kinds of friendships they do have are much less meaningful than those available to women. So maybe part of what they’re building with a man cave is a fantasy of different relationships with men.

Maybe man caves are a symptom of the loss of third places in our lives. We build home bars because our zoning laws prevent us from putting a neighborhood pub actually in a neighborhood. All these people are building a shared space in their home with no one to share it.

The piece also says a bit about the amount of control men feel they have over their spaces as well as their awareness of women’s experience of space in the home.

When I’ve asked straight men what role a man cave plays in their relationship, the most common answer I get is, “I feel like the whole house is hers. And this is a space for me.” When I follow up with, “Okay, but do you think she has spaces in the house as well?” They typically respond, “Absolutely! She has tons of spaces that are essentially hers.” When I press them on which rooms those are, they list off rooms associated with domestic labor, not with leisure — the kitchen, the laundry room, etc.

I think some of this has do with the fact that men feel as though the domestic space isn’t something they have ownership of. I also think it’s a result of men getting more leisure time than women in heterosexual relationships.

Me, I don’t have a man cave. I just have a basement office that I can hang ugly clown paintings, that has my work computer, gaming PC, some various computers I tinker with, a kegerator… OK, but it’s not a man cave because it’s not finished yet…

Photo credit: Cory Doctorow (CC BY-SA)