LGWebOS Binding - sendButton() question

Third time’s a charm :slight_smile:
New PR: Added rcButton channel #6640

Hi @rbrodt, Thanks for this feature

excuse me not sure to have understood from where can i download the jar file?

Hi guys,

did you face the issue of not working “OK” button? I’ve tested almost all buttons - back, home, arrows, all smooth but the “OK” button doesn’t work for me :confused:

This is my log:

2020-01-09 01:05:40.783 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - WebSocket Closed - Code: 1006, Reason: Failed to open local endpoint
2020-01-09 01:05:41.708 [INFO ] [lipse.smarthome.model.script.actopms] - org.openhab.binding.lgwebos.action.LGWebOSActions@7d2752
2020-01-09 01:05:41.728 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - Connecting to: ws://192.168.0.200:3000/resources/bd64b5c01c284d505798cfbe9733202e6877a1e6/netinput.pointer.sock
2020-01-09 01:05:41.746 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - WebSocket Connected to: /192.168.0.200
2020-01-09 01:05:41.750 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - Message [out]: type:button
name:DOWN
2020-01-09 01:05:41.760 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - WebSocket Closed - Code: 1006, Reason: Failed to open local endpoint2020-01-09 01:06:11.619 [INFO ] [lipse.smarthome.model.script.actopms] - org.openhab.binding.lgwebos.action.LGWebOSActions@7d2752
2020-01-09 01:06:11.647 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - Connecting to: ws://192.168.0.200:3000/resources/bd64b5c01c284d505798cfbe9733202e6877a1e6/netinput.pointer.sock
2020-01-09 01:06:11.689 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - WebSocket Connected to: /192.168.0.200
2020-01-09 01:06:11.695 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - Message [out]: type:button
name:UP
2020-01-09 01:06:11.711 [DEBUG] [nternal.handler.LGWebOSTVMouseSocket] - WebSocket Closed - Code: 1006, Reason: Failed to open local endpoint
2020-01-09 01:07:12.272 [INFO ] [lipse.smarthome.model.script.actopms] - org.openhab.binding.lgwebos.action.LGWebOSActions@7d2752

At 01:06:11 I’ve clicked UP and worked. A minute later at 01:07:12 I pressed OK and just one row of logs is here.

My rules implementation is here:

`rule “ButtonOK”

when Item LG_TV0_Arrows received command

then

val actions = getActions("lgwebos","lgwebos:WebOSTV:87ec07d2-5a78-91a6-531f-405bb6a8df99")

logInfo("actopms",actions.toString)

switch receivedCommand{

    case "UP": actions.sendButton("UP")

    case "OK": actions.sendButton("ENTER")

    case "DOWN": actions.sendButton("DOWN")

    default: logInfo("ButtonOK - Command", receivedCommand, "is not supported" )

}

end`

and this is event.log

2020-01-09 01:05:41.690 [ome.event.ItemCommandEvent] - Item ‘LG_TV0_Arrows’ received command DOWN
2020-01-09 01:06:11.598 [ome.event.ItemCommandEvent] - Item ‘LG_TV0_Arrows’ received command UP
2020-01-09 01:07:12.252 [ome.event.ItemCommandEvent] - Item ‘LG_TV0_Arrows’ received command OK

Can you check it please?

The jars can be found here:

https://drive.google.com/drive/folders/1mynG60cnLLQnbNEj1bxcMY8KNMGv1G8y?usp=sharing

Let me know if you have trouble getting access to this folder

1 Like

Hi @majusenko,

The sendButton(“ENTER”) action is actually diverted to the sendText() method which is a keyboard command and is the same as pressing “ENTER” on a paired keyboard.

This is different from the actual sendButton(“ENTER”) and the main reason why I added the new “rcButton” channel.

Try removing this rule and use the “rcButton” channel instead. See the sample HABPanel remote control widget found in this github repository.

Hi @sprehn and Happy New Year! :slight_smile:

I tried rebasing, but there are waaaaay too many conflicts for my comfort level. I’m going to create a new fork, add my changes, and create a new PR.

I’m still a bit confused though - should I be using the default branch (2.5.x) from openhab-addons or the master branch, or should I create a feature branch?

Thanks!
Bob

Hello Robert,

thanks for your answer but It doesn’t work for me. I checked the updated binding and there is already new rcbutton channel but without the example.

I’ve created item:
String LG_TV0_IRCode "IRCode" { channel="lgwebos:WebOSTV:xxxxxx:rcButton"}
and rule

rule "ButtonOK"
when Item LG_TV0_Arrows received command
then
    switch receivedCommand{
        case "UP": LG_TV0_IRCode.sendCommand("UP")
        default: logInfo("ButtonOK - Command", receivedCommand, "is not supported" )
    }
end

I tried several variants like sendButton, sendText. I even tried to dig into the binding itself and used some methods like “sendRCButton” but it was more try&hope mode :slight_smile:
And since there is no example of usage I am not sure if it’s a problem on my implementation or in my TV since you wrote it’s tested on one model only.

Btw. is it poossible to update somehow frequencies in binding? Or to give it as config param? I should be able to find the frequencies by myself with my arduino kit + rf receiver and if it’s different then your tested model it would be very helpful to be able to update it.

Hi @rbrodt, thank you for implementing the “rcButton” channel, it’s working flawlessly on my OLED 55E6.
My question: is this channel meanwhile part of the LGWebOS binding within the OH 2.5.x snapshot (or rather planned to be)?
I would like to know if this channel breaks when I switch to the newest OH snapshot.

Regards,
Andy

Hi Marián,

I’ve tried all possible solutions as you, but none of them worked for me as well. All navigation buttons except OK and ENTER works.
OpenHab: v2.4.0
TV: LG OLED55B8PLA

Regarding HabPanel widget: also not working for me, only Settings, Home, ScreenSaver buttons.

Thanks guys for rcButton channel!

Here is the code that worked for me (OH 2.5, Webos 04.30.70):
Items:
String LG_TV0_RCButton "RC Button" { channel="..."}
And on HabPanel:
Set up a Button with such configs:
Action type Send a fixed command to an item
openHAB Item LG_TV0_RCButton
Command value ENTER

Channel itself was created automatically on setup. Just added an item.

Dear All,

thanks from end as well for the rcButton channel. Maybe you guyes can help me with the following: I desperately look for a way the red pointer to appear on the TV screen (basically as one would spin the whell on the magic remote control).

Does anyone have an idea?

Thanks in advance for any comments, hints, etc

Thx, Roc

Dear Anyone still on old WebOS?
Any idea how to send keyboard button F11? This would make a full screen browser on WebOS. Usefull button may follow immediatelly after habpanel started on TV. Minus some margin px on the top would save extra line for widgets on bottom :frowning: