This blueprint will run anytime the user turns the selected webOS media player on through Home Assistant (UI or actions).
Adding this blueprint will allow the user to turn on the LG webOS TV through the UI after updating to HA 2022.2, without this blueprint or similar automation the Turn On button won’t be displayed due to a breaking change. This is basically a shortcut to manually adding the automation described in the official documentation.
The default action is to send a Wake On Lan magic packet in order to turn the TV on. Additionally you can also setup custom actions for alternate solutions such as: using an IR remote, turning a smart socket on or calling an script. This is also useful for TV models connected through Wireless that have issues with Wake on Lan.
Enable Custom Actions and then add the service wake_on_lan.send_magic_packet manually.
I have two TVs, how do I use this?
Once you’ve added the blueprint to HA, you’ll have to create one automation for each TV.
I added this blueprint and the Power Button won't show!
You might need to disable and enable your automation, if this keeps happening it’s recommended to open an issue.
Why is this necessary?
There was a breaking change documented in HA 2022.2 release notes:
The LG webOS Smart TV integration migrated to configuration via the UI. Configuring LG webOS Smart TV via YAML configuration has been deprecated and will be removed in a future Home Assistant release.
Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.
The turn on action for turning on the TV via WakeOnLan or HDMI-CEC was using a service call via YAML, and the turn on action is changed to use a custom automation trigger webostv.turn_on or a device trigger automation that can be setup from the UI.
Hi,
I can’t seem to get it to work got the following error.
Blueprint LG webOS Smart TV - Turn On generated invalid automation with inputs OrderedDict([(‘webostv’, ‘tv’), (‘webostv_mac’, ‘XX-XX-XX-XX-XX-XX’)]): Entity ID tv is an invalid entity ID for dictionary value @ data[‘entity_id’]. Got None
The entity is correct.
To be fair I can’t get the automation to work either. The magic packet (by manually triggering it) works on its own, just not the trigger webostv.turn_on… all my buttons and automations use media_player.turn_on service call.
The webostv.turn_on automation trigger also does not appear to be ffiring for me as of Home Assistant 2022.2.1. Prior to this I was using the YAML configuration for WebOS and turn_on_action: was defined in my configuration.yaml with the same web_on_lan.send_magic_packet defined in the blueprint provided in the OP.
Update: Fixed it! I use a custom card named mini-media-player and needed to add toggle_power: false to allow the power button to use media_player.turn_on. Additionally adding this blueprint caused the power button to appear on the webos tv entity where previously no power button was visible when the TV was off.
Wow…I just happened to come across this thread in a search for something unrelated, but glad I found it.
Seems archaic to make a user setup an automation so that the power on button shows up in the media player card in the UI.
Why is this not in the setup of the integration?
Does this seems strange to anyone else? Or am I just getting old enough to start yelling at kids on my lawn now?
finally got it working after a lot of buggering around - spent the whole weekend debugging corporate code to fix an incident, haven’t the energy to work this one out…
the new integration doesn’t allow you to specify certain sources like the old one did either… seems like a step backwards to me
I think HA has stricter rules for what an UI based integration can have.
Since the WebOS API doesn’t have a direct way to turn the TV on, they settled on this compromise where you can use Wake On Lan for wired TVs or an IR remote for wireless connected TVs. I plan to update this blueprint for IR commands as well.
It’s still weird and I believe it won’t stay like this, but for now I went ahead and made this blueprint to help out.
1 - Add this blueprint and keep using your script as is, no change nedded.
2 - Manually replace the turn_on with the service wake_on_lan.send_magic_packet.
It just started randomly working after a couple updates / reboots then reloading the integration.
I’m guessing renaming the device caused the issue I was having.
Thanks for putting this together.
Everything is ok with the blueprint, works perfectly, thanks.
But I have a real strange problem. I have to TV’s and for one of them the power button on the media player doesn’t appear. It appears only one time after restart of the HA.