Hi experts,
I cant make hdmi_cec component work anyway. My hass is installed in RPi3 and then I installed libcec following this script . libcec has been successfully installed and with the cec-client command I am able to on/off my TV as well. But problem is, whenever I try to follow the HDMI_CEC component configuration guideline, it doesn’t load anything at all. the error is like below:
16-08-05 14:59:46 homeassistant.bootstrap: Invalid config for [hdmi_cec]: expected a dictionary for dictionary value @ data[‘hdmi_cec’][‘devices’]
Basically, I am not clear though , excel on/off if anything I would be able to do with CEC (e.g. Channel Up/Down). Anyway, the on/off option looks nice to me.
Btw, can anyone point me to the right direction where I can get some automation example with HDMI CEC component as well ? I want to place a input box for on/off in the front page, possible ?
OK i can see some pretty obvious formatting issues with your YAML which I am pretty sure is the issue. See here for an example, taking note of the indents and numbering. They are crucial to getting this working correctly.
So assuming that you have your Pi connected to HDMI1 and your Chromecast connected to HDMI 2 on your TV your hdmi_cec: entry should look like below.
hdmi_cec:
devices:
1: raspberrypi
2: Chromecast
Let me know how that goes for you before we move onto the Input Boolean switch for your ‘Input Box’ for the frontend.
EDIT: corrected syntax error in code as @martinhjelmare pointed out below.
Thanks a ton both of you guys… Indeed the solution was to use the colon( in devices list… In the documentation it was mentioned as dot(.)
The YAML configuration was correct indeed but during copying I mistakenly removed the spaces. Anyway thanks again for your tremendous help.
Hi Andrew, oops! my mistake… The documentation is correct actually as I checked again now. I referred to the HDMI component… Thanks a lot man…
By the way, could you please refer to any automation example with input_boolean to possibly power_on/standby/select_device the HDMI TV from the front end. The component example doesnt cover much or least not for a noob like myself. However, from the developer tab, I am now able to do the source change and power on/off the TV.
I’ve done something similar to what you want to do by using an input_select: instead of input.boolean: and some automation rules to go with it. I actually plan on adding an example to the component page for the reasons you have stated but only once I have something that is reliable. By that I mean I am currently working through a bug or something as I can only trigger the automation once for each option in my input.selection. After which the HDMI control part of my automation just stops working.
Maybe you could do me a favour and try a modified version of my input_select: to suit your first, to help me with my troubleshooting?
NOTE: I have added some otherwise unnecessary persistent notifications to help with troubleshooting my automations but It might be useful for you initially too.
So input_select suited your requirements just fine? I’m taking it you don’t have trouble with it not changing inputs after a few tries of different selections?
What I am working on now with @dale3h’s help is some sort of status display for your HDMI devices so you can see in HASS what is on and which is selected. I’ll be sure to share it once we have something useful.
Yep man… Thanks a lot again. The input_select is serving my purpose. However, hass status is not updated once the TV has been powered off/on manually. That’s okay to my purpose.
Regarding the responsiveness, I would say the reliability is not 100% but reasonable. For example, if the power is off, then if I try to change the input to Chromecast it is not responding rather I have to press ‘OFF’(once again) then ‘ON’ then ‘Chromecast’ which works fine.
Indeed, before HDMI_CEC component I tried with samsungtv component with IP address, that also works but it couldn’t power on the TV for obvious reason… When its powered off, it doesn’t have any IP assigned hence no control…