Announcement

Collapse
No announcement yet.

LG Smart TV Control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    LG Smart TV Control

    Hi all,

    As posted in another thread, I am working on some scripts to control the LG Smart TV that I have. It does not have an RS232 port, so unfortunately, it can't be controlled that way. Below are some screen shots of what it does so far. The scripts will create the HS devices needed and will query the TV for which apps are installed on it and will download the icons for those apps and use them as the device buttons. If you add or remove apps, the script can be re-run and the devices will update as appropriate. The TV can be controlled using the devices or through events. Note that these TVs do not support "Power On" commands over the network, so they must be turned on using a different method (IR or through HDMI port turning on).

    The scripts should work with all the same models as the LG TV Remote app designed for the LG TVs that run the same operating system. Unfortunately TVs that are older or newer won't work with these scripts. I created these scripts as a learning exercise for myself and posting them in case they are useful to others. Only limited support will be provided.

    Discussion thread is located here: http://board.homeseer.com/showthread.php?p=1245168

    Cheers
    Al

    A current image of the TV display can be retrieved:
    Click image for larger version

Name:	LGTV4.png
Views:	1
Size:	24.7 KB
ID:	1209207

    List of Apps Installed:
    Click image for larger version

Name:	LGTV2.PNG
Views:	1
Size:	131.5 KB
ID:	1209204

    List of My Apps:
    Click image for larger version

Name:	LGTV1.jpg
Views:	1
Size:	50.0 KB
ID:	1209206

    Remote Control:
    Click image for larger version

Name:	LGTV3.PNG
Views:	1
Size:	97.7 KB
ID:	1209205
    Last edited by sparkman; May 15, 2016, 02:24 PM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    #2
    These are the TVs that should work with the scripts:

    Supported Models

    LM9600, LM9500, LM9400, LM8600, LMG860, LM76XX,
    LM67XX, LM66XX, LM64XX, LM6300, LM62XX, LM6100,
    LM5900, LS5800, LS57XX, PA6900, PA4700 Series

    LA9700, LA9600, LA8800, LA86XX, LA7900, LA74XX,
    LA7100, LA69XX, LA6800, LA66XX, LA6500, LA64XX,
    LA62XX, LN61XX, LN57XX, LN570B, PH67XX, PH6600,
    PN6700, PN5700, PH4700, PN4700 Series
    UB83XX, UB82XX,
    LB57XX, LB58XX, LB49xx,
    PB69xx, PB66xx

    UB80XX, UB82XX, UB83XX, UB92XX
    LB49XX, LB57XX, LB58XX, LB61XX
    PB65XX, PB66XX, PB69XX
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Scripts are attached here. Five scripts are included:

      lgtv-createpairdevice.vb
      lgtv-createappdevices.vb
      lgtv-createimagedevice.vb
      lgtv-createremote.vb
      lgtv.vb

      The first four scripts need to be run to create the devices. Unfortunately all the events need to be created manually. Start by creating all of the events that are manually triggered shown in the screen-shots in the next post. Run the event that runs lgtv-createpairdevice.vb first and then turn on the TV. Create the event shown below called "BFR LG TV - Pairing" next. Then, on the pairing device that was created, click "Display Pair Code" which should show a code on the TV. Enter this code into the device and then submit. Then press the pair button and check the log to ensure no errors. Run the other scripts that create devices after. Devices should be created automatically. Next create the events that are called by changes to those devices.

      The last script is called by a device change of one of the devices created by the other scripts. Two parameters are required, the ip address and the command type. See screen shots for examples.

      Icons are also attached. Put them in the html\images\lgtv folder.
      Attached Files
      Last edited by sparkman; May 15, 2016, 02:34 PM.
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment


        #4
        Screen shots of events

        Create these events first:
        Click image for larger version

Name:	LGTV1.jpg
Views:	1
Size:	79.5 KB
ID:	1184710
        Click image for larger version

Name:	LGTV2.jpg
Views:	1
Size:	27.4 KB
ID:	1184711

        Run the Create Pairing Device event and once the Pairing Device is created, create this event and then go through the pairing process:
        Click image for larger version

Name:	LGTV3.jpg
Views:	1
Size:	26.9 KB
ID:	1184712

        Next create the other devices by running the other manually triggered events and then create the events shown below. Note that the devices can be renamed as needed.

        Click image for larger version

Name:	LGTV4.jpg
Views:	1
Size:	52.8 KB
ID:	1184713
        Click image for larger version

Name:	LGTV5.jpg
Views:	1
Size:	53.9 KB
ID:	1184714
        Last edited by sparkman; May 15, 2016, 02:19 PM.
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Al,

          Where did you find the web API like this? I just bought an LG OLED and it's a 2016, so not sure if this will work. I've found the RS232 and IP control (Which seems to only be control, not status). I'd be interested in knowing how you got this info so I can see if there is a similar for my TV. All my searches come up blank for an "API".

          When I get mine, I will definitely try these scripts out first though in case they work on my newer model.

          Comment


            #6
            LG Smart TV Control

            Pretty sure that these won't work for the 2016 model. Let me check my references when I get home as I did find the API for the newer models when I was searching for the ones I needed. From what I recall the OS on the newer models is called WebOS, so try searching for LG WebOS API.


            Sent from my Phone using Tapatalk
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              I am trying to get this working with newer LG TVs based on WebOS 4. Has anybody done this already? If not, I did do some research but I can't quite figure out where to get the right commands. I found this link http://webostv.developer.lge.com/api/webos-service-api/ but I don't see anything how to get the authentication (the pairing between the TV and HS which is a part of the description above), or to query what apps are available (I only see how to start an app), etc. Am I looking at the wrong place?

              Comment


                #8
                Got this installed and working. It really helped me out and educated me on the UDAP 2.0 protocol which is quite limited. Thank you. My TV is the 47LA6200 (2013 model)

                Comment

                Working...
                X