I’ve always loved the Harmony remotes for feel and functionality, but they can be frustrating with the things they CAN'T do and should
I’ve been reading avsforums for a while and spent a lot of time googling if anyone had developed a good DIY remote solution to get really good integrated control that worked without IR commands.
Unfortunately, I have never found exactly what I wanted – to have control of devices over the network (not IR) from a remote like the Harmony that I can program myself.
There are a couple of companies that have interesting looking stuff, but they only sell to certified installer people and much more expensive than Harmony
so I thought on it a while and came up with a “Hack” that is working better than I had ever hoped, so I thought I’d share in my first post as an avsforums member.
I’m posting on here for any others out there like me who want to do this and share my learnings – not for the faint of heart right now.
I’m also looking for anyone who is a better programmer (or one with more time) than me to help me “simplify” the software base for other people to use and add to the capability.
So what did I do? I had a Harmony Elite w/Hub. Since Harmony barely supports anything over the network (why Logitech, IR Sucks!), I started looking at devices it could control and wondering if I could spoof it and come up with a way to know what activities and buttons were being pressed. Once I figured out how to do that, it was a should be a simple matter of running whatever network command to any device that I wanted. I found the Roku ECP (External Control Protocol) and determined that Harmony uses it for the network commands. However, Harmony needs to “find” the Roku on your network before it will work. It uses something called SSDP (Simple Service Discovery Protocol) in order to discover the Roku – It then goes and gets a bunch of config data from the Roku over normal HTTP web calls. I figured if I could make another computer answer the same way as the Roku, I could trick the Harmony into sending it Roku commands.
Step 1 (Nov ‘18)
- I went out and bought a Raspberry Pi (~$60), you can probably do this with a Pi Zero W ($20) as well, but I haven’t tested it. I also considered putting it on my HT / Gaming PC, but didn’t want it running all the time. I then loaded a free visual development environment (NODE-RED) that is specially designed for easily tying together IOT (Internet of Things) and started playing with coding up SSDP and the associated configuration pages that a Roku reports via the discovery process. I copied these pages from my actual Roku and then modified things like IP address, Name, etc. Bought a network sniffer so I could watch the messages being sent with WireShark and make sure mine matched. I got it all working, and now the myHarmony desktop software and app will discover the Raspberry PI, but thinks it’s a Roku TV. Even the Roku App on my phone thinks the Raspberry PI is a Roku TV!
Step 2. (Dec ‘18)
I then set up a HTTP messaging on the rPI to be able to receive the REST commands sent from the Harmony Hub and do something with them.
Step 3. (Dec ’18)
I made a custom activity on the Harmony remote, selecting the “Roku TV” as the only device so it prepopulated most of the buttons with Roku TV network commands.. Push Button –> Command received a message in rPI.
Step 4. (Dec ’18)
Now test that I can pass on the command to another device. So I open a telnet port to my Pioneer receiver within NODE-RED and connect it to send the receiver’s volume up command whenever I receive a message from the harmony hub “Volume Up” command to the “Roku”.
Step 5. (Dec ’18)
Now I think I have something I can work with!. The next thought was that with long and short presses on the harmony with the version of remote with light and plug control, I would need about 68 different commands to hard coded keys, plus any touchscreen commands I might want to add, but the Harmony interface to the Roku TV only has 20 something unique commands that can be assigned to buttons. So then I came up with a scheme that for most of the typical buttons (‘Play, Reverse, Forward, etc.) I would program the buttons as Harmony defaults them, but for “additional” and custom keys you need to program a two step macro and then decode on the rPI side.
Step 6. (Jan ’19)
Next I discovered that someone had already written a NODE-RED Harmony WebSocket driver, which I used to identify when I changed activity on the remote – Got this easily working. So now I can make a list of the startup and shutdown things that I want to do with each activity in the rPI and not the Harmony software.
Step 7. (Jan/Feb ’19)
Since I can read the activities and buttons, and can send commands on telnet as well as HTTP, and can also send IR commands and activities back to the Harmony so other apps can easily control, The only thing left in my house that I’m controlling over IR is the xBox when I watch BluRays. I’ve convinced myself that I can write a central controller that FINALLY ties all my stuff together.
So I coded it up for all my devices, and have been running it in my house for about 9 months, trouble free. I no longer get weird harmony things – especially with devices that use toggle or cycle commands with IR – I just send them direct network commands. I rarely get any weird delays over the wifi in my house.
Step 8. (Feb ’19 – Aug ’19)
– Enjoy fruits of previous labor for 6 months. Raspberry PI just sits in a cabinet, unseen, doing its thing. Occasional debug of glitches reported by family, add new features, etc.
Step 9. (Sept ’19)
A house move combined with new components caused me to begin re-architecture – Original code is very specific to my old system, and doesn’t seem as easy to share or maintain as I’d like. So I thought about it and set up an architecture where devices, activities and maps are all read in from config files and interfaces are generic. I came up with simple JSON text files that describe the commands to each of my devices, as well as their interfaces and feedbacks (1 file per device type), another to describe each activity (1 for each activity) and a file to map your physical buttons to the Roku commands.
Step 10. (October ’19)
Write my various activity and device files, test new system. Document my system a little and post!
I have a pretty complex system with multiple Harmony’s, multiple TVs, a Projector, Multiple receivers, Multiple Roku’s and multiple TIVOs, as well as a HTPC, Video Matrix, Screen Combiner, Motorized Mask System, Network Controlled LED strips, Network Relays, Network Power Supply, etc. I can control every single one of them from the Harmony. I can also send/receive data to an iPad/iPhone via programs like iRule. I also wrote an interface to a Wink Hub* and was able to control it and I have high confidence that I can control anything that I can get a hold of the API for.
How well does it work?
- Activities launch much faster because you don’t have to put in the long delays for most of the devices.
- No noticeable speed difference pressing remote buttons.
- Ability to direct control things that Harmony doesn’t let you do.
- No annoying times when something doesn’t configure correctly because an IR command got missed – Network Commands are super reliable in comparison
- Ability to do things like set my Volume to a specific number every time I turn on system, rather than be whatever it was before. Ability to control specific Surround Sound commands, projector calibration, etc.
- Some touchscreen functions likefavorites aren’t currently working. I didn’t use those anyway, so haven't worked on it too much
- Harmony or Roku could change something and break the interface unexpectedly.
There are still a ton of things that one can add to this.
- Automate the Harmony side of defining the buttons – it’s annoying that they don’t let you copy an activity – but it’s a one time setup.
- Update the Harmony WebSocket – there are a few things I had to hard code to match my system. I know it could be auto detected, but too much work for my purposes.
- Fix package.json dependencies on GitHub with all the dependencies correctly defined for easy download for other users
- Break the main code into more libraries that are separate and can be updated individually.
- Bug fixes and interface extensions (I know that some devices use a “unique” protocol (like Pioneer ISCP for example) on top of telnet. I’ve only defined what I need for my devices.
- Other interfaces, like Bluetooth, RS-232 and Zigby/Zwave
- Figure out how to get favorites working.
- Figure out the feedbacks for better interface to iRule type of systems
- Auto configure multiple websockets.
- All IP addresses need to be written down in config files and then controlled in your router to not change – could make more dynamic – too much work, little benefit to me.
- Advanced Internal functions? - One example is that I wrote a function that emulates lens memory for my projector
- Add Alexa, Google support
I've attached a logical diagram of the system that I made, along with a few screen shots of NODE-RED in action, and a few screen shots of my Harmony config
The source code is in 2 repositories at