I was thinking how to simplify stuff for my “wife remote” now that I’ve got the basic “turn on tv” and “turn on av” stuff controlled through HA as a single switch template. The inspiration was to make the old HTPC remote control buttons do what they used to do, but better Thought that implementing this via MQTT seemed like the modern solution with minimal changes to existing setup and no API calls anywhere.
I found some python code to enable IR to MQTT functionality, documented it a bit and came up with this solution.
It works instantly in my home, but that might be just because the IR remote has so much better tactile function than the crappy 433Mhz remote that came with some switches.
This can be used for any linux input events in general, just change the /dev/input/3 to whatever number your device is. Imagine a full keyboard with hundreds of potential triggers with all the modfier keys.
Hope it’s useful for someone. Also I’d appreciate some feedback on the python implementation to see how it could be optimized and ideally move to hbmqtt.
Feedback welcome, usage guide is on github.