Created
December 26, 2024 17:42
-
-
Save reyo/15cf7c0a11a6c3c728374032aaa4f5c4 to your computer and use it in GitHub Desktop.
Automatically extend LG WebOS Developer Mode with Home Assistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- alias: Extend TV dev mode every night | |
trigger: | |
# Run this automation every night at 4 AM. | |
- platform: time | |
at: 04:00:00 | |
condition: | |
# Run only if TV is off. | |
- condition: template | |
value_template: '{{ is_state("media_player.webos_tv", "off") }}' | |
action: | |
- service: script.extend_dev | |
mode: single |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wake_on_lan: | |
webostv: | |
# Your TV's local IP address. | |
host: 192.168.XXX.XXX | |
name: WebOS TV | |
customize: | |
sources: | |
- youtube | |
- netflix | |
# Include Developer Mode in sources so it can be selected by the script. | |
- Developer Mode | |
turn_on_action: | |
# Make sure "wake on mobile" is enabled in your TV's network settings. | |
service: wake_on_lan.send_magic_packet | |
data: | |
# Your TV's MAC address. | |
mac: XX-XX-XX-XX-XX-XX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extend_dev: | |
alias: Extend WebOS Dev | |
mode: single | |
sequence: | |
# Turn on the TV. | |
- service: media_player.turn_on | |
target: | |
# The webos_tv identifier throught this file will depend on your configuration, | |
# so change it everywhere to match your TV's entity ID. | |
entity_id: media_player.webos_tv | |
# Check if TV is on before continuing. | |
- wait_template: '{{ is_state("media_player.webos_tv", "on") }}' | |
timeout: '10' | |
continue_on_timeout: true | |
# Open the Developer Mode app. | |
- service: media_player.select_source | |
target: | |
entity_id: media_player.webos_tv | |
data: | |
source: Developer Mode | |
# Check if Developer Mode app is open before continuing. | |
- wait_template: '{{ is_state_attr("media_player.webos_tv", "source", "Developer | |
Mode") }}' | |
timeout: '10' | |
continue_on_timeout: true | |
# Navigate down twice to select the "extend" button, then press OK. | |
- service: webostv.button | |
data: | |
entity_id: media_player.webos_tv | |
button: DOWN | |
- service: webostv.button | |
data: | |
entity_id: media_player.webos_tv | |
button: DOWN | |
- service: webostv.button | |
data: | |
entity_id: media_player.webos_tv | |
button: ENTER | |
# Wait a couple seconds to let the changes save, just in case. | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
# Turn TV off after all is done. | |
- service: media_player.turn_off | |
target: | |
entity_id: media_player.webos_tv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment