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

I updated app and DTH code with yours but I still have the same problem. I click discover and it shows 0 found. So I click next and it takes me back to the root page. So I go back into Discovery and rinse/repeat. I did it 10+ times in a row and nothing different happens. Am I supposed to wait for some period of time for Discovery?

I’m referring specifically to this instruction:

follow these steps of the screenshots.
until the IP connection of the TV to the Router comes out. If the IP does not come out, the TV is not compatible.
If the TV is connected to internet, app detects TV IP quickly.
Can You see the IP TV in Network TV menu?



)

After click Done, pairing Code must be appears in TV. Note It.

Write the name for TV Controller
Write pairing Code

Click Done and TV Controller and app Will be created.

That’s strange. The sequence of your screenshots is not what comes up for me. As far as compatibility I’m surprised that a 2016 webos TV (firmware is 3.4.0-5803) is not compatible. Here is what I see:

Here are pics of my TV info that show it is connected to wifi but I didn’t see the IP address:

However, I was able to retrieve the IP address from my eero router app. I can also confirm it is online:

The mac address matches the TV so I know for sure it is the same device.

Since I know the device TV IP is there any way to force the connection or manually input it somewhere to see if it would work?

I think it will not work with that version of webOS, but I modify app to manually enter the IP.
See if it shows the pairing code, that’s the next question.

Let’s see if I can modify it to this afternoon, I’m a bit busy now.

Regards

@alexcapone,
Can you see the response from the TV in IDE live login ?. to see if it responds with the IP and MAC address or with an error or different format than expected.

Sorry, where do I find Live Login in IDE? I’ve re-saved/published the DTH and app code.

Sorry, not trying to be obtuse here but not sure what exactly I need to do. Thanks for your help.

In the IDE Page, top menu, right Hand if use a PC

With celular, Maine menu, log


Better in the PC, while on the cell phone you try to install the app

Thanks. Sorry I misunderstood what you meant earlier.

I let the logs run several minutes during discovery and searched for the MAC address but it did not show up.

Is the TV required to be connected via wired connection? It is connected to Wi-Fi for me.

Sorry I didn’t answer you before, I’m a bit busy.
It doesn’t matter with Wi-Fi or Lan, I have one of each and they work the same.
this is the capture of the live loging when the app is searching and the tv does not answer.

This is when the tv answers and is found.

I think that the webOS version of Tv is not compatible and the app will not work.

I would try a smart plug to turn the tv on and off, to see if it works for you, the app does not do much else.

I put the link to the app “LG TV Discovery 2012 + IP”, modified to write the IP of the TV manually in xxx.xxx.x.xx format.
The dth is the same.

Steps to install:

  • Copy, paste, save and publish smartApp “LG TV Discovery 2012 + IP” in IDE
  • Open smartApp “LG TV Discovery 2012 + IP” in your smartthings app
  • Select IP Manual entry = Yes
  • Write the IP of the TV in 192.xxx.x.xx format
  • Click on “Discovery”, it will show another page with Select LG TV (1 found)
  • Click on next
  • Write the name for the smartApp and the TV controller
  • Press on “TV key”: the pairing key will appear on the TV, (if the key does not appear on the TV, it is not compatible)
  • Write the pairing key and press “Done”
  • The smartApp will be added in your smartApps list and a device will be created for that TV at the end of the smartthings main page.

If the IP of your TV is not configured with a fixed IP in your Router, it can change every x hours, depending of the router configuration. If the TV changes the IP you can update it in device settings or configure your TV in the router with fixed IP.

Thank you so much for adding this functionality. Unfortunately, after manually inputting the IP address it does not bring up the pairing key on the TV so it seems to be incompatible. Hopefully this additional feature you added will be helpful for other users with setup issues.

1 Like