HDMI CEC component

HDMI CEC component to control any HDMI CEC enabled device connected to you Hass server.

You can use a command line switch for that along with a CEC-USB adapter.


Command-line Switch

And libCEC.

As a reference:


As this feature made it into the software I’d like to add the request to add a volume control to this component. Would free me of having to build an IR transmitter.

I’m not running HA on the device that is connected to my audio setup (I’m using an old RPI for that). Therefore, I could not use this component, since it requires to have CEC locally.

I’ve created a CEC-MQTT bridge for this purpose, you can find it on https://github.com/michaelarnauts/cec-mqtt-bridge. You can ofcourse also run this bridge locally and use the MQTT support in HA to send messages to the bridge.

It supports power and volume control. Plus you can send every command when you construct the raw command.

I wrote cec-web last year. It provides a REST interface to CEC. Would make for a good stepping stone before a full platform is built.

1 Like

Sorry your bridge does not seem to work on my raspberry pi 2 I did add my mqtt user credentials but it still says "AttributeError: ‘module’ object has no attribute ‘libcec_configuration’"for the line “cecconfig = cec.libcec_configuration()”

I will look into that tho. Thanks for the link!

Hey thanks for the link but I think it would be overkill to install Go just for that little REST API as a stepping stone. Thank you tho!

You should install libcec from https://drgeoffathome.wordpress.com/2015/08/09/a-premade-libcec-deb/ or compile it yourself (altough I wasn’t able to do that since raspbian doesn’t include a c++11 compiler or something like that), the precompiled versions from last year work fine.

It includes the libcec python wrapper from libcec itself, that has more features.

Well I installed the cec python module via pip and installed libcec-dev. Had to uninstall those and install the precompiled one you linked. Now it seems to work fine! Thanks!

I have an enhancement request for the HASS HDMI-CEC component. Is it best to add it here or in its own thread?

@andrew-curtis new thread would be best!

Fixed by adding the new hdmi_cec component in 0.23.