Issue with LG smart tv

I’m able to turn my LG TV on and off from the device’s settings page in the Hubitat user interface.

Interesting. I used a WOL app on my phone that I use for my PC's, and it woke the TV up and turned it on.

So I suppose I could add WOL to Hubitat, but I'd much rather just have the TV device work properly.

In either case, how do I use my LG TV device in automations? I want to push a button and have the TV turn on and go to a specific input, depending on the button pushed. But I couldn't figure out how to do it.

I have 2 2023 LG C3 TVs and would like to set this up. I used HPM to load Syepes discovery. It does find the TVs but when i look at the device and try initialize, nothing seems to happen. I seem to be missing a step. TV on with WIFI and BT are both set to on.

Never seems to get pairing key. is there a way to force or find the key?

Thanks for help!

1 Like

You can use the Button Controller app to turn a TV on and set the input. “On” is a switch action, and setting the input can be done under “custom actions.”

However, I’d suggest first trying to get the TV to function as intended directly from its Hubitat device page.

How did you add the device driver? Was it one of the updated versions posted earlier in this thread?

If you read above in this thread, you’ll see it no longer works without making an update to the driver code manually. With the update to enable secure websockets, it should still function.

Thanks that did fix it.
I did copy the first one back in the list and it had some errors. I went a couple back from that and no errors.
It is working now!!

1 Like

I went to Driver code, clicked New driver, and pasted the code from earlier in this thread. I don't remember which version I copied, though. The error with the additional parenthesis was throwing me off for a bit. Maybe I'll try updating the code.

I looked at the button controller rules, and I'm confused. Is setting the input an HTTP request? When I choose custom action, run custom action, it just gives me a big long list of stuff that I don't know how to relate to the TV device.

I tried to add a picture to this, but it gives me an error...

Looking at the live logs, this is what shows when I click the On button in the device page:

dev:33 2024-03-13 09:45:26.620 PMinfoLiving Room TV powerEvent() - is off [physical]
dev:33 2024-03-13 09:45:26.618 PMinfoLiving Room TV webSocketStatus() - WebSocket is closed
dev:33 2024-03-13 09:45:23.547 PMinfoLiving Room TV initialize() - Connecting secure websocket to: wss://192.168.0.38:3001/
dev:33 2024-03-13 09:45:23.545 PMerrorLiving Room TV getMouseChild() - Failed to get mouse dev: com.hubitat.app.exception.UnknownDeviceTypeException: Device type 'LG WebOS Mouse' in namespace 'syepes' not found
dev:33 2024-03-13 09:45:10.364 PMinfoLiving Room TV on() - Sending Magic Packet to: 48:8D:36:F2:B1:05
dev:33 2024-03-13 09:45:10.351 PMinfoLiving Room TV powerEvent() - is on [digital]

Is there a way to manually add the Mac and IP instead of doing the discovery? I only ask because my habitat and my TV are not on the same vlan.

@mo.hesham When I paste your code I get this error

expecting '}', found ')' @ line 331, column 87.