Updates to Home Assistant Projects

My garage temp sensor, running home-assistant-temperature-monitor stopped working several months ago. I didn’t have time to figure it out and then summer hit, when it’s not important since I don’t heat up the garage before I workout. This weekend I finally got around to troubleshooting the problem.

Turned out I needed to install Adafruit_Python_GPIO. I must have updated my code at some point without fully testing, otherwise I’m not sure how any of it worked before. I didn’t investigate that though; I was more concerned with fixing it and doing some improvements. I updated the OS and everything on the Raspberry Pi since it hadn’t been turned on in quite some time.

Earlier this year, another Pi on my network, the one running Home Assistant and Pi-hole, ran out of disk space without warning. I’ve wanted to put in a notification system so it never happens again, so I updated home-assistant-pi to report the disk use % to HA. I added an automation to notify me whenever it’s above 90% for one of my Pis. I also reworked all of the automations in home-assistant-pi to make it easier to configure each time I get a new Pi.

img_9705

That all took much longer than I expected. Most of the trouble was trying to understand the Jinja template system used in HA and where it can be applied to configurations. I think I’m finally getting the hang of it.

While writing this post, I found an old draft with some other updates to home-assistant-pi I never published. Maybe I never finished and that’s why everything stopped working! Here’s a list of some previous updates:

  • Fixed errors causing program to crash.
  • It wasn’t reconnecting very well, especially if Home Assistant went away (ex. for a restart after an upgrade). Rewrote how the MQTT connection works.
  • Switch from PushBullet to iOS notifications.
  • Changed show/hide Home Assistant group automations.

Now that this stuff is running again and I have a better understanding of the Home Assistant automation capabilities, I need to continue the series of posts I planned on home automation. It’s been five and a half months since I published Part 1!

YI 4K Action Camera – Screen Replaced

The replacement came in for my shattered YI 4K Action Camera touchscreen. I was surprised it only took 10 days to get here from Shenzhen, China.

I followed this YouTube video, even though mine isn’t the newer 4K+ version of the camera. The only difference I noticed was the type of connector for the shutter.

I made one mistake, as you can see below, cracking the front cover above the lens. It won’t affect the performance, so not a big deal.

I wasn’t nearly as fast as the guy in the video, but I did it in less than an hour. Easy peasy compared to replacing the screen on an iPhone, which I will never attempt again.

Kacilia Tru-Align Body System

When I worked a booth at the National Wellness Conference a couple of months ago, I came across Kacilia at one of the other booths. The idea of this system/technique is to lay face down on a bunch of pads, which set the spine into a neutral position, and let gravity work. I tried it out for about 15 minutes while I was there and it felt really good. The inventor did an eval on my body positions before and after, which showed significant improvement. She claims to have had people reverse their spinal issues after several months of using this for 20 minutes a day. My issues come from a compressed L5 and she was confident her method could help me.

There was no way I was going to pay $400 for a fancy mat and some pads though. I figured I could create my own version. I already had 2 foam rollers, a yoga block, and a yoga mat. I purchased a few more items:

I bought this other stuff several weeks ago, but hadn’t used it yet. Yesterday I tweaked my back pretty bad again, so it’s time to try something new.


It may not work at all and I don’t know that I’ll use it daily, but it’s worth a shot. Having an excuse to take a 20 minute nap sounds pretty good too. Here’s a demo video of the actual system.

2017 Maker Faire Detroit

On Sunday I spent almost 6 hours at the Henry Ford Museum for Maker Faire Detroit. It was a great venue for it because attendees had access to the museum as well.

IMG_9631.jpg

Maker Faire is a gathering of fascinating, curious people who enjoy learning and who love sharing what they can do. From engineers to artists to scientists to crafters, Maker Faire is a venue for these “makers” to show hobbies, experiments, projects.

We call it the Greatest Show (& Tell) on Earth – a family-friendly showcase of invention, creativity, and resourcefulness.

Glimpse the future and get inspired!

Maker Faire Detroit

It was inspiring to see all of the makers and I had a blast geeking out.

Other posts about the event…

DIY Overhead Camera Rig

I’ve been recording more videos at my hobby desk and hanging a GoPro from my LED desk lamp via a Gorillapod wasn’t cutting it. Having to run GoPro’s Capture app on my iPhone connected over a WiFi network broadcast by the GoPro in order to see a preview of the camera view was also a pain point in my setup. I think I’ve even mentioned wanting to get a new camera in other posts.

My friend Casey was looking for a GoPro for his 5-year-old son, so it was perfect timing to get rid of my GoPro HERO3 Black Edition. I figured I’d just upgrade to the HERO5 Black, but it’s $400 for just the camera. After doing a little reading, I decided to get a YI 4K Action Camera with Selfie Stick, 2 spare batteries + charger, and an accessory kit. All of that ended up being $100+ cheaper than the GoPro HERO5 Black itself!

I had also been looking at a lot of videos and tutorials for building my own overhead camera rig. Then I remembered I had this lamp stashed away in a storage closet…

img_9566

I took the whole thing apart.

img_9567

I started putting things back together, using only the pieces I needed. I immediately noticed an issue. The swing arm would go up to about 20 degrees shy of vertical, but it wouldn’t go down more than this…

img_9568

I tried to get a decent picture showing how this joint works, but it’s hard to see in the photo below. There is a slot carved out of the edge and then a screw that hits the edges of the slot.

Here’s a better picture at just the notch…

img_9575

I needed to extend one side of the notch, which was quick work for my Dremel.

img_9576

After the adjustment, the arm can swing down to about 45 degrees.

The next problem I faced was needing some type of bracket where the light bulb used to be connected so I could attach the camera. I found this old ceiling light fixture bracket in my box of goodies. The threaded hole in the middle was a perfect match to the bolt on the end of the stand.

img_9573

I didn’t need the entire thing so I cut off one side with my Dremel.

img_9577

I found another part (the long arm type piece you see below) in my goodie box, which fit perfectly in the camera mount pieces. I had to use a couple of mount pieces from the accessory kit to get the camera oriented in the correct position relative to the stand. There was one trip to Home Depot for the wingnut, thumb screw, and small washers (definitely needed a few for spaces with the camera bracket at the bottom). Here is everything laid out before assembly.

Of course I had to test it out right away, especially since I hadn’t even turned on my new camera yet. I grabbed a couple of fidget spinners and adjusted the rig.

img_9579
I may need to create a cover or paint the base due to the reflection, which won’t be ideal for lighting.

Being able to frame the shot immediately with the camera LCD is amazing compared to the shit show I used to do with the GoPro.

Check out the video…

In case you weren’t keeping track, blue spun for 1:38 and black went 4:58!

Did you notice the shaking at the beginning of the video when I started up the spinners? Not good. I thought it would be super stable because the base of the stand is quite heavy (reminds me of the sand filled base of a moveable basketball hoop). Most of the movement seemed to be coming from the bracket I cut. An unused dead bolt bracket from my goodie box matched up well enough in size after making one of the holes bigger. This allowed me to double up the thickness, which does seem to help.

img_9581-1

I’ll have to do some testing while working on a project on the desk, because if this rig shakes the camera every time the desk moves a little bit it won’t be good.

As a bonus, there are some really useful parts of the lamp left. Maybe I can come up with a neat DIY lamp some day. The foot switch is also neat and could be used for a lot of things.

img_9572

Home Fixes

Yesterday I set out to fix a couple of things around the house.

Garbage Disposal

It stopped working several weeks ago when the cleaning lady was using it. I was out golfing at the time so have no idea what happened. There was no sound or anything when the switch was flipped. My first step was to make sure the outlet worked.

test-socket

So then I moved everything out from under the sink, got a bucket to catch the water, and removed the unit. I noticed a red button on the bottom.

disposal-button

It responded like the button on a GFI outlet. Then I plugged the disposal back in. There was a humming sound for a few seconds and then it stopped. The red button had popped out. Must be some kind of safety mechanism so the unit doesn’t burn up the motor. While cleaning out the cupboard I had come across an allen wrench.

disposal-allen-wrench

There was also a hole in the bottom of the disposal where this fit. Gave it a bunch of turns and it started to feel pretty smooth. Pushed in the button, started plugging it in, and holy shit! The torque on that thing nearly sent it flying across the room. Glad I had barely touched the plug to power because my hand was able to jerk it away from the outlet.

I put the garbage disposal back in place, reconnected all the pipes, and I was back in business. No leaks either. Something must have been jammed inside.

As a bonus it turned out to be a good reason to clean the cupboards under the sink, which had accumulated a bunch of junk.

Garage Door Opener Light

It’s been flaky for several years. I had tried replacing bulbs and sometimes they would work for a bit or flicker here and there, but eventually stop working. With my new knowledge and confidence with electricity and circuits I figured there had to be something going on with the connection. After unplugging the garage door opener, I took off the face plate and disconnected the wires from the back of the light socket.

garage-door-old-light-socket.jpg

Looking at this socket, 2 things stood out to me: 1) seems like both contact points were corroded and 2) unlike a lot of light bulb sockets where the sides are metal, this only had the contact pad which is at about 1:00 if this were a clock face. I grabbed my favorite tool, the digital multimeter…

I may have been able to clean up the contacts on the socket, but I figured it was better to replace it. The only thing at Home Depot that looked like it would work was this waterproof light socket for $3.47.

waterproof-light-socket.jpg

I carved off some of the rubber with an X-ACTO knife for a better angled fit and applied a bunch of hot glue. Here are views of the front and back…

garage-door-opener-light-socket-frontgarage-door-opener-light-socket-back

It ended up working much better than expected. I reassembled everything, plugged in the garage door opener, and voila!

garage-door-opener-light-on.jpg

I also replaced a 3-way light switch I could hear shorting out, but it was an ordinary replacement job.

5v Relay Module – Part 2

A couple of weeks ago I built a 5v relay module, but realized the relay wasn’t sufficient for my needs. So I had to order a heftier one that could handle more than 0.5 amps of current.

I was under a time crunch and couldn’t wait for a 5 or 10 pack, which had longer shipping times, so I had to go with a set of 2 for $5.99. These are basically the same relays used in all of the manufactured modules you can buy for less than $5, especially if you buy multiple units.

I set up my GoPro overhead and talked through the build process of my new relay module. It was not a smooth process, because I finally messed up my wiring, which I’d been so proud of hitting a 100% success rate on first attempts when putting together circuit boards. I not only messed up, but I realized my mistake, and then fucked it back up after thinking I was right the first time.

I forgot to take any good pictures of the completed relay module this time around, so here is a blurry screenshot I grabbed from the video, showing the original relay module, the non-working version (which I’ll eventually fix up), and my final version. Similar to whenever I screw up and lose a bunch of code, I made it a personal challenge to turn out my best work on the redo. As you can see, my final version saved a lot of space.

relays

Now that I’ve created my own relay modules, I won’t do it again unless I have specific requirements. Buying the same thing already made is a lot more time effective. It was fun and a great learning experience though. Here’s what the wiring diagram looks like spaced out on a breadboard. There isn’t much to it.

fritzing-relay-no-led

You can grab Fritzing files over on GitHub. Two things that helped me out a lot with this build were a video Homemade 5V Single Channel Relay Module Shield For Arduino, PIC, AVR and an article Turn Any Appliance into a Smart Device with an Arduino Controlled Power Outlet. Between finishing my build and writing this post, I also came across Arduino Controlled Power Outlet on Electronics Hub, which is a neat site with a lot of great circuits and tutorials.

Wire Loop Game

Kennedy and I made a wire loop game, using some basic cheap electronics.

  • 9v Battery
  • Buzzer
  • Old light switch
  • LED
  • Various wires
  • Nuts and bolts
  • Electrical tape
  • Wire screw caps
  • Cardboard box

The initial wiring and cutting of the box took more time than I figured and she started to lose interest until we got around to the top. We did this all on-the-fly, but there are plenty of tutorials (like one on Instructables) you can follow.

​​ ​

A Quick Multimeter Fix

The last couple of times I went to use my multimeter, it wouldn’t read voltages or do a continuity test. I didn’t really need it at those times, so I set it aside. Well, I needed it tonight to diagnose something causing problems in a circuit, so it was time to figure out what was wrong.

After unscrewing the back of the multimeter and looking inside, I noticed there were contacts where each of the cables plug in. I got out some alligator clips to use as test leads and the device worked fine. Then I did continuity tests on the cables and the red one failed.

It was time for some surgery so I hacked the ends off. The wire inside was so small and fragile that it had pulled apart from the probe’s end. I cut a new cable using some silicon wire I bought last week since it’s really flexible compared to the wire I use to build circuits. Soldered the ends back on, put some heat shrink tubing over the connections, and I’m back in business!

5V Relay Module – Part 1

You can buy all sorts of 5V relay modules on Amazon for as little as $3-4 (probably even less if you get really cheap). They even sell boards with multiple relays if you need to switch more than one thing. Since I had all of the necessary parts I built my own. Yesterday I finished the board, because I had to do something before National Week of Making ended.

It worked great switching power from a 9V battery, but the real test was hooking it up to mains power. Electricity gets a lot more dangerous at 120V! It was a little scary plugging everything in and flipping the input, especially after reading so many warnings online, but there were no sparks.

Tester shows the wiring is correct.

I need to pick up a plastic outlet box to house everything so it’s safer with the exposed soldered circuit board in there; I don’t know what I was thinking when I bought a metal one. I’ll publish a more detailed post this weekend when it’s complete.

Update: I realized the relay I used in this module can’t handle the amount of current I need, so I ordered a different type of relay and will be making a new module. I’ll take the opportunity to make a more compact design as well. I did shrink this one a bit and cut off some of the board. I’ll save this module in case I ever need it for a project.

Check out Part 2.