I’ve been doing little bits of home improvement lately and I think this one is the nerdiest yet, by far.
Observation one: whenever I’m in apartment, I want the PC on and music going. Turning PC on is the first thing when I arrive, and turning it off is the last thing when I leave.
Observation two: right next to front door there is a light switch that does not appear to be hooked up with anything. And there’s a loose bit of cabling hanging from ceiling.
Enter home automation, idiot style.
First, I verified that the light switch controls the hanging bit of cable. Obviously it was intended for a light fixture that didn’t get installed. Next, I got an AC socket from home-depot type store and wired it up:
Get the idea where this is going? Next up, let me present the “brains” of my home automation solution:
It’s an Android phone with busted screen that has been sitting around here and not doing anything useful. It’s an ideal device if you think about it: it has WIFI, it has internal battery, it has screen, and it is relatively easy to develop for. Crucially, it can sense whether it is being charged or not. Much easier to get going than rPi or Arduino-likes. And of course it is a complete overkill for what I’m going to use it for.
So, a phone hanging from ceiling… Looks bizarre for sure, but the ceiling is high there, and the spot is such that people would not normally look up and wouldn’t notice it.
Rest is simple, a custom Android app that sends Wake-on-LAN packets, and runs shutdown commands over SSH. (GitHub repo here). Now, as I come in, I can turn the light switch on and the PC turns on. Turn it off and PC shuts down gracefully.
I think next I should extend the app to have voice recognition. It would then wake the PC whenever it hears me saying “HELLO COMPUTER”.