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
I've just set this up and it was so simple to do, thanks @dandanache
Tested on LG OLED55G36LA 55"
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!
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.
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.
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 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!
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.
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