LGWebOS Binding (for LG WebOS TVs)

Hi,

I’m testing the version 2.5.0 Snapshot so I can avail the latest functionalities from the LG webOS bindings and trying to pass the Up, Down, Left, Right, etc. keys, but getting a warning message and the keys don’t work.

2019-11-25 19:51:49.464 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/LGWebOSTVUJ634VArrows' with an invalid status value '0'.

on my .sitemap I have

		Switch item=LGWebOSTVUJ634VArrows label="Select" mappings=[0="Up", 1="Down", 2="Left", 3="Right"] icon="movecontrol"

and on the rules:

rule "LGControlSelect"
when Item LGWebOSTVUJ634VArrows received command
then
    val actions = getActions("lgwebos","lgwebos:WebOSTV:02997059-4172-8985-10a4-f07c879fbf4c")
    if(null === actions) {
        logInfo("actions", "Actions not found, check thing ID")
        return
    }

    switch receivedCommand{
        case 0: actions.sendButton("UP")
        case 1: actions.sendButton("DOWN")
        case 2: actions.sendButton("LEFT")
        case 3: actions.sendButton("RIGHT")
    }
end

But the rule is never executed. What am I doing wrong here?

Thanks,
Mike

I am having this exact same issue. My log viewer shows

Actions not found, check thing ID

this issue does not seem related to the binding but rather to the type of your item. it does not like 0 as a value. is the item of type number?

this is a different issue. please check the thingId provided in your rule corresponds to the thingId of your TV as shown in paperui

The thingid in Paper ui matches the thingid in my rule.

Here is my item.

Number LGTVKeyNavigationDummy

Here is my rule.

rule "LG TV Key Navigation"
when Item LGTVKeyNavigationDummy received command
then
    val actions = getActions("lgwebos","lgwebos:WebOSTV:088e58e6-d74c-4aae-bfaa-1e46281b1d85")
    if(null === actions) {
        logInfo("actions", "Actions not found, check thing ID")
        return
    }

    switch receivedCommand{
        case 0: actions.sendButton("UP")
        case 1: actions.sendButton("DOWN")
        case 2: actions.sendButton("LEFT")
        case 3: actions.sendButton("RIGHT")
    }
end

Here is my sitemap.

Switch  item=LGTVKeyNavigationDummy  mappings=[0="LEFT", 1="DOWN", 2="UP", 3="RIGHT"]

Here is the error I keep receiving in the log viewer.

2019-11-28 10:24:43.158 [INFO ] [lipse.smarthome.model.script.actions] - Actions not found, check thing ID

Any thoughts?

Thank you.

and what is our thing ID in paper ui for this device?

lgwebos:WebOSTV:088e58e6-d74c-4aae-bfaa-1e46281b1d85

hm, then maybe restart openhab… I have not other idea - this has been working stable for quite some time now. no change on that front in the recent updates.

Ok. Thank you for your help. I rebooted my Raspberry Pi and that didn’t work. Do you think reinstalling OpenHAB all together would help? Otherwise I’ll do a workaround with my Harmony remote.

Thanks again!

Maxwell

I don’t think there is a need to re-install OH.
I would suggest to check the log and see if there are any debug messages. The documentation of the binding describes how to enable debug logging via karaf.

Yeah, had it defined as a Switch instead of Number :man_facepalming:

Only problem I have now is the keys that seem not correct. Down works fine, but Up, Left and Right don’t and seem to be triggering other actions. Need to test this further.

I’ve have a strange situation with this binding.
When I turn the TV off with the remote it take for about 5 minutes before openhab changes the “tv power” item to the state OFF. I read here that this is normal behaviour.

The problem is now that when a “OFF” command is send to the “tv power” item in this 5 minutes timeframe, the TV sometimes turns ON again? Why is this happening when sending a “OFF” command?

I use this rule:

rule "TV room OFF (with Nikobus button)"
	when
		Item BP24_2D_L received update ON
	then			
		RGBW_TV_RGB.sendCommand(OFF)
		if (LG_TV_TVroom_Power.state == ON) {
			LG_TVroom_Power.sendCommand(OFF)
		}
	end

So when I turned my TV OFF with the remote and this rule gets executed sometimes the TV turns back ON?

Any idea what the problem could be?

I have a problem:

if I use lgwebos binding on openhab installed on pc everything is ok
if I use lgwebos binding on openhabian installed on raspberry it work only first time (when I power on again the TV this binding do not work)

I see that binding configuration of thing on PC is host and key…
on raspberry only deviceid can be configured

openhabian seems to be in older version

1 Like

just wanted to share my super easy rule to change tv channel using Google Assistant,
I used to do it with IFTTT, but now that IFTTT cant connect with openHab anymore, here is an even better easy solution.

Have an item as DIMMER named “channel” (or your own language version) with [“lighting”] tag

Dimmer Tv_channel    "channel"    ["Lighting"]

And the rule:

rule "Change TV channel"
when
    Item Tv_channel changed
then
    var channelNo = Tv_channel.state.toString
    LG_TV0_ChannelNo.sendCommand(channelNo)

now just say “hey google, channel 12” and it’ll instantly change to the desired channel :slight_smile:

1 Like

Great! Default version on openhabian is “stable” version so 2.4, I force to 2.5 and everything is ok. thank you for your AMAAAAAZING work

I have the same problem. Did I understand correctly that the upgrade to openhab 2.5 helped?

Official manual tells me to put it into the things:

Thing lgwebos:WebOSTV:tv1 [host="192.168.2.119", key="6ef1dff6c7c936c8dc5056fc85ea3aef"]

Could you help me figure out where to get this key?

On the TV screen, with paperui when you add the bidding

1 Like

I have to bring this up again: Currently, I cannot switch the TV on (via WOL) once it was switched off by the remote control.

Is this the desired behavior?