LGWebOS Binding (for LG WebOS TVs)

How do you send a toast without image data? In my reading of the docs, it seems to me that if an image is not specified, a default image is sent.

If you exclude the ‘iconData’ and ‘iconExtension’ parameters in the request to the television the television will default to the little chat message icon, but this icon is from the TV itself. It has no problem handling it.

the binding will send the openhab logo per default when triggered via message to toast channel. please experiment with the showToast(icon,text) action in which you can set your own icon.

@sprehn And what about API ? Unfortunately the documentation does not clear on how to use the actions.sendButton("OK")command with API. could you please advise on which API url should be used and how the body should look like ? Thanks!

hi

pls check the example under Rule Action

https://www.openhab.org/addons/bindings/lgwebos/

it shows how to obtain the reference to the actions instance in rules.

no api or url required

please experiment with the showToast(icon,text) action in which you can set your own icon

As @rjbouch mentioned, iconData & iconExtension should be excluded in the request.
But it looks like the binding does not support that, Either it sends the default icon or it requires a valid url to a icon.

@sprehn: is it possible to modify the binding to not send iconData & iconExtension ?

I think that should be possible.

Pull Request is #5966

actually finally found some time :slight_smile:

Hi,

would like to inform the community that I am working on a complete rework of this binding.
Have already removed completely connectsdk library and with that a lot of abstraction layers.
Now this binding will natively communicate with the device and use openHABs on-board means to do UPNP discovery, JSON parsing, websocket communication etc… Tonight I was able to connect and control basic functionality on my local TV.

Changes:

  • Removing the ability to set the local ip. UPNP discovery will rely on OHs on-board UPNP discovery. IP can be set in system settings.
  • ipAddress becomes a configuration parameter. So if UPNP discovery does not work, or users don’t want to use it, this binding should still work. ipAddress will be updated by UPNP if ThingID uses the generated one. This is standard OH behavior. If anybody prefers to set Things up manually (e.g. via file or UI) any Thing ID will do. If the thing ID is different to the one discovered by UPNP ipAddress config parameter won’t be updated.
  • detecting whether device is Online or Offline is now independent from UPNP discovery and based on network connectivity
  • no more lgwebos userdata in the file system to store device information. Using openHAB’s thing registry to store all information.

For anyone interested, development is ongoing on this branch:

3 Likes

Thank you Sebastian :slight_smile: any chance to get pre-release version? I have 3 LG tvs…with webos 2.x, 3.x and 4.x

absolutely
just need to finish at least basic testing for all features.
i’ll publish a link shortly, maybe tonight

First Community Beta Test Candidate released: lgwebos-2.5.0-snapshot-201908262331

2 Likes

there will be a warning about weak ciphers used in the log.
It seems the device does not support any non-weak ones, so I enabled all. I need to find how this can be improved and limited to a minimum of weak ones.

Have tested my device’s SSL capability, and it is not performing well at all:
SSL Server Test_ WebOS.pdf (228.2 KB)
OS Release Version 2.2.1, Device OS 4.1, Software Version 4.5.85

Of course, the certificate is self signed and we simply have to trust it, so it will not prevent any man in the middle attack.

It does not support TLS 1.3 and only uses weak cipher suites. This is something which could change in the future with an update, but I doubt that this going to happen.
I could enable some of the weak ciphers, but it will result in a warning in the log. I doubt that in our home environment and for the un-sensitive data we are passing encryption is really required.

NOTE: The only security relevant data could be the client-key. If somebody on the network steals it, he could also connect to the TV’s API.

Thus, I will rework this now to not use encryption (https) and use plain unencrypted communication (http).

Does anyone have any doubts, recommendations, thoughts?

1 Like

Hi i have a problem, when i turn off the tv the status on openhab change to off and then immediatly goes back on, i tried to figure out what’s going on looking at the logs but i haven’t found anything.

I assume you use lgwebos-2.5.0-snapshot-201908262331
does the TV turn off and will it eventually show off in OH? So, just a temporary inconsistency?

I am seeing something similar. If I simply power on or off the “bouncing” of the switch doesn’t cause any negative effects. However, I have a “good night” routine that I run that does various things including turning off the TV via my Harmony Hub “Power Off” rule. If I manually turn off the TV (using the Harmony Remote) and then press the good night button, the TV will turn back on. I believe the switch will toggle even though the TV is off already which sends another WOL command turning the TV back on.

Here are my rules:

rule "Harmony Hub LR - Power Off"
when
    Item HarmonyHubLR received update
then
     if (HarmonyHubLR.state == "PowerOff" ) {
		sendCommand(LG_TV0_Power, OFF)
		sendCommand(zone1Power, OFF)
		sendCommand(LG_TV1_Power, OFF)
		sendCommand(Audio_Zones_Amp_14PR, OFF)
}
end
rule "Good Night Button Extension"
when
    Item GdNght_Flag received update
then
    sendCommand(Lights_FamilyRoom_Angie_LampZWave, OFF)
    sendCommand(Lights_FamilyRoom_Steve_LampZWave, OFF)
    sendCommand(MiscZwaveSwitch, OFF)
    postUpdate(HarmonyHubLR, "PowerOff")
    sendCommand(ZnAllState, OFF)
    sendPushoverMessage(pushoverBuilder("Good Night!"))
end

i’m using the 2.4.0 version and i checked this morning and now it’s working fine…however it was a temporary inconsistency, thank you for your reply and sorry for the inconvenience.

Hi @Roberto2
Hi @HaKuNa
All

any feedback regarding this beta version. I would like to start the pull request to go through code review.

1 Like