LG WebOS better integration

Hi @MaxvandeLaar, I’ve made a few changes and for me I can control my LG tv again. I’ve made a pull request for you to validate if the change also works on older models. If not, it might help you in creating a version which accomodate both connection methods. Just not sure what the best method would be to distinguish.

In WebOS.js:42

    this.lgtv = require('../lgtv2/lgtv2')({
	  url: `wss://${this.getSettings().ipAddress}:3001`,

In lgtv2.js:289

      client.connect(host, null, null, null, { rejectUnauthorized: false });
4 Likes

Hi @molensky thanks for doing all the heavy lifting here! I’ll have seen the PR and that looks good, just need to test it on my older TV as well. If that doesn’t work, we always have the option to create a new driver so users can choose between different WebOSs when adding a TV.

3 Likes

Awesome! I can confirm this works on my C2 OLED model too.

Now only waiting for a version that can work with my Homey Pro 2023. :face_with_hand_over_mouth:

Since a few days my TV (LG GX 2020) turning on or off isn’t detected anymore.
Sounds like the same problem as mentioned above here.
Is there a working solution/update?

Hi. How can I get my app to do this? #noob

Via CLI install, prior to that adjust the source code you download from GitHub - MaxvandeLaar/homey-webos-plus: Improved LG WebOS integration for Homey

:bulb: A planned restart of the LG Webos Plus app every night does the job for now! Then the TV is recognized the next day…

Thanks! I’ll give it a go.

Confirmed that the molensky-tweak works on my C2. Thanks to everyone :smiley:

1 Like

Any chance we can have this feature in an upcoming release? I would really like this, since the toast notification is only displayed for 5 seconds. A simple alert with only an OK button would be nice, even if it doesn’t report anything back to Homey.

How about an updated version of the app? Please I’m a noob wit no time :wink:
Same problem as above. 2022 tv, no pairing message…
@MaxvandeLaar

Thanks!

Did you previously used the Athom LG-app?

You can t connect both

I only have the ATHOM LG web-os? (V4.1.2) Is there another one?

Yes, the HCS version by Max is here: https://store.homey.community/app/com.maxvandelaar.webos-plus

It seems i have the same problem status here. (recent TV: CS6LA)
The app is only capable to switch the TV on, not off, nor other functions.
The polling function also works.
Hoping for a fix soon ! let me know if i can help @MaxvandeLaar.

FYI

@DominicVonk THANK YOU ! (hopefully now in right thread :wink: )

Anyway, HCS SDK3 is not ready yet, shall be possible to install it via CLI however (don’t have HP2023 yet)

1 Like

That’s great. Managed to control my 2022 OLED on Homey Pro 2023 again by combining @DominicVonk’s code with these fixes:

1 Like

Hi all, thanks for being so involved. I am progressing a bit slow with everything due to private live events. Second kid coming in soon and need to get the house in order on time.

Thanks for the PRs and patience! I just published the new WebOS LG app to the HCS and the latest version is also available on GitHub for those with a new Homey Pro as the HCS homey app is not ready yet.

https://store.homey.community/app/com.maxvandelaar.webos-plus If installed via the store, it should auto-update itself.

It is now written in SDK3 and uses the secure web sockets so I expect it to work for newer TV’s as well.
Along the way I also fixed some volume issues some users were experiencing (everyone really) and the media images now also work again.

2 Likes

Hi Max

hope you can delay it, ask your wife :wink: Just kidding…family first.

May I ask you, after the update, is re-pair required ? I got right after update - Device unavailable.
Using OLED55C8PLA
…strange, I had to enable Wifi on my TV and add device again. Without that, I got :

[err] 2023-03-17 11:40:38 [ManagerDrivers] [Driver:webos_plus] [Device:42f0e664-e7e1-4fc8-83ec-1098dc82e9ae] Error: connect EHOSTUNREACH 10.0.0.128:3000
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.0.0.128',
  port: 3000
}

Now it connects, just reports some error when offline

[err] 2023-03-17 12:18:52 [ManagerDrivers] [Driver:webos_plus] [Device:71b50a0b-596c-463e-a8cd-165fb87b573d] _handleResponse: ssap://system/turnOff Error: not connected
    at LGTV.send (/drivers/webos_plus/lgtv2/lgtv2.js:208:12)
    at LGTV.request (/drivers/webos_plus/lgtv2/lgtv2.js:193:10)
    at /drivers/webos_plus/webos/WebOSTV.js:271:17
    at new Promise (<anonymous>)
    at WebosPlusDevice._turnOff (/drivers/webos_plus/webos/WebOSTV.js:270:12)
    at WebosPlusDevice.toggleOnOff (/drivers/webos_plus/device.js:421:24)
    at WebosPlusDevice._onSetCapabilityValue (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Device.js:1:2140)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[err] 2023-03-17 12:18:52 [ManagerDrivers] [Driver:webos_plus] [Device:71b50a0b-596c-463e-a8cd-165fb87b573d] _turnOff: ssap://system/turnOff with result: undefined
[log] 2023-03-17 12:18:52 [ManagerDrivers] [Driver:webos_plus] [Device:71b50a0b-596c-463e-a8cd-165fb87b573d] toggleOnOff: TV turned off. Set capability onoff to false
[err] 2023-03-17 12:18:52 [ManagerDrivers] [Driver:webos_plus] [Device:71b50a0b-596c-463e-a8cd-165fb87b573d] Error: not connected
    at LGTV.send (/drivers/webos_plus/lgtv2/lgtv2.js:208:12)
    at LGTV.request (/drivers/webos_plus/lgtv2/lgtv2.js:193:10)
    at /drivers/webos_plus/webos/WebOSTV.js:271:17
    at new Promise (<anonymous>)
    at WebosPlusDevice._turnOff (/drivers/webos_plus/webos/WebOSTV.js:270:12)
    at WebosPlusDevice.toggleOnOff (/drivers/webos_plus/device.js:421:24)
    at WebosPlusDevice._onSetCapabilityValue (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Device.js:1:2140)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Works like a charm on the new Pro and 2022 OLED. :white_check_mark: