Hi everyone:) How do I send and receive raw HDMI CEC commands with HA? (e.g. 14:44:44 = Apple TV play/pause in my setup)
Been using the great cec-mqtt-bridge on Raspbian. Is there something similar for Home Assistant (Hass.io). I don’t see this functionality in the stardard cec integration (https://www.home-assistant.io/integrations/hdmi_cec/). I’m not using docker (yet).
if you go to Developer Tools (sidebar) -> Services, type “hdmi_cec.send_command” into the Service field. It should show you the parameters the service accepts, and I think you need to use “raw:”
'Raw CEC command in format "00:00:00:00" where first two digits
are source and destination, second byte is command and optional other bytes
are command parameters. If raw command specified, other params are ignored.'
Hi Lothar. Thanks for your help. Do I need a specific add-on for it to work? I’m not getting any info on the accepted parameters. It says “service not found” (image below)
Go to the Events Tab in Developer Tools, then Start Listening to the event. If you do whatever you want to receive here, and something shows up, you can use the event for automations.
Neither the send_command service nor those events are mentioned in the documentation, and might not be very well tested. I have personally not used them either.
In general all services and events should be available in Node-Red if Home Assistant is properly integrated.
Thank you very much. I will see if I can make this work.
HDMI CEC seems like very overlooked functionality. I’ve been using it to control all my HDMI enabled devices without having to find and setup complex integrations for each device.
In this screenshot you are not listening to the event at all. The name of the event hdmi_cec.cec_command_received needs to be what is in the input field when you press start listening. If the event works, and another device sends a CEC command this page will then show a JSON format of all data in the event.
I’m turning the volume up and down on my receiver with my tv remote via hdmi cec, and turning the tv on and off, but no events Does this mean that this event does not work / is not supported?
Did you try hdmi_cec.cec_keypress_received too? There has to be a reason this exists as a separate event. Also have a look on the TV what CEC device is selected there to receive the input.
I think the difference between cec_commands and cec_keypress is that cec commands are predefined whereas a cec keypress can be anything (which enables two devices of the same brand to send non-standard commands).
There seems to still be problems. I also get nothing listening to the CEC events. My created switches all auto-generate as expected (proper names) but the switches themselves don’t work. The hdmi_cec.power_on and hdmi_cec.standby services both work. However, the hdmi_cec.send_command and hdmi_cec.volume do not.