I recently upgraded my projector to a 4k JVC model along with an upgraded AV Receiver (Denon). I previously used an old Harmony remote to control the whole system, but with the new components and the realization that I really only use the Apple TV as an input device, I wanted to simplify the remote setup.
The Apple TV and the Denon worked well together using HDMI CEC. This allows the Apple TV to turn the Denon AV Receiver on and off as needed, as well as to send volume up/down and mute signals over the HDMI cable.
However, the JVC Projectors do not support HDMI CEC, so I still needed the projector remote to turn it on and off. I could have re-programmed the Harmony remote, but they don't make them anymore, and the Apple TV remote is smaller and has all the functionality I need.
The JVC Projectors do support remote control over TCP/IP. I did some research and wrote a quick Go library to control the JVC Projector remotely. There are good libraries in other languages and some mobile apps (see the README in that repo) but I didn't find any in Go.
The next step was to listen to the HDMI CEC bus to trigger the correct On/Off commands at the right time. That leads to the inspiration for this project. I came across John Lian's post on HDMI-CEC. While he was addressing a different issue, it made me realize that I could build a 'bridge' between the HDMI-CEC bus and the JVC Projector.
I used the broad approach John outlined by setting up a Raspberry Pi (Model 2 B+ in my case) and connecting it to my Denon AV Receiver. The cec-client tool worked to see all the traffic on the bus, and it was fairly straightforward to identify the two different messages sent by the Apple TV I needed to listen to.
From there I wrote up a simple go app that would run the cec-client tool and parse its output. When it saw one of the two messages it used the Go library I wrote to turn the projector on or off.
I then set up the app to run as a service on the Raspberry Pi. So now to turn on (or off) the entire system I just need to turn the Apple TV on (or off).
