Yes, this is finally implemented into Chromecast. I too can confirm it working on a 2nd gen.
I’m wondering if there is any way for HA to understand if the TV is on through CEC, and therefore issue an off command? Such as if I leave home for a period of time to then turn the TV off.
Yes, I would love for this to work. I had been using a SmartThings outlet to control my TV on/off, but it would be nice if I could remove that extra complexity and just use the chromecast. It doesn’t necessarily even need to know if it’s on (but it would be better if it could), just be able to have separate buttons for on/off so I can do it myself.
Does anyone know how to turn off chromecast from hass? You can give the command, turn.off but that stops chromecast and not to power off my tv, only when I say it to my google home, it will turn off the television as well…
I’ve looked into this and unfortunately Google is using a backend connection to their servers in order to allow the Google Assistant to turn the TV off. The turn_on and turn_off functions within HA only influence the running the media controller to play or stop. Their limited REST API allows you to run a few basic functions including restarting the device but I have been unsuccessful in uncovering any additional hidden commands.
I’ve stuck to using my older solution of a Raspberry PI to turn on/off and detect state. Check it out here.
I’ve had mixed results using cec off commands, even directly google home voice spoken commands. It sounds like it is very TV hardware dependant.
I have a TV with built in chromecast(which has very old firmware, which is why the STD cc). It will only ever go to the chromecast gallery page with a cec off command. I actually have a standard chromecast attached to it now, cec off works with that, however it fully shuts down the TV instead of going to standby.
The IR Remote flicks the screen on and off in about 1 second. Full boot up takes significantly longer.
So I just use an mqtt IR command when nothing is playing to turn it off and cec to turn it on.