Replacing A Harmony Remote Using Home Assistant

For a long time I’ve been a fan of the Logitech harmony remote controls. They let you orchestrate the operations of lots of devices. I like to think of them as setting scenes. For example in the room we watch tv, we have a tv, soundbar, Apple TV, sky box, HDMI switch and a couple of games consoles. So to watch sky tv :

  • Power on the tv
  • Power on the soundbar
  • Power on the sky box
  • Set the tv to HDMI 3
  • Set the soundbar to HDMI 1(ARC)
  • Set the HDMI switch to 1

Switching to the Apple TV needs a similar sequence, the games console another etc.

Remembering all the sequences is a pain. Enter the wonderful harmony remote that allow to use a database of devices and it can emulate them all. So a single press of a button on the screen called “sky tv” can perform that sequence (and then operate as the sky remote to allow changing channels etc. )

The problem is that Logitech decided to get out of the remote control business. Whilst the remotes mostly work, the servers you program them through are no longer maintained. Plus my remotes are getting really long in the tooth (the battery on one has failed and corroded leaving it only working whilst plugged into USB). The writing is on the wall.

A few competitors have entered the market, notably SofaBaton. I’ve tried the Low end model, but it was more a replacement for multiple remotes than allowing you to set a “scene”. The higher end one looked like it allowed scene setting, but it was very pricy and a lot of the UK based reviews seemed negative.

I’m a big fan of home assistant (HA) and have seen multiple “IR blasters” that can be controlled through it. I managed to get a Broadlink RM Pro device working for a small set of scenes as a proof of concept, but in general the scripting was painful.

The company LinknLink offer eRemote devices that are fantastic IR blasters that offer full HA compatibility via MQTT. They have a great little app that allows you to load devices from a database. It’s smaller than the Logitech harmony one, but it also has a simple mode for learning from other remote controls. The devices defined in the LinkNLink app then show up in HA with actions like TV - Press Power Button.

Using the Automations/script function in HA it was then easy to create scripts that mimic the sequences at the start of the article. Those scripts are then straightforward to launch within HA.

The big downside was that using home assistant this way meant creating a user interface that could be accessed via a phone or tablet. Whilst that’s good for some things, pulling a phone out, launching an app and pressing a button just isn’t as immediate as pressing a button on a remote control.

I was having a dig around YouTube and found this video by Paul Hibbert. He was using a simple wireless PC keypad to trigger HA scripts. This was exactly what I needed, so I ordered one from Amazon.

Num Pad From Amazon

The tutorial worked perfectly, and everything was great except for one small issue, the range of the keyboard was fine in the office, but didn’t reach to the room with the tv in it. Due to my home networking setup I don’t want to move the HA server into the room with the TV so had to search for something else.

Enter evdev2hass a small python script from Arik Yavilevich that is able to forward keyboard events to HA. I already had a pi zero running some other projects in the TV room, so adding this script and the wireless keyboard adapter to it was straight forward.

Every keypress on the numberpad is sent across the network to HA and raised as an event in HA. You can see the stream of events sent to HA by navigating to Developertools/events and subscribing to the evdev channel.

You can then listen for those events using automations. So for example this is the event data when the 0 symbol is pressed on the num pad :

HAASIO Event Trigger

When that event is detected I run my script that calls a series of LinkNLink IR commands to setup the ‘Sky TV’ scene :

HASSIO Action

That script to setup the ‘Sky TV’ scene looks like this : HASSIO Script

So now whenever the 0 key on the remote is pressed, HA will launch the scene to allow us to watch Sky. I’ve created similar scenes to turn all the devices in the room off, setup a scene for playing PS5, using the Apple TV etc. Because this is now part of the HA ecosystem, I can also trigger things that are not controlled by the LinkNLink IR blaster. This means other buttons on the remote can toggle the lights in the room, toggle if the curtains are open etc.

I’ve added stickers to the num pad for each function and its been part of daily use of the room for several weeks now, replacing the Logitech Harmony remote completely.

Worth noting that LinkNLink have launched versions of the eRemote I describe above that also add room presence detection, temperature and humidity measurement to the blaster.