I have an LG OLED 48A16LA which I want to control fully through Home Assistant.
I can add the TV via Apple Home Kit Home app and I can control the TV on/off state and the inputs, however, I have removed the TV from Home Kit, and then re-added it via Home Kit Controller in Home Assistant and the TV, successfully connects, however within Home Assistant I don’t seem to have the ability to control the on/off state of the TV to be able to set up automations within home assistant which I want to do as I don’t really want a mix of some stuff being controlled through Apple Home and some being controlled through Home Assistant.
When I try and apply a scene for example, when the TV is Off I only get the following, which doesn’t give me any option to be able to turn the TV on.
When the TV is on, I then get the option to select the inputs of the TV, but there is no option to turn it off as shown below:
It seems strange though that this has to be done in this way and it doesn’t act like a normal homekit device, my understanding is, if you add a homekit device to home assistant it should act the same with the same functionality as if the tv was added to apple native home kit. Is this not correct and the blueprint is the only way to accomplish this?
First, go to Developer Tools → states and find the entity name for your LG television. This assumes that you have added the “LG webOS Smart TV” integration.
Next, go to System → Automations.
Click on “Create Automation”, then “Create New Automation”.
Next, click on the meatball (3-dots) menu and select: “Edit in YAML”.
This is where you paste the code above, but using the entity name for your LG TV.
You can also do it by editing automations.yaml, but the risk of screwing up some other automation is too great. You could also do it in the GUI (Visual Editor), but just inserting the code in YAML is quicker.
Thank you so much for your detailed instructions! They work flawlessly!
Until now, my automation solution was to cut the power to the TV/projector via a smart plug and turn it back on using auto power-on, but I guess that’s not the best solution for the hardware in the long run, as a non-graceful shutdown could potentially cause damage over time.
Now, with your solution, it works without any headaches, and I’ve also learned something valuable about YAML-based automation creation. Thanks again!