Docker: Error during setup of component hdmi_cec

Hi,

I am using the official HomeAssistant Docker image (0.75.3).

I have just tried adding hdmi_cec to the configuration.yaml with the following lines:

hdmi_cec:

  devices:
    Philips TV: 0.0.0.0
    Bose SoundTouch 300: f.f.f.f

When I restart HomeAssistant, I get the following error traceback:

[homeassistant.setup] Error during setup of component hdmi_cec
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/cec/__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_cec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/hdmi_cec.py", line 182, in setup
    adapter = CecAdapter(name=display_name[:12], activate_source=False)
  File "/usr/local/lib/python3.6/site-packages/pycec/cec.py", line 20, in __init__
    import cec
  File "/usr/local/lib/python3.6/site-packages/cec/__init__.py", line 21, in <module>
    _cec = swig_import_helper()
  File "/usr/local/lib/python3.6/site-packages/cec/__init__.py", line 20, in swig_import_helper
    return importlib.import_module('_cec')
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_cec'

My hardware is as follows:

Running Pulse Eight USB CEC v1 (HDMI 1.4) firmware version 7 (latest) on /dev/ttyACM1. CEC Utils version 4.02.

Output from echo scan | cec-client -s -d 1:

opening a connection to the CEC adapter...
requesting CEC bus information ...
ERROR:   [           15288]     failed to request the physical address
CEC bus information
===================
device #0: TV
address:       0.0.0.0
active source: no
vendor:        Philips
osd string:    TV
CEC version:   1.4
power status:  standby
language:      ???


device #1: Recorder 1
address:       1.0.0.0
active source: no
vendor:        Philips
osd string:    CECTester
CEC version:   1.4
power status:  on
language:      eng


device #5: Audio
address:       f.f.f.f
active source: no
vendor:        Unknown
osd string:    Audio
CEC version:   unknown
power status:  unknown
language:      ???


currently active source: unknown (-1)

Any idea where I could be going wrong? Is something missing from the Docker image?

Thanks,

Daniel

Hello @danielhitch, did you ever find a resolution to this? I’m facing the exact same problem, also using the latest official HomeAssistant Docker image.

I posit the same question to you, i’m having similar issues in docker getting HDMI-CEC working.