coding

Updating Kodi Repository with Ansible

I’m not an Ansible guru but I do use it to automate some tasks in my home lab. It is a real time saver to issue commands from a single interface and not rely on a bunch of hacked together Bash scripts all over the place. Recently I was doing some updates to a custom Kodi repository that I use for testing addons in development. The process was pretty cumbersome and after a while I decided it was time to convert the whole process to an Ansible Playbook.

Below I’ll go through the process of modifying a few scripts and setting up the Ansible playbook. This process can be used as a template for other system automations where a legacy script is being adapted for Ansible.

5 min read

Parsing Nagios Performance Data

Recently I was adding features to Trash Panda, a local monitoring system project I probably never should have started. I thought it might be interesting to do something with the performance data many Nagios plugins send back as part of service check results. Performance data is additional data about the service that can be useful as history for how the service is performing. Stuff like disk space metrics, TCP return times, and other types of numeric values. The format is standardized and could then be easily piped into a database or other storage area for later use. This post documents my efforts from loops within loops to something bordering on efficient.

I do want to note I did try and find a tool for this before building something from scratch. There are some command line tools but nothing in a library format. Since the Trash Panda project is written in Python that’s really what I needed.

7 min read

Dynamic Pandas Data Slicing

Recently I wanted to modify a Python data analysis script I use regularly at work into more of a general purpose tool. The script uses the Pandas Python library to slice up data in CSV files based on some specific time periods. The issue I had is that these time periods changed often, and I was sick of mucking about in the script to constantly tweak them. I needed a way to specify the time periods at runtime instead of hard coding them.

This turned out to be more complicated than I envisioned so I figured I’d document it all for anyone interested (most likely myself in a year when I forget). Note: this post is not a primer on Pandas, or data slicing, if you want more info on that check the Pandas documentation.

8 min read

QR Code Media Player

We were recently trying to organize some of the clutter in our home and I started in on the video game and Blue Ray/DVD collection. For Blue Ray/DVDs (henceforth referred to as just DVDs) we’re in the same boat as a lot of households, we just don’t use them. Streaming is a good amount of our media consumption but I take movies we’ve purchased and rip them to our NAS so we can play them back via Kodi. Since the entire collection is digitized what often happens is we look at the DVD rack, select a movie we want, and then find it via Kodi and play it there.

Inspired by many Home Assistant related NFC “jukebox” type projects I thought it would be fun to combine the physical with the digital. I wanted to use the physical disc to trigger the playback of the digital file. Since Kodi has a JSON-RPC API being able to trigger playback based on a tag or code seemed doable.

QR Code

9 min read

Monitoring SNMP Traps

In my profession life I recently purchased an Infrasensing Base Unit along with a door contact sensor. These are pretty interesting IoT devices that accept a wide variety of sensors. My intention was to connect this to our network monitoring system, Icinga, to monitor the status of a network cabinet door.

Upon playing around with the device I decided the best way to get timely alerts from the sensor was to utilize SNMP traps instead of polling for the status. While I have a lot of experience polling SNMP systems I’d never dug into traps before. Going down the rabbit hole of getting this going turned in to a pretty neat little project that can be utilized to translate SNMP trap payloads into something Icinga can accept for service checks.

sensor page

8 min read

Portable Face Finder

As a side project I’ve been working on a portable Python program to find if specific people, using facial recognition, are in a collection of images. The idea for this grew out of a joke but the more I thought about it I realized it had some real applications.

A co-worker of mine was having trouble finding images of specific individuals within a large folder of images. Over the years this folder had gotten overgrown and photos were in random sub-folders sorted by date, location, or event. It was hard to find photos of specific people without digging through a lot of images to see if they were in them. I jokingly suggested we use some facial recognition software to comb through the folder and just flag all instances of the person they were looking for. I held on to the idea over the next few days thinking about how something like this would function.

The idea itself is pretty boilerplate stuff for any image tool, like Google Photos or on Facebook. These will recognize the faces and do all the heavy lifting for you. My real interest lay in situations where having an offline solution to this problem would be useful. Family pictures on a parent’s computer or in this case employee photos not part of a unified imaging solution. I imagined there was some utility being able to throw in a USB drive, launch a script, and identify photos of interest based on looking for specific faces.

deepface image detector example

8 min read

Crowd Sourced Quote Generator

I have an LED Sign in my office that displays information like the weather, currently playing music, and other stuff. One day I added a random movie quote to the rotating text just for fun. A few days later I swapped it out for another one. As you can imagine, an idea hit. What if I could randomly add a new quote every few days? There must be a web service to pull quotes from, right?

Hence began my search for an existing service to pull movie and TV show quotes from. I found a few options, but I came up short of what I wanted. Many sites cataloged movies, but not quotes. Others had quotes but no method to pull them programmatically. The IMDB in particular looked the best but their “quotes” were often several lines of dialog from the film. Plus I just didn’t want to mess around with integrating with them since it’s a proprietary site.

At this point I figured I could either a) drop this idea or b) try and build something. Something as simple as text file with a bunch of favorite quotes in it would have worked but I didn’t want to have to generate all the content myself. I thought it might be fun to build something my friends and family could add quotes to as well. It would have the added bonus of making the quotes more diverse than just things I thought up.

Landing Page

10 min read

EPD Slideshow Bash Script

Like a lot of people lately, I wanted to display some of the new images from the James Webb Telescope. I have an electronic paper display (EPD) connected to a Raspberry Pi on my desk and figured that would be a cool way to see them as a rotating slideshow. Not wanting to spend a lot of time configuring a special image viewer I hacked together a 26 line Bash script to rotate through the images. You can easily get this done in a variety of ways but this serves as a good example of using Open Source libraries to do some heavy lifting and making quick work of a simple idea.

James Webb - Southern Ring Nebula

3 min read

Trash Panda - A Simple Monitoring Project

In my home lab we’ve come to rely on a number of services such that downtime on any one of them could cause a brief panic. Things like our MythTV server for watching over-the-air TV, PiHole server for DNS, or our Home Assistant automation system. Just like in a business production system there are a myriad of things that could go wrong with even simple home VMs. Stuff like filling up HD space, services not running that should be, or maybe an OS update hosed something. I’ve lost count of the number of times I decided to “apply patches quick” only to find out some library was now missing that used to be there and now service XYZ just won’t start anymore. This is annoying for me but basically kills any good will I have with my family just trying to just browse the internet on their tablets.

Suffice it to say I wanted a dashboard and notification system to give me some assurance things are working properly. In my professional life I’ve used a number of monitoring systems over the years. There are great open source and commercial products available that will monitor services and alert you when things are going wrong. Because I apparently do everything the hard way I decided to build one instead. In my defense my initial thoughts were that I didn’t need all the overhead of a true monitoring solution. All I really wanted was some up/down status information. I should be able to Python my way there pretty quickly and just be done with it right? Behold, the Trash Panda monitoring system.

Dashboard

Dislaimer - at the outset I’m going to say I don’t think anything in this project is groundbreaking or couldn’t be done with existing software. It was more of a “can I do it” kind of project. In this write-up it’s more about trying to document the process than the actual result. This is basically the workflow I use for any new project.

12 min read

Command Line Backups

In most cases there is no reason to re-invent the wheel, and there are already tons of great backup solutions. Just Google it.. These run from full bare metal backups to file based backups that include rotating incrementals. Most include awesome client/server architecture or some type of web based GUI.

As seems to often be the case with my projects, I didn’t need any of this. I wanted a solution that on the surface was so simple it was the kind of thing others flew past on their way to a real solution. Something simple enough it wasn’t worth maintaining a project for it but yet complex enough that it wasn’t just boilerplate code.

7 min read

Building Custom LibreELEC Images

We use Kodi for a lot of our media center needs in our house. We have several TVs, each with their own Kodi box, configured to pull information from a centralized database and shared network storage. To run Kodi I’ve used pre-made LibreELEC images. LibreELEC is “just enough OS” system that is designed to run Kodi within a stripped down Linux OS designed just for that purpose. It also layers in some additional patches and features that make the whole experience easy to work with.

I’ve also been following work on Kodi’s RetroPlayer project. This is an integration with Kodi and the excellent RetroArch system for game system emulation. Out of the box Kodi has many RetroPlayer features built in; but the RetroPlayer project is often well ahead of what Kodi has merged into it natively. For a long time I was able to hunt down LibreELEC builds that included these enhancements but I’ve been having a hard time with that lately. I’ve decided to tackle building my own custom LibreELEC builds that incorporate the latest RetroPlayer releases.

7 min read

EPD Image Processing

This is mostly a reminder for myself but perhaps could be useful for others in the same boat. In short, image processing is a pain. This is especially true when dealing with devices, like e-ink displays, that use limited color sets. Black and white conversions are fairly easy to deal with but as soon as you start adding multiple colors things can get tricky.

Below are some of my notes on dealing with Tri-color Waveshare devices and how to process the images. For reference I’ll be using code from my omni-epd project, which implements these image processing methods. The library used throughout is the excellent Pillow image processing library. If you want to play with any of these methods I’ve written a filter script that can both filter an image based on a given palette, or save the colors separate as shown below.

4 min read
Back to Top ↑

automation

Updating Kodi Repository with Ansible

I’m not an Ansible guru but I do use it to automate some tasks in my home lab. It is a real time saver to issue commands from a single interface and not rely on a bunch of hacked together Bash scripts all over the place. Recently I was doing some updates to a custom Kodi repository that I use for testing addons in development. The process was pretty cumbersome and after a while I decided it was time to convert the whole process to an Ansible Playbook.

Below I’ll go through the process of modifying a few scripts and setting up the Ansible playbook. This process can be used as a template for other system automations where a legacy script is being adapted for Ansible.

5 min read

Automate Brewing With Tilt

As I hobby I like to homebrew beer. Nothing too crazy but just a few cases a couple of times a year. It’s fun to do and makes for a nice gift option for friends and family as well. Recently I starting thinking more about gathering data during the brewing process. Mostly I was interested in temperature as different stages of the brew process require specific temperature ranges. These vary depending on the type of beer but it’s important so you don’t kill the yeast during fermentation. In the past I’ve used a manual thermometer but wanted something more hands off.

I didn’t want to build something myself as there is a great consumer market and DIY space for this type of stuff already. My only real requirement was that I get the information into Home Assistant since that is where I try and keep all my dashboards and data for ease of use. As I spiraled down the rabbit hole of possible options I ended up having to do some on-the-fly thinking to get it all working.

9 min read

Automatic Cat Feeder

We recently got a second cat. It’s been a lot of fun but one thing I didn’t realize is how much more two cats were going to eat. With one cat a bowl of food lasted 2-3 days before needing refilling, with two it seems to be running low every day. To make matters worse we keep our cat food bowl in the laundry room so the food doesn’t get stolen by the dog. The phrase “out of sight, out of mind” definitely applies here and I’ll be honest they’ve run out of food enough times that something had to change.

I had two options. The first was the easy option - just get a bigger bowl. The second was the fun option - buy or build an automatic cat feeder. Obviously I went with the fun option.

13 min read

Monitoring SNMP Traps

In my profession life I recently purchased an Infrasensing Base Unit along with a door contact sensor. These are pretty interesting IoT devices that accept a wide variety of sensors. My intention was to connect this to our network monitoring system, Icinga, to monitor the status of a network cabinet door.

Upon playing around with the device I decided the best way to get timely alerts from the sensor was to utilize SNMP traps instead of polling for the status. While I have a lot of experience polling SNMP systems I’d never dug into traps before. Going down the rabbit hole of getting this going turned in to a pretty neat little project that can be utilized to translate SNMP trap payloads into something Icinga can accept for service checks.

sensor page

8 min read

Automate Doorbell with ESPHome

Disclaimer: This is not about replacing your doorbell with a video camera doorbell using an ESP32. There are lots of tutorials about doing that if that’s what you’re after.

For a long time I’ve hated my doorbell chime. It doesn’t get used much, but when it does I hate it. The noise is annoying and over the years our dogs have picked up on it and it triggers them to rush to the door when they hear it. I’ve always wanted to make the chime sound different or try and automate it in some way but it was a back-burner project. Recently though my wife starting working from home and the chime is disrupting online meetings. It’s loud and then the dogs bark and scramble for the door, not the most professional.

I decided to finally tackle it and see if I could replace the chime with an ESP32 to provide more flexibility and automation behind the simple push button.

7 min read

Home Assistant Update Notifications

Starting with version 2022.4, Home Assistant has support for Update entity types. Using this entity type, devices (or Home Assistant itself) can let the user know of updates to software and firmware. At it’s most basic level this acts as a binary sensor to tell you if an update is available (when on). The update entity also has lots of information such as the currently installed version, the new version available, release notes URL, additional service calls and much more.

The documentation for the Update entity includes a basic automation for how to receive notifications for when an update is available. The problem with this example is it only works for a specific Update entity (like Home Assistant Core updates). I wanted a solution to let me know when an update to any update entity was available. I found this can be done with a bit of thought and a Template sensor.

4 min read

Homemade Dynamic DNS

In my home lab I have a handful of services that need to be accessed from outside the house via the internet. For me Home Assistant is my number one need but there are others. Of course the problem with this is that a residential ISP doesn’t give you a static IP so your outside address changes every so often. What usually ends up happening in these situations is that to get a static IP you need to upgrade your internet plan or pay some additional monthly fee - which I of course don’t want to do. Dynamic DNS is supposed to solve this problem. The idea is you setup a static host record and then update the IP it points to when your DHCP address with your ISP changes.

Dynamic DNS is pretty easy to nail down and there are probably hundreds of services that do it. You can even get routers with the ability to do it built in. My specific problem with these services is that you often get a really weird URL like hostname.dynamicservice.com. Nothing wrong with that if you’re getting this service for free but the second you want to add something additional, like a custom domain or SSL cert, you have to start paying the dynamic DNS service. I don’t want to pay them either! I want my cake and I want it for free.

6 min read

Command Line Backups

In most cases there is no reason to re-invent the wheel, and there are already tons of great backup solutions. Just Google it.. These run from full bare metal backups to file based backups that include rotating incrementals. Most include awesome client/server architecture or some type of web based GUI.

As seems to often be the case with my projects, I didn’t need any of this. I wanted a solution that on the surface was so simple it was the kind of thing others flew past on their way to a real solution. Something simple enough it wasn’t worth maintaining a project for it but yet complex enough that it wasn’t just boilerplate code.

7 min read

Fun With Light Sensors

In our living room we have several very large windows that can let in a lot of light. We also have some lights with either LIFX bulbs or Z-Wave switches that we can control via Home Assistant. It seemed like a no-brainer to try and make a system to auto turn the lights on or off depending on the amount of light in the room. On overcast days, or during the winter when it isn’t light until 7:30am, we could have the lights turn on when we wanted them to and off again when the sun provided enough light in the room. With this very simple idea in mind I jumped down the rabbit hole of complications as our family started to run in to all the edge cases.

For reference, here is a basic diagram of our living room. There are 5 windows around the edge and 3 lights which labeled Couch Lights, Reading Light and Bookshelf Lights. In this project I’ll be controlling all of them, but under different circumstances and at different times.

The heavy lifting on the automation side is being done with ESPHome, light sensor compatible with ESPHome, and Home Assistant.

Living Room

12 min read

Building Custom LibreELEC Images

We use Kodi for a lot of our media center needs in our house. We have several TVs, each with their own Kodi box, configured to pull information from a centralized database and shared network storage. To run Kodi I’ve used pre-made LibreELEC images. LibreELEC is “just enough OS” system that is designed to run Kodi within a stripped down Linux OS designed just for that purpose. It also layers in some additional patches and features that make the whole experience easy to work with.

I’ve also been following work on Kodi’s RetroPlayer project. This is an integration with Kodi and the excellent RetroArch system for game system emulation. Out of the box Kodi has many RetroPlayer features built in; but the RetroPlayer project is often well ahead of what Kodi has merged into it natively. For a long time I was able to hunt down LibreELEC builds that included these enhancements but I’ve been having a hard time with that lately. I’ve decided to tackle building my own custom LibreELEC builds that incorporate the latest RetroPlayer releases.

7 min read

Home Lab Backups

For as long as I can remember I’ve always been really paranoid about losing data. When Windows XP was brand-spanking new it was having two hard drives in my PC; in college I cobbled together a RAID system from an old Intel 3 tower and now it’s pushing files to dedicated NAS hardware or in the cloud. I’m also sort of lazy; at least about re-doing work I’ve already done before. While Git repositories work great for my coding projects there are a lot of other things that need redundancy as well. With that in mind I’ll highlight a few things I do to try make sure I can recover systems when I need to.

There are hundreds of different ways you could set this kind of thing up but this is what works for me. If you just want the list of software jump right to the links.

7 min read
Back to Top ↑

smarthome

Automate Brewing With Tilt

As I hobby I like to homebrew beer. Nothing too crazy but just a few cases a couple of times a year. It’s fun to do and makes for a nice gift option for friends and family as well. Recently I starting thinking more about gathering data during the brewing process. Mostly I was interested in temperature as different stages of the brew process require specific temperature ranges. These vary depending on the type of beer but it’s important so you don’t kill the yeast during fermentation. In the past I’ve used a manual thermometer but wanted something more hands off.

I didn’t want to build something myself as there is a great consumer market and DIY space for this type of stuff already. My only real requirement was that I get the information into Home Assistant since that is where I try and keep all my dashboards and data for ease of use. As I spiraled down the rabbit hole of possible options I ended up having to do some on-the-fly thinking to get it all working.

9 min read

Automatic Cat Feeder

We recently got a second cat. It’s been a lot of fun but one thing I didn’t realize is how much more two cats were going to eat. With one cat a bowl of food lasted 2-3 days before needing refilling, with two it seems to be running low every day. To make matters worse we keep our cat food bowl in the laundry room so the food doesn’t get stolen by the dog. The phrase “out of sight, out of mind” definitely applies here and I’ll be honest they’ve run out of food enough times that something had to change.

I had two options. The first was the easy option - just get a bigger bowl. The second was the fun option - buy or build an automatic cat feeder. Obviously I went with the fun option.

13 min read

QR Code Media Player

We were recently trying to organize some of the clutter in our home and I started in on the video game and Blue Ray/DVD collection. For Blue Ray/DVDs (henceforth referred to as just DVDs) we’re in the same boat as a lot of households, we just don’t use them. Streaming is a good amount of our media consumption but I take movies we’ve purchased and rip them to our NAS so we can play them back via Kodi. Since the entire collection is digitized what often happens is we look at the DVD rack, select a movie we want, and then find it via Kodi and play it there.

Inspired by many Home Assistant related NFC “jukebox” type projects I thought it would be fun to combine the physical with the digital. I wanted to use the physical disc to trigger the playback of the digital file. Since Kodi has a JSON-RPC API being able to trigger playback based on a tag or code seemed doable.

QR Code

9 min read

Home Assistant Voice Custom Intents

In 2023 Home Assistant is dedicated to making their smart home platform more capable of text and voice interaction through the Year of the Voice. Essentially this is expanding on the capabilities of Home Assistant to interpret human text and speech into smart home actions. This provides more possibilities for existing voice assistants like Alexa and Google Home; while also providing an alternative through Home Assistant’s own Assist platform.

While a number of built-in intent phrases have been added, I’ve been experimenting with adding my own trigger phrases and intents. For the most part this was just following the documentation however there were a few things that weren’t clear, or just didn’t work as expected. I’m documenting these here for future reference, and for anyone else struggling through the same thing. Hopefully as this part of Home Assistant matures adding these custom actions will become more clear.

Assist Chat

9 min read

Automate Doorbell with ESPHome

Disclaimer: This is not about replacing your doorbell with a video camera doorbell using an ESP32. There are lots of tutorials about doing that if that’s what you’re after.

For a long time I’ve hated my doorbell chime. It doesn’t get used much, but when it does I hate it. The noise is annoying and over the years our dogs have picked up on it and it triggers them to rush to the door when they hear it. I’ve always wanted to make the chime sound different or try and automate it in some way but it was a back-burner project. Recently though my wife starting working from home and the chime is disrupting online meetings. It’s loud and then the dogs bark and scramble for the door, not the most professional.

I decided to finally tackle it and see if I could replace the chime with an ESP32 to provide more flexibility and automation behind the simple push button.

7 min read

Home Assistant Update Notifications

Starting with version 2022.4, Home Assistant has support for Update entity types. Using this entity type, devices (or Home Assistant itself) can let the user know of updates to software and firmware. At it’s most basic level this acts as a binary sensor to tell you if an update is available (when on). The update entity also has lots of information such as the currently installed version, the new version available, release notes URL, additional service calls and much more.

The documentation for the Update entity includes a basic automation for how to receive notifications for when an update is available. The problem with this example is it only works for a specific Update entity (like Home Assistant Core updates). I wanted a solution to let me know when an update to any update entity was available. I found this can be done with a bit of thought and a Template sensor.

4 min read

Fun With Light Sensors

In our living room we have several very large windows that can let in a lot of light. We also have some lights with either LIFX bulbs or Z-Wave switches that we can control via Home Assistant. It seemed like a no-brainer to try and make a system to auto turn the lights on or off depending on the amount of light in the room. On overcast days, or during the winter when it isn’t light until 7:30am, we could have the lights turn on when we wanted them to and off again when the sun provided enough light in the room. With this very simple idea in mind I jumped down the rabbit hole of complications as our family started to run in to all the edge cases.

For reference, here is a basic diagram of our living room. There are 5 windows around the edge and 3 lights which labeled Couch Lights, Reading Light and Bookshelf Lights. In this project I’ll be controlling all of them, but under different circumstances and at different times.

The heavy lifting on the automation side is being done with ESPHome, light sensor compatible with ESPHome, and Home Assistant.

Living Room

12 min read

Custom Home Assistant Energy Sensor

The Energy Management section of Home Assistant is very powerful. It allows you to visualize both consumption and generation (if available) of electricity in your home. In addition to whole home energy monitoring you can also setup individual devices within the system that are capable of capturing usage information. In my home I have a small UPS that provides backup power for all my home lab equipment. This includes my home camera system, NAS, wifi access points; basically all the main network components of my home. I wanted to see if it was possible to get usage information from this device into Home Assistant and see how much electricity it’s using compared to the rest of my home.

Energy Dashboard

8 min read

Home Lab Backups

For as long as I can remember I’ve always been really paranoid about losing data. When Windows XP was brand-spanking new it was having two hard drives in my PC; in college I cobbled together a RAID system from an old Intel 3 tower and now it’s pushing files to dedicated NAS hardware or in the cloud. I’m also sort of lazy; at least about re-doing work I’ve already done before. While Git repositories work great for my coding projects there are a lot of other things that need redundancy as well. With that in mind I’ll highlight a few things I do to try make sure I can recover systems when I need to.

There are hundreds of different ways you could set this kind of thing up but this is what works for me. If you just want the list of software jump right to the links.

7 min read
Back to Top ↑

hardware

Automate Brewing With Tilt

As I hobby I like to homebrew beer. Nothing too crazy but just a few cases a couple of times a year. It’s fun to do and makes for a nice gift option for friends and family as well. Recently I starting thinking more about gathering data during the brewing process. Mostly I was interested in temperature as different stages of the brew process require specific temperature ranges. These vary depending on the type of beer but it’s important so you don’t kill the yeast during fermentation. In the past I’ve used a manual thermometer but wanted something more hands off.

I didn’t want to build something myself as there is a great consumer market and DIY space for this type of stuff already. My only real requirement was that I get the information into Home Assistant since that is where I try and keep all my dashboards and data for ease of use. As I spiraled down the rabbit hole of possible options I ended up having to do some on-the-fly thinking to get it all working.

9 min read

Automatic Cat Feeder

We recently got a second cat. It’s been a lot of fun but one thing I didn’t realize is how much more two cats were going to eat. With one cat a bowl of food lasted 2-3 days before needing refilling, with two it seems to be running low every day. To make matters worse we keep our cat food bowl in the laundry room so the food doesn’t get stolen by the dog. The phrase “out of sight, out of mind” definitely applies here and I’ll be honest they’ve run out of food enough times that something had to change.

I had two options. The first was the easy option - just get a bigger bowl. The second was the fun option - buy or build an automatic cat feeder. Obviously I went with the fun option.

13 min read

Monitoring SNMP Traps

In my profession life I recently purchased an Infrasensing Base Unit along with a door contact sensor. These are pretty interesting IoT devices that accept a wide variety of sensors. My intention was to connect this to our network monitoring system, Icinga, to monitor the status of a network cabinet door.

Upon playing around with the device I decided the best way to get timely alerts from the sensor was to utilize SNMP traps instead of polling for the status. While I have a lot of experience polling SNMP systems I’d never dug into traps before. Going down the rabbit hole of getting this going turned in to a pretty neat little project that can be utilized to translate SNMP trap payloads into something Icinga can accept for service checks.

sensor page

8 min read

Automate Doorbell with ESPHome

Disclaimer: This is not about replacing your doorbell with a video camera doorbell using an ESP32. There are lots of tutorials about doing that if that’s what you’re after.

For a long time I’ve hated my doorbell chime. It doesn’t get used much, but when it does I hate it. The noise is annoying and over the years our dogs have picked up on it and it triggers them to rush to the door when they hear it. I’ve always wanted to make the chime sound different or try and automate it in some way but it was a back-burner project. Recently though my wife starting working from home and the chime is disrupting online meetings. It’s loud and then the dogs bark and scramble for the door, not the most professional.

I decided to finally tackle it and see if I could replace the chime with an ESP32 to provide more flexibility and automation behind the simple push button.

7 min read

Fun With Light Sensors

In our living room we have several very large windows that can let in a lot of light. We also have some lights with either LIFX bulbs or Z-Wave switches that we can control via Home Assistant. It seemed like a no-brainer to try and make a system to auto turn the lights on or off depending on the amount of light in the room. On overcast days, or during the winter when it isn’t light until 7:30am, we could have the lights turn on when we wanted them to and off again when the sun provided enough light in the room. With this very simple idea in mind I jumped down the rabbit hole of complications as our family started to run in to all the edge cases.

For reference, here is a basic diagram of our living room. There are 5 windows around the edge and 3 lights which labeled Couch Lights, Reading Light and Bookshelf Lights. In this project I’ll be controlling all of them, but under different circumstances and at different times.

The heavy lifting on the automation side is being done with ESPHome, light sensor compatible with ESPHome, and Home Assistant.

Living Room

12 min read
Back to Top ↑

random

Crowd Sourced Quote Generator

I have an LED Sign in my office that displays information like the weather, currently playing music, and other stuff. One day I added a random movie quote to the rotating text just for fun. A few days later I swapped it out for another one. As you can imagine, an idea hit. What if I could randomly add a new quote every few days? There must be a web service to pull quotes from, right?

Hence began my search for an existing service to pull movie and TV show quotes from. I found a few options, but I came up short of what I wanted. Many sites cataloged movies, but not quotes. Others had quotes but no method to pull them programmatically. The IMDB in particular looked the best but their “quotes” were often several lines of dialog from the film. Plus I just didn’t want to mess around with integrating with them since it’s a proprietary site.

At this point I figured I could either a) drop this idea or b) try and build something. Something as simple as text file with a bunch of favorite quotes in it would have worked but I didn’t want to have to generate all the content myself. I thought it might be fun to build something my friends and family could add quotes to as well. It would have the added bonus of making the quotes more diverse than just things I thought up.

Landing Page

10 min read

Homemade Dynamic DNS

In my home lab I have a handful of services that need to be accessed from outside the house via the internet. For me Home Assistant is my number one need but there are others. Of course the problem with this is that a residential ISP doesn’t give you a static IP so your outside address changes every so often. What usually ends up happening in these situations is that to get a static IP you need to upgrade your internet plan or pay some additional monthly fee - which I of course don’t want to do. Dynamic DNS is supposed to solve this problem. The idea is you setup a static host record and then update the IP it points to when your DHCP address with your ISP changes.

Dynamic DNS is pretty easy to nail down and there are probably hundreds of services that do it. You can even get routers with the ability to do it built in. My specific problem with these services is that you often get a really weird URL like hostname.dynamicservice.com. Nothing wrong with that if you’re getting this service for free but the second you want to add something additional, like a custom domain or SSL cert, you have to start paying the dynamic DNS service. I don’t want to pay them either! I want my cake and I want it for free.

6 min read

Home Lab Backups

For as long as I can remember I’ve always been really paranoid about losing data. When Windows XP was brand-spanking new it was having two hard drives in my PC; in college I cobbled together a RAID system from an old Intel 3 tower and now it’s pushing files to dedicated NAS hardware or in the cloud. I’m also sort of lazy; at least about re-doing work I’ve already done before. While Git repositories work great for my coding projects there are a lot of other things that need redundancy as well. With that in mind I’ll highlight a few things I do to try make sure I can recover systems when I need to.

There are hundreds of different ways you could set this kind of thing up but this is what works for me. If you just want the list of software jump right to the links.

7 min read

First Post

First posts to a blog are always kind of pointless so I’ll keep this one short and quick. GitHub provides a way to quickly deploy a personal blog site so I thought I’d take advantage of it. Mostly I want to play around the Jekyll as I’ve never had a chance to do that before. Almost secondary I wanted a place to document some random thoughts related to various GitHub projects that I either own or contribute to. Having a space to explain certain design decisions, discussions had, or just code I find interesting would be helpful so I thought this would be a good place to do that.

As of this post my skills with Jekyll are pretty limited so expect the design and navigation on this site to pretty horrible for a while. I’m definitely not a designer so form is secondary to function for sure. As I find ways to make it better I’ll see if I can at least make this useable for the average person.

~1 min read
Back to Top ↑

work

Dynamic Pandas Data Slicing

Recently I wanted to modify a Python data analysis script I use regularly at work into more of a general purpose tool. The script uses the Pandas Python library to slice up data in CSV files based on some specific time periods. The issue I had is that these time periods changed often, and I was sick of mucking about in the script to constantly tweak them. I needed a way to specify the time periods at runtime instead of hard coding them.

This turned out to be more complicated than I envisioned so I figured I’d document it all for anyone interested (most likely myself in a year when I forget). Note: this post is not a primer on Pandas, or data slicing, if you want more info on that check the Pandas documentation.

8 min read

Monitoring SNMP Traps

In my profession life I recently purchased an Infrasensing Base Unit along with a door contact sensor. These are pretty interesting IoT devices that accept a wide variety of sensors. My intention was to connect this to our network monitoring system, Icinga, to monitor the status of a network cabinet door.

Upon playing around with the device I decided the best way to get timely alerts from the sensor was to utilize SNMP traps instead of polling for the status. While I have a lot of experience polling SNMP systems I’d never dug into traps before. Going down the rabbit hole of getting this going turned in to a pretty neat little project that can be utilized to translate SNMP trap payloads into something Icinga can accept for service checks.

sensor page

8 min read
Back to Top ↑

ai

Portable Face Finder

As a side project I’ve been working on a portable Python program to find if specific people, using facial recognition, are in a collection of images. The idea for this grew out of a joke but the more I thought about it I realized it had some real applications.

A co-worker of mine was having trouble finding images of specific individuals within a large folder of images. Over the years this folder had gotten overgrown and photos were in random sub-folders sorted by date, location, or event. It was hard to find photos of specific people without digging through a lot of images to see if they were in them. I jokingly suggested we use some facial recognition software to comb through the folder and just flag all instances of the person they were looking for. I held on to the idea over the next few days thinking about how something like this would function.

The idea itself is pretty boilerplate stuff for any image tool, like Google Photos or on Facebook. These will recognize the faces and do all the heavy lifting for you. My real interest lay in situations where having an offline solution to this problem would be useful. Family pictures on a parent’s computer or in this case employee photos not part of a unified imaging solution. I imagined there was some utility being able to throw in a USB drive, launch a script, and identify photos of interest based on looking for specific faces.

deepface image detector example

8 min read
Back to Top ↑

data-analytics

Dynamic Pandas Data Slicing

Recently I wanted to modify a Python data analysis script I use regularly at work into more of a general purpose tool. The script uses the Pandas Python library to slice up data in CSV files based on some specific time periods. The issue I had is that these time periods changed often, and I was sick of mucking about in the script to constantly tweak them. I needed a way to specify the time periods at runtime instead of hard coding them.

This turned out to be more complicated than I envisioned so I figured I’d document it all for anyone interested (most likely myself in a year when I forget). Note: this post is not a primer on Pandas, or data slicing, if you want more info on that check the Pandas documentation.

8 min read
Back to Top ↑