[RELEASE] LGTV with webOS

Thanks again @dandanache, I have the majority of this working.

One thing that doesn't seem to work is

http://[Hub IP Address]/apps/api/[Maker API App ID]/devices/[LG TV Device ID]/pushRemoteButtons/GUIDE?access_token=[security token]

I can press the guide button on my LG remote and the guide will display. However, the above command doesn't display the guide. Exit, Up, Down, Left, Right, Home, along with other simulated buttons I've tested all work. I just can't get the Guide button to work

Thanks again

I've just set this up and it was so simple to do, thanks @dandanache

Tested on LG OLED55G36LA 55" :+1:

I've been using Harmony remotes for 15+ years but my current Harmony Elite is becoming unbearably slow, taking upwards of 20 seconds to turn on the TV and switch activities. I'm happy using the standard LG remote as the shortcut buttons (hold 1,2,3....) allow me to basically sumulate Harmony Activities near enough once HDMI CEC is setup correctly. But, I still need something to turn the TV off in my Hubitat routine and this fixes that!

@jbasen have you enabled......

image

Guide worked for me once that was enabled

@dandanache, is there a way to default the TV to the Home screen when turned on? It currently goes to the last activity used.

1 Like

Thanks @rhodesda

Yes, I have enabled Simulate TV Remote. I appreciate your letting me know that the guide function worked for you. I'll have to dig in deeper to see why I'm having problems with that one command as all the others seem to work fine.
Thanks again

Can totally see why you'd want to do this, but it's not a function of the driver. At least I don't think it is. I'd suggest you use Rule Machine (or Node Red or ....) to perform these actions to the driver under your preferred circumstances.

If using RM, for example, you could trigger off TV Switch turning on, and have the action be getActivity. If you wanted to do last activity, you'd need to stuff that in a hub variable I would imagine when the TV was on last.

Make sense?

3 Likes

Hey, Dan, I've had your amazing driver working on all my LG WebOS TVs (7 TVs across two homes) since early this year, but I noticed recently the HE devices all stopped working, both sensing and actuating. I can't quite figure out why -- no significant changes to the TVs or my network. They all have static IP addresses and they all worked great with your driver originally.

What I notice is that I can turn the TV on -- either from your driver or from a separate Wake-on-LAN device, and that works. But the switch attribute in your driver remains "OFF" even though the TV is powered on. Issuing an Initialize or Refresh doesn't change this. So, every time I try to produce an event (change volume, select activity, turn it off), the logs show that the driver is receiving the event but ignoring it because the TV is off. Websocket attribute shows "Connecting" but it never changes, and the logs show the driver repeatedly trying.

Any thoughts on how I can better troubleshoot?

FWIW, I had some of my TVs set to automatically update the WebOS firmware and others not to. Usually, I prevent automatic upgrades for the obvious reason. But it was actually handy in this case to have made that mistake because I'm seeing these problems exist both for TVs on static WebOS versions as well as those that auto-upgraded. So I can safely rule out changes to the WebOS layer, I think.

Thoughts?

1 Like

That happened to me too, there is a problem somewhere in the code on how the "connecting" state is handled. My problem was fixed when I used "Initialize" (TV was on, dont know if this matters).

I'll try to find the time to look at the code, but I really dont like fixing bugs that I cannot reproduce on demand :smile: fortunately the code is quite small.

Yeah it's an odd one. When I use the remote to power on it always goes to the home screen. Also, I setup the LG ThinQ Alexa Skill yesterday so I can power on/off by voice (to replace my Logitech Harmony Alexa Skill), that also turns on at the last used activity. So it seems the power on of the remote is different to what the TV's API uses to power on, which makes sense as the remote uses IR for power on/off.

Good idea on the RM, I can just set it to 'Home' before power off. Assuming I can work out how to do that with a conditional action to check it's on first!

I think this should do it, will test later!

image

There is a TV setting to show Home on power on, but it only works when using the remote. I have it disabled, since my TV is on Live TV for 90℅ of the time.

d56265ca5ef2a591fa5b631e7f18039088fcda42

1 Like

Yeah mine is set to 'Home' but it seems the API you use (and the Alexa skill) always uses 'Recent Input'. I can work around it!

1 Like

Can you try the PROGRAM button? I see it listed in the source code - that I stole from somewhere :slight_smile:

I think I was seeing something similar recently. I don’t recall trying to reinitialize the connection with the TV on, so I’ll try that.

1 Like

Tried this, but it didn't improve behavior. @marktheknife, hbu?

Could you enable debug logging for the driver and share the logs after performing some actions on the device?

I just had a similar issue as above. I turned the TV on with the remote then waited until the device in HE showed that the switch was on, then tried some events and got this error

It worked the following try though

Released version 1.8.1 with the following possible fix:

Fixed

  • Fix situation where websocket remains in connecting status - @mluck

Have fun!