LIRC and MQTT container

Hi,
I would like to share my docker container running LIRC. I couldn’t find a container that was compatible with Home Assistant without needing to install LIRC on the host machine, which I wanted to avoid.

I created two containers, one just running LIRC, so you don’t have to install LIRC (and all its dependencies) on your machine, and another one that you could use alongside HomeAssistant using MQTT. I found containers that worked in this way, but they all required LIRC on the host.

If you have any suggestions for reducing the final size of the container, or how to limit the “permissions” given to the container, let me know!

I couldn’t get it to work without using --privileged

I have added some examples demonstrating the usage of the containers.

Here is my setup:
image

I used the excellent rgb light card, and defined the dashboard entity as follows (based on the card’s documentation):

type: entities
show_header_toggle: false
entities:
  - type: custom:rgb-light-card
    entity: light.all
    colors:
      - type: call-service
        icon_color: 'center/75% no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22mdi-led-on%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M11%2C0V4H13V0H11M18.3%2C2.29L15.24%2C5.29L16.64%2C6.71L19.7%2C3.71L18.3%2C2.29M5.71%2C2.29L4.29%2C3.71L7.29%2C6.71L8.71%2C5.29L5.71%2C2.29M12%2C6A4%2C4%200%200%2C0%208%2C10V16H6V18H9V23H11V18H13V23H15V18H18V16H16V10A4%2C4%200%200%2C0%2012%2C6M2%2C9V11H6V9H2M18%2C9V11H22V9H18Z%22%20%2F%3E%3C%2Fsvg%3E"), black'
        service: mqtt.publish
        service_data:
          topic: lirc
          payload: '{"rc": "printer-leds", "key": "ON"}'

To replay the IR signal, I initially used a receiver to capture them, and then I employed a transmitter for replay. If you’re interested in my approach, just let me know and I can explain the process. There are better ways of doing this, but I wanted to keep it simple as I’m relatively new to electronics.

I missed some links and images due to limitation for new users :smiling_face_with_tear: