Skip to content

Instantly share code, notes, and snippets.

Last active Dec 6, 2022
What would you like to do?
LG webOS Smart TV - Turn On
name: LG webOS Smart TV - Turn On Action
description: |
## LG webOS Smart TV - Turn On Action for 2022.2+
This blueprint will run anytime the user turns the media player on through Home Assistant (UI or service).
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][1].
The default action is to send a Wake On Lan magic packet in order to turn the TV on. Aditionally 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.
### Requirements:
- [LG webOS Smart TV][2] integration
- [Wake On Lan][3] added to configuration.yaml
### Changelog:
- 2022.02.03 - First release
- 2022.02.06 - Added austom actions
- 2022.04.27 - Added actions to run after TV is turned On
domain: automation
name: LG webOS TV
description: Select your media player entity
domain: media_player
integration: webostv
name: LG webOS TV MAC address
description: The MAC address of the selected TV. You can get this information on your TV network settings or through your router.
default: AA-BB-CC-DD-EE-FF
name: Actions to run after TV is turned On (Optional)
description: Select actions to run after the TV is turned on. Useful for setting a default volume or changing source automatically.
default: []
action: {}
name: Enable Custom Actions?
description: When Off the default action is to send a magic packet, when On the custom actions will replace the magic packet.
default: false
boolean: {}
name: Custom Actions (Optional)
description: When custom actions are enabled the actions added here will replace the magic packet. Useful for TVs being turned on through an IR remote, script or similar.
default: []
action: {}
select_action: !input 'select_action'
- platform: webostv.turn_on
entity_id: !input webostv
- choose:
- conditions:
- '{{ select_action }}'
sequence: !input 'custom_action'
- service: wake_on_lan.send_magic_packet
mac: !input webostv_mac
- wait_for_trigger:
- platform: state
entity_id: !input webostv
to: 'on'
timeout: '00:00:30'
- choose: []
default: !input 'on_action'
mode: queued
max_exceeded: silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment