Skip to content

Instantly share code, notes, and snippets.

@arag0re
Last active September 24, 2024 17:35
Show Gist options
  • Save arag0re/18d61475e0fe8db2aeda64907e7fe013 to your computer and use it in GitHub Desktop.
Save arag0re/18d61475e0fe8db2aeda64907e7fe013 to your computer and use it in GitHub Desktop.
Lg webOS Dev Mode extender script
homeassistant:
external_url: "https://homeassi.local"
internal_url: "http://192.168.178.1:8123"
automation:
- alias: "Turn On Living Room TV with WakeOnLan"
trigger:
- platform: webostv.turn_on
entity_id: media_player.tv
action:
- service: wake_on_lan.send_magic_packet
data:
mac: xx:xx:xx:xx:xx:xx (replace with mac address of LG-TV)
- alias: "Extend TV dev mode every night"
trigger:
- platform: time
at: "04:00:00"
condition:
- condition: template
value_template: '{{ is_state("media_player.tv", "off") }}'
action:
- service: script.extend_dev
script:
extend_dev:
alias: "Extend WebOS Dev"
mode: single
sequence:
- service: media_player.turn_on
target:
entity_id: media_player.tv
- wait_template: '{{ is_state("media_player.tv", "on") }}'
timeout: '10'
continue_on_timeout: true
- service: media_player.select_source
target:
entity_id: media_player.tv
data:
source: Developer Mode
- wait_template: '{{ is_state_attr("media_player.tv", "source", "Developer Mode") }}'
timeout: '10'
continue_on_timeout: true
- service: webostv.button
target:
entity_id: media_player.tv
data:
button: "DOWN"
- delay:
seconds: 10
- service: webostv.button
target:
entity_id: media_player.tv
data:
button: "DOWN"
- delay:
seconds: 10
- service: webostv.button
target:
entity_id: media_player.tv
data:
button: "DOWN"
- delay:
seconds: 10
- service: webostv.button
target:
entity_id: media_player.tv
data:
button: "ENTER"
- delay:
seconds: 10
- service: media_player.turn_off
target:
entity_id: media_player.tv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment