This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[APP] LG SmartTV

12357

Comments

  • jordenjorden Member
    edited June 2016
    I'm sorry I cannot help much... I'm not sure why it won't work if it doesn't. I just picked up this project because it looked 'fairly easy to do' and the documentation was already provided, even though I don't have a LG tv to test it on.

    The connection refused generally means that it was unable to connect to the TV on the mentioned IP and port. If you grab your laptop, make sure you can ping both your TV and your Homey, meaning they are both in the same network, and if your laptop can ping both that means they should be able to connect to eachother. So if that's the case, it's not a network issue but (probably) a TV related issue.

    By the way, the app is now published in the app store!
  • The only thing that i miss is an IR on signal. I know i can do it my self. But just for the completion of the app. Ins't it possible to add it?
  • jordenjorden Member
    There is no code available for infrared for developers, I think.
  • Mmhhh you're right should have search before asking! To bad we just can extract the card i already made.
  • phil_sphil_s Member
    edited June 2016
    snief, i will ping both ...
  • @jordan Most used app my tv is netflix. Is it possible to add the command directly?

    system.launcher/launch

    Start an app.

    Example: lgtv.request('ssap://system.launcher/launch', {id: 'netflix'});

  • bvdbosbvdbos Member
    tim1990 said:
    Mmhhh you're right should have search before asking! To bad we just can extract the card i already made.
    It's not that hard : just send the IR-signal and postpone sending the channel-selection etc with a couple of seconds (or, as in my case : 30 seconds, booting my tv is really slow)...
  • phil_sphil_s Member
    ok, i am not alone: see discussion in the appstore
    https://apps.athom.com/app/com.lg.smarttv

    but nevertheless: great work @jorden ;
  • Maybe there is some help here?

    http://developer.lge.com/webOSTV/api/

    I would help to search but i don't know where too
  • jordenjorden Member
    Just released a small update to Github, and submitted to app store (not approved yet). This update will make sure "ErrorUndefined" during pairing will show more information. Perhaps that way we can manage to fix this.
  • phil_sphil_s Member
    great @jorden that you don't give up ;-)
    i will test when i'm home!
  • phil_sphil_s Member
     :s 
  • jordenjorden Member
    At least now we know the 'undefined'  is a connection refused message. Next thing is trying to find out why... Is it a setting that needs to be enabled, or a different port to connect to, or is this is a version of the TV that is simply not supporting this... 
  • bvdbosbvdbos Member
    @phil_s : what version of Homey are you running?
  • phil_sphil_s Member
    edited June 2016
    @phil_s : what version of Homey are you running?
    0.8.32 last stable release
  • phil_sphil_s Member
    edited June 2016
    @jorden i just installed the "LG TV Plus" App on iOS. the app pairs perfectly with the tv.

    the tv displays a pin (three numbers) for pairing and it works.
    doesn't this say that the procedure of pairing with numbers works normaly?
  • phil_sphil_s Member
    edited June 2016
    when i look at my screenshots and on the screenshot of the others here then i realise that my portnumber of my tv in the log is every time another an a big one (36029, 53584 right above in scrennshot etc.!) but from my hue and from all others here where it works the portnumber is always 1900!

    what does it mean?
  • phil_sphil_s Member
    is there nobidy who can help with the 'errorindefined' problem?

    there are more people having this problem like me. the comments in the appstore show some people with the same problem.

    but @jorden can't reproduce this because he has no LG TV.
  • @phil_s ; I wanna help but I Cannot reproduce the problem. 
  • phil_sphil_s Member
    mbalik79 said:
    @phil_s ; I wanna help but I Cannot reproduce the problem. 
    Thank you @mbalik79 ;
  • tim1990 said:
    @jordan Most used app my tv is netflix. Is it possible to add the command directly?

    system.launcher/launch

    Start an app.

    Example: lgtv.request('ssap://system.launcher/launch', {id: 'netflix'});

    @jorden would you maybe look at this?  Think more poeple Will love it! 
  • bvdbosbvdbos Member
    @jordan: the econnrefused may be solved by using http.min.js instead of request.js (issue)

  • tim1990 said:
    tim1990 said:
    @jordan Most used app my tv is netflix. Is it possible to add the command directly?

    system.launcher/launch

    Start an app.

    Example: lgtv.request('ssap://system.launcher/launch', {id: 'netflix'});

    @jorden would you maybe look at this?  Think more poeple Will love it! 
    @jorden i would love that
  • jordenjorden Member
    @tim1990 That is not possible with this library.

    @BasVanDenBosch I doubt it. I think that the people that have this problem, have a TV that uses a different system and therefor it doesn't work.
    I actually don't use request.js, that is a file that is there as an example (it is the original file that was used to control LG TV's using Node.js). 
    I use the http library in NodeJS for pairing.
  • phil_sphil_s Member
    @Emile do you have an idea for this problem how to fix it? @jorden made a great job sofar, but for some people like me it won't work. -> econnrefused

  • jeroenbos22jeroenbos22 Member
    edited June 2016
    I don't think its a connection problem, I think its a version problem. In this app authentication xml looks like:

    <?xml version="1.0" encoding="utf-8"?>
    <auth><type>AuthKeyReq</type></auth>

    While the documentation on LG UDAP 2.0 states its got to be:

    <?xml version="1.0" encoding="utf-8"?>
    <envelope><api type="pairing"><name>showKey</name></api></envelope>

    (more info: http://developer.lgappstv.com/TV_HELP/index.jsp?topic=%2Flge.tvsdk.references.book%2Fhtml%2FUDAP%2FUDAP%2FPairing.htm)

    If I try the last one it works on my 42LW5500-ze, with the currect app I also get error 400. Hope @jorden can also implement this :blush: 


  • jeroenbos22jeroenbos22 Member
    edited June 2016


  • jordenjorden Member
    @jeroenbos22 and @phil_s and @mbalik79 and others using this app... can you all please try to figure out which version of (web?)OS your TV has, and let me know which version works, v1 or v2?

    Perhaps it is possible to find a way to see which kind of TV's support the first, and which support the second. And then build that in.

    I have added a new version to Github at https://github.com/jordenc/com.lg.smarttv so perhaps you all can try if this works? There is a v2 button in the pairing window now, and the v1 now has a 'v1' tag (that's the old version of requesting the pairing key).
    Probably also the sendcommand function will need changes for people for which the v2 works.

    @jeroenbos22 Good find!
  • https://postimg.org/image/fyg2cqvo1/

    Don't know if it helps. Because you didn't asked but more info helps i think. App works fine. i have a 42lm620s
Sign In or Register to comment.