I’ll likely turn this into something that interfaces with my Home Assistant server to control different devices around my house.
The PyPortal has been sitting on a shelf ever since. Way back in February, it caught my eye, and I picked it up, not remembering what it’s capabilities were. Then I started upgrading IKEA air quality monitors and even made my own. Since I’m at the desk in my office a large portion of the week I thought I would make that 2019 prediction come true.
I could show a bunch of data on the screen and the PyPortal has a touchscreen, so I could display buttons for triggering things around the house. The device also has connectors for doing GPIO, so I got the idea of adding an LED strip, which I could use for notifications. I even had a meter long strip of Adafruit Mini Skinny NeoPixels I had bought in 2017 and never touched that would be perfect. I needed to buy a 2.0mm JST PH Connector kit in order to make a wire that would connect to the pack of the PyPortal. I ended up using a piece of Cat6 cable, even though I only needed 3 of the 8 wires inside.
All of this was done back in March. I quickly began having issues with the ethernet cable and the small JST connectors, so I put this post on pause. Figured it was time to finally fix this before the end of the year. While testing, I determined the LED strip got fried up at some point. It was probably some kind of short from the janky wire.
Here’s what my display looks like.
My favorite aspect of the project and code is being able to publish MQTT messages from Home Assistant, which the PyPortal listens for and reacts to. I can send various commands, such as fill:blue, which turns all of the LEDs blue, or whatever color I set. I have commands to chase a color from one side to the other, bounce a color from left to right and back to the left, pulse the entire strip, animate a rainbow, or set the brightness. Since I don’t have another strip of Neopixels, in order to create a demo video, I wired up a 24 LED circle. You’ll have to imagine the effects on the back of my desk, lighting up the wall.
I can manually send these MQTT messages as shown in the demo, but the real power comes from automations. For example, the LEDs automatically pulse blue when the washing machine is done and pink when the dryer is done.
With the different effects and color combinations, the possibilities are endless. What kind of automations would you run?
Over the years, I’ve seen many versions of a shop air filter, made from box fans and 20×20 inch furnace filters. A few years ago I picked up some old box fans on Facebook Marketplace and bought a pack of filters from Sam’s Club. They’ve been stacked in the corner.
It was finally time to build my air filter. I removed the back covers, feet, handles, and knobs from the fans. I got my first look at the switches inside, which are nearly identical.
I’d easily be able to wire the fans together, so I removed the switches and power cords.
I put together a frame from OSB, cut slots to feed the wires through, and screwed the box fans in.
Then I grabbed wood that had been salvaged from a pallet to construct a door.
On the back side, I used glue and brad nails to attach plywood rails. I also made tabs to hold the filters secure.
I attached the door with a couple hinges and made some notched tabs to hold the door shut.
A plastic screw container was a good side, so I used hot glue to secure the boards and then wired up all of the fan connections.
I’m not sure if I’ll ever use the button, but it allows me to cycle between the three speeds and turn it off. The three LEDs show which speed is currently running. The only thing I got wrong was reversing the low and high speeds, which was a quick fix in the ESPHome code. Speaking of the code, here’s mine.
I used Google Gemini to help and it had a great suggestion to track the run time and add a maintenance reminder when it was time to replace the filters.
In Home Assistant I created some automations. My dust collector uses a smart plug, so when it draws electricity, the air filter automatically turns on at high speed. When the dust collector turns off, the air filter continues to run for 15 minutes before turning off. If I had to remember to turn on the air filter all the time, it would rarely happen, so this is amazing.
I’m still on lifting restrictions for several weeks so Brandi helped me install the air filter on the ceiling.
IKEA recently discontinued Vindriktning, their older air quality monitor.
Inside the device, they put a cubic PM1006K particle sensor. I bought three for $16.95 each last year, because I’d seen people hack them by adding sensors and a Wi-Fi microcontroller to send all of the data to Home Assistant. For my modding I bought:
The YouTube video linked above is a great guide to follow. I didn’t connect wires to the fan or the light sensor since I had no use for them. I also didn’t stack my sensors because I wanted the BME280 to be outside of the enclosure, where it would be less affected by the heat produced by the ENS160 and D1.
Even with the sensor outside of the case, the BME280 still reads high, because it heats itself up. I actually tested different lengths of wires and placements of the sensor before realizing I was still going to have to adjust the data. An ESPHome filter made the adjustment easy, which I did individually for each unit after comparing to a mobile Ecobee thermostat sensor. This is the code from the unit for my shop.
Here is how I’m displaying the data on one of my Home Assistant dashboards.
As I was working on this project I knew I wanted a couple more air quality monitors around the house, which will be finished soon.
Update: I’ve had to make a small update by adding a 47uF capacitor to each ENS160 board, because they have power issues, causing the reading to stop for periods of time. My boards matched up with the right ones in the picture at that link. Here’s a picture of another ENS160 I modified, since it was a tight squeeze to made the modification on the devices I posted about here with everything already wired up. I also realized I was powering these through the 3V3 pin instead of VIN, so I fixed that.
I’ve also improved the display of the data on my dashboard by using mini-graph-card.
I finally bought a doorbell camera when I saw some specials last week. I went with the combination Ring Video Doorbell Pro and Ring Chime Pro, which came with a free 3rd generation Alexa Echo Dot. The Chime is great for the basement, where I can’t always hear the doorbell, especially if I’m using a loud tool. My 2nd generation Alexa Echo Dot moved to the basement as well since I spend so much time in the workshop.
Part 1 covered the devices I’m using for home automation. It’s been over a year and there have been some changes. I added a Leviton switch and got rid of the Wink hub.
This post will be about the software that brings things together, making it easy for me to manage and allows the devices to “talk” to each other. Maybe it’s a good thing it’s taken me almost a year to write this part 2 because there have been some dramatic improvements to how everything runs. I was using homebridge for a period of time, but found I never really used HomeKit/Siri. Home Assistant has been updating a new HomeKit component, so I’ll have to give it a try.
I’ve talked about Home Assistant in a lot of posts; it’s the software running on the Raspberry Pi 3 Model B to handle everything. It’s very powerful software and has been a lot of fun for me to configure everything. Being on a Linux box and having to configure everything through YAML files makes it a tough entry for the average homeowner though. It’s improved a lot in the year I’ve been using it with better documentation and some UI configuration tools, so it’ll be interesting to watch for the next 12 months.
Being Open Source was a big draw of HA for me. Open Sourcecraft has a good article about the creator. The project operates on an aggressive schedule you don’t see much; every 2 weeks a new version oh Home Assistant is released. These aren’t small updates either. Each update fixes a ton of bugs and adds support for new devices.
I did install HA using Hass.io, which simplifies the process and makes it easy to do upgrades and install add-ons. Here are the add-ons I’m using.
In addition to running Home Assistant, I wrote a couple of small services I run on Pis. The first is the temperature sensor/monitor I use in my garage. I’ve improved it a lot in the last year. The second service is home-assistant-pi, which reports a bunch of data about each Raspberry Pi on my network back to Home Assistant, which you’ll see in the screenshot below.
The beauty of Home Assistant is you can set everything up the way you want. Your limitation is your imagination and your comfort level with configuration files and code. I took a bunch of screenshots of my setup.
The main screen, with a daytime theme active.
The same screen, but at night.
All of the weather and indoor climate data.
Status of my Raspberry Pis.
Groupings by room.
Sort of a multimedia group, showing my TVs and cameras.
A catchall sensor screen with less frequently used info.
The iOS app gives access to everything and works the same way.
I keep all of my configuration (except the secrets file) in a GitHub repo in case I mess something up. I’ve learned a lot by looking at other examples, so my repo is public as well. Maybe my config will help out someone else. The repo is home-assistant-config. If you have any questions about anything you see in this post or in my configuration, let me know.
In the final post of this series, I’ll explain the cool part of this whole thing, the actual automations. I need to go through my ideas list and implement all of them though.
After the recent changes to my home network and Home Assistant server, I noticed the logs in Pi-Hole were being dominated by the domain I use for dynamic DNS on the box. Roughly 15,000 DNS requests a day out of 30,000 on my entire network. Really skews the ad blocking stats.
Why so many DNS requests? Because home-assistant-pi and home-assistant-temperature-monitor were both using the Home Assistant REST API to fetch data. That’s 15k requests/day with only two of my seven other Raspberry Pis turned on, so it would get worse when I put some of the other Pis into “production” around the house. The temperature project only runs on one box, but the first project in installed on every Pi.
I briefly tried to switch those two projects over to using the local IP address of the server and continue to use the REST API, but with SSL enabled it was complicated. MQTT was already running on the server and those projects publish updates to Home Assistant over MQTT, so it was an easy decision to use it for subscribing as well.
While I was at it, I took the opportunity to simplify a lot of the code and have the devices update more frequently. So far it seems to have solved a couple of lingering stability or connection issues I was having with home-assistant-pi. All of the code changes are available in the respective GitHub repos linked earlier.
Update: I forgot I had home-assistant-pi connecting to google.com in to help with determining the local IP address in Python. Another update to clear that up will eliminate over five thousand DNS requests per day.
Last year I installed a bunch of Lutron Caséta switches and remotes with dimming functionality. At the time I forgot to test the ceiling fan in my bedroom. So when I went to use it this summer, I got this nice surprise (turn up the sound)…
Ceiling fans don’t like dimmer switches. I’d done a little searching here and there for a smart 3-way switch alternative, but hadn’t been able to find anything. Then one day while walking through Home Depot I noticed some Leviton Decora Smart switches. I did some research when I got home and ordered a DW15S-1BZ and a DD0SR-DLZ. No dimmers on these. Installation was easy and I can use the ceiling fan again. Check out the difference.
I will mention a few negatives with this Leviton switches. The “remote” is wired in, unlike the Caséta remote which can be placed anywhere. It costs a bit more as well. The last thing probably won’t be a big deal for anyone, but it seems like the system is using a relay because I can hear it click back and forth from across the room when I trigger the switch. The clicking may not be the best for a baby’s room.
Other than those things, the Leviton switches work well so far. Check them out if you’re looking for a 3-way switch.
My router had been flaking out, so I picked up a Eero with 1 beacon. Setup was smooth and painless. I decided to use a new Wi-Fi network name, which was not one of my best ideas; reconfiguring about 30 devices was a pain in the ass!
While I was working on my network I took the opportunity to do a fresh install of everything on the Raspberry Pi server running Home Assistant and Pi-Hole. Instead of installing Raspbian and all of the software myself, I took advantage of Hass.io, which is a preconfigured image and works well. When I first started using Home Assistant, the project was pretty immature so I didn’t use it.
Installing Pi-Hole as a Hass.io add-on is slick. Due to issues with my old router I’d been living without ad blocking for a few weeks and it was horrible. It’s hard going back to a web littered with ads when you’ve been living without them.
Figured I might as well keep going, so I also made a bunch of improvements to the Raspberry Pi Temperature Monitor I use in my garage. Seems to run much more stable, which may also have something to do with the fresh Home Assistant install. Changed a few things with home-assistant-pi as well.
Another big change I made to the server is connecting it to my network via ethernet instead of WiFi. It’s wired in through an AirPort Time Capsule, which is connected to the Eero via a really long cable running through the basement. I bet this has done more than anything to improve the stability and consistency of my system. A bonus of this connection change is the Speedtest reporting inside HA is much more accurate.
Now I need to make time to get more automating done in Home Assistant and publish part 2 and 3 of my home automation series. It’s coming up on a year since part 1, so long overdue.
Since I keep putting off a big home automation post due to not having much actual automation done, I’m going to split things up into a series of 3 posts. It’ll make for shorter posts and hopefully motivate me to get my automations done. This first post will share all of the equipment I have around my house, part 2 will be about the software, and part 3 will be about the actual automating.
Don’t buy one of these. The online service the device communicates with is always having problems. I have mine configured to send me an alert whenever the door is open for at least 30 minutes. Over a 2 day period, all 4 of these notifications shown in the screenshot were incorrect! Happens at least once a month.
I want to see if I can reverse engineer the sensor attached to the door and make my own opener using a microcontroller and a spare remote I have.
Alarms for detecting smoke and carbon monoxide. They “talk” to the thermostats as well. I have 3, but hope I never need to find out how well they work.
I have 8 switches and 5 remotes (there are a lot of 3-way switches in my house). These were simple to install. Having dimming capabilities is a nice feature.
I have 2 Insight Smart Plugs, 2 Light Switches, and 1 Switch. The thing I like most about the Belkin devices is you don’t need a hub or anything else to control them. Very plug-n-play. I’m not sold on having plugs though. I’m using them for some lamps, but you have to remember not to turn the lamp off with the actual lamp switch otherwise your smart plug is useless.
I don’t use this much anymore with the Echo. Still comes in handy for quickly controlling something though. Will also use the iPhone location for automations of home/away status.
None of the stuff is cheap. We’re still in the early stages of home automation. Watch out in the next couple of years.
Some things I plan to add are:
A moisture sensor near my sump pump so I can be alerted right away if something goes wrong. Maybe some sensors in bathrooms as well.
This summer I plan to replace a couple of old in-wall AC units. One no longer works and the other is mostly broken. I’ll be buying units I can automate and control.
If you have questions about anything here, let me know.
I made some updates to the Garage Temperature Sensor & Monitor. I didn’t like how the desired temperature was set via the app’s configuration file, so I moved it to a slider control in Home Assistant and updated the LCD to always show the value. Only being able to enable/disable monitoring via the device’s button also wasn’t great. I converted the binary sensor I was using to flag monitor mode in HA to a switch control and moved the actual monitoring logic from the Python app to HA automation. Everyhing is updated on GitHub.