Can't get HDMI-CEC to work in Docker

This is pretty much the same issue as Docker: Error during setup of component hdmi_cec, which was never addressed and is still an issue 5 years later from the looks of it

  platform: media_player
    Fire TV Stick:
    Games Consoles:
    Media Server:
    VHS / DVD:
    hdmi_cec.hdmi_1: media_player

And i get the folowing Error

Logger: homeassistant.setup
Source: components/hdmi_cec/
First occurred: 4:02:13 AM (1 occurrences)
Last logged: 4:02:13 AM
Error during setup of component hdmi_cec

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/", line 286, in _async_setup_component
    result = await task
  File "/usr/lib/python3.11/concurrent/futures/", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/hdmi_cec/", line 206, in setup
    adapter = CecAdapter(name=display_name[:12], activate_source=False)
  File "/lsiopy/lib/python3.11/site-packages/pycec/", line 20, in __init__
    import cec
ModuleNotFoundError: No module named 'cec'

Iā€™m sure this is not in the pristine HA docker image. Any explanations?

1 Like

Ah yes, I forgot to mention I use the image which increases security, it basically pulls down the official one and applies some environmental updates to the user and such so it doesnt run as root.