LG TV Discovery 2012+ Power Save & DTH Controller

Modification of @Samlalor, LG TV Discovery 2012+ Power Save & DTH Controller:

In case someone needs to control LG smart TV of years 2012, 2013 prior to webOS. These TVs cannot be reset to ON since the network is inactive at OFF state.
I have modified the smartapp to detect the TV and create the Virtual Controller device.
Modified the DTH to activate the energy saving function on the TV with the screen turned off and without sound (TV 42" 12 watt. and in TV 29" 9 watt. of consumption).
In this way you can turn off the screen and restore it from smartThings in addition to turning off the TV.

DTH of virtual controller functions:

  • Turn TV off (with “Off” Key)
  • Activate energy saving: mute On and screen Off. (with “Pause” key)
  • Deactivate energy saving: mute Off and screen On. (with “Play” key)
  • Every 5 minutes it refreshes the current status of the TV, On or Off (with “Off” Key)
  • Smartthings detects the dth as a multimedia player and the 3 states, Playing, Paused, stopped (Off) can be used to control the TV from automations and scenes.
  • Use of mute and unmute regardless of the energy save function. The TV does not send the current state of the sound. The DTH sends the command to change the current state, just like the remote control.
  • If the TV is turned On or Off from the remote control, smartthing updates its current status every 5 minutes or manually by pressing the On-Off button.
  • As the new smartthings app uses the tiles without paying attention to the labels and icons of the DTH code, the status information in the main tile is not always displayed correctly except for “stopped”. The icon and the animation if it is always correct and the status information for use in automations as well.

I have put a link of a video to see how it works on TV and smartthings:
https://youtu.be/BZdkc4471nE

Some pictues:
Screenshot_20210306-164601_2


  • INSTRUCTIONS TO INSTALL:
  • -Create and publish samrtapp and Controller DTH in IDE.
  • -Open The App, click on “Discovery” to found TV.
  • -If Show ‘Select LG TV(0 found)’ click next until ‘Select LG TV(1 found)’, then ‘Tap to set’ to select IP TV"
  • -Select the TV app found, just find 1. click on “done”, then key code appears on the TV screen, take note of it.
  • -(Every 15 seconds refresch TV found and clean the previous selection)
  • -Write an App Name to control One TV device. Controller will be created with same name.
  • -Click on “TV Key” and write the copied TV pairing key.
  • Click “Done”. Smart app and controller will be created.
  • IMPORTANT: Must be configure in your router the Fix IP for your TV or you must write the TV IP in th device configuration even 12Hours normally

Smart App link:
https://github.com/Mariano-Github/LG-Smart-TV-2012/blob/main/LG%20TV%20Discovery%202012%2B%20Power%20Save.groovy

DTH link:
https://github.com/Mariano-Github/LG-Smart-TV-2012/blob/main/DTH-LG-TV%202012%2B%20Control%20Power%20Save.groovy

1 Like

I have made some modifications to the DTH TV to add:

  • Use of mute and unmute regardless of the energy save function. The TV does not send the current state of the sound. The DTH sends the command to change the current state, just like the remote control.
  • The DTH assumes that when a change from the “stopped” status is detected, the TV is in “Playing” status.
  • Added control of the version and date of the dth in settings.

Comment that these TVs, if you connect them to the electrical network with a plug or smart switch, you can turn the TV on and off with the device as long as you do not turn off the TV with the remote control. The TV recovers the last state it had when the power supply was lost.
The DTH every 5 minutes will detect when the TV has connected to the home router and will show the status “playing” or disconnected from the router and show “stopped”

Link posted are modified