Smart HDMI Switch

I wanted an HDMI switch that worked with Apple HomeKit so that I could include it in Scenes. Manually switching things is a drag and I wanted to keep the number of remote controllers very low.

I had a StarTech 4 port HDMI KVM that I wasn’t using any more. It was perfect for this project because it had a large case that was easy to fit a dev board in, and it used momentary contact buttons that would be easy to replace with MCU controls.

Because this had to be HomeKit compatible I needed build in wifi support, and the current chip of choice for that kind of thing is the ESP32. I was new to this platform and wanted to get this done quickly so I chose the Arduino Nano 32 board.

Then I had to decide/research how to write the code for it. I found the excellent HomeSpan library. This made it incredibly easy to get things working. The library handles all of the wifi and HomeKit setup for you so that you can focus on the actual functionality. I completed this project in a few hours, so many kudos to the HomeSpan team!

The wiring was very simple too. The KVM had a couple pads available to pull the +5V and GND connections from, then I removed the original switches and soldered the GND connections and switch pin connections that were needed.

All my code had to do was to set the pin states needed for each input. It works perfectly, and it is VERY fast.

I have shared the Arduino sketch on GitHub, and you can find it here.

I have plans to make more HomeKit accessories and I’m excited to explore more smart home platforms.