LG webOS new UID generated after every WOL command

I have 4 LG TVs with WebOS. The sending of a WOL command to turn the TV on works but then it wont turn off with the Power command and I see that it has generated a new INBOX entry with a new UID. TV ignores the turn off command.

LOG:
2019-10-08 12:20:36.738 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'lgwebos:WebOSTV:7722f090-5a1a-4a17-a15e-1330a6f7932f' to inbox.
2019-10-08 12:44:07.538 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power On
2019-10-08 12:44:08.377 [INFO ] [nhab.binding.wol.internal.WolBinding] - Wake-on-LAN packet sent [broadcastIp=192.168.25.255, macaddress=a823fe9d2146]
2019-10-08 12:45:03.168 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off

ITEMS:
Switch   PBATV1_SWITCH "POWER SWITCH FOR TV1"  (PBAtv)
Switch   PBATV2_SWITCH "POWER SWITCH FOR TV2"  (PBAtv)
Switch   PBATV3_SWITCH "POWER SWITCH FOR TV3"  (PBAtv)
Switch   PBATV4_SWITCH "POWER SWITCH FOR TV4"  (PBAtv)

Switch   PBATV1Power   "TV1 Power"    {channel="lgwebos:WebOSTV:93d6e248-596d-40b2-bf27-2f93e0c70c1b:power"}
Switch   PBATV2Power   "TV2 Power"    {channel="lgwebos:WebOSTV:c9bd12f1-9313-4903-b117-bb58460250cc:power"}
Switch   PBATV3Power   "TV3 Power"    {channel="lgwebos:WebOSTV:3670e8fa-33e6-45cf-b1de-857ec1d3f7bf:power"}
Switch   PBATV4Power   "TV4 Power"    {channel="lgwebos:WebOSTV:6947719a-7e95-4e3d-b463-a9758d69780d:power"}

Switch   PBATV1_WOL         { wol="192.168.25.255#A8:23:FE:9D:21:46" }   
Switch   PBATV2_WOL         { wol="192.168.25.255#A8:23:FE:CC:11:0C" } 
Switch   PBATV3_WOL         { wol="192.168.25.255#A8:23:FE:7D:98:DC" } 
Switch   PBATV4_WOL         { wol="192.168.25.255#A8:23:FE:C8:85:2E" } 

RULES:
rule "Power on LGvTV1 via WOL"
when 
    Item PBATV1_SWITCH received command 
then
    if (receivedCommand == ON) {
        sendCommand( PBATV1_WOL, ON ) 
        logInfo("LG.rules", "TV1 Power On") }  
    else {
        sendCommand( PBATV1Power, OFF )
        logInfo("LG.rules", "TV1 Power Off") }  
end

THINGS:
Thing  lgwebos:WebOSTV:tv1  "PBA TV1" [ deviceId="93d6e248-596d-40b2-bf27-2f93e0c70c1b" ] 
Thing  lgwebos:WebOSTV:tv2  "PBA TV2" [ deviceId="c9bd12f1-9313-4903-b117-bb58460250cc" ]
Thing  lgwebos:WebOSTV:tv3  "PBA TV3" [ deviceId="3670e8fa-33e6-45cf-b1de-857ec1d3f7bf" ]
Thing  lgwebos:WebOSTV:tv4  "PBA TV4" [ deviceId="6947719a-7e95-4e3d-b463-a9758d69780d" ]

openhab.log:
2019-10-08 12:54:10.241 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'lgwebos:WebOSTV:71060ba7-2644-4bf1-95c6-b9f7f5f263d5' to inbox.

Running openhab 2.4

Follows on from here

Note that a 2.5 version binding - with a new discovery process - is in development.
Maybe you should try that out.

Yes, the file exist but only has {} in it. Check permissions but it has no restrictions.
Where can I get the new addons 2.5

Install Openhab Milestone Build … than you have the 2.5 Binding … or wait until Dezember … that’s the Timeline for 2.5 release …

You also can build the Binding from Source Code … but that’s no guarantee that the 2.5 Bindung works with openhab 2.4

Installed milestone 2.5 but still have the same issue. every time it does a WOL command to turn on the TVs or a stop/start of the openhab service it does a discovery and brings new uid for the TVs, and then the power off command is ignored. is there a way to stop discovery so a new uid is not assigned.

2019-10-09 14:38:18.451 [ome.event.ItemCommandEvent] - Item 'PBATV4_WOL' received command ON
2019-10-09 14:38:18.452 [ome.event.ItemCommandEvent] - Item 'PBATV2_WOL' received command ON
2019-10-09 14:38:18.452 [ome.event.ItemCommandEvent] - Item 'PBATV3_WOL' received command ON
2019-10-09 14:38:18.452 [ome.event.ItemCommandEvent] - Item 'PBATV1_WOL' received command ON
2019-10-09 14:38:21.800 [vent.ItemStateChangedEvent] - PBATV4_WOL changed from NULL to ON
2019-10-09 14:38:21.800 [vent.ItemStateChangedEvent] - PBATV2_WOL changed from NULL to ON
2019-10-09 14:38:21.800 [vent.ItemStateChangedEvent] - PBATV3_WOL changed from NULL to ON
2019-10-09 14:38:21.800 [vent.ItemStateChangedEvent] - PBATV1_WOL changed from NULL to ON
2019-10-09 14:38:23.484 [home.event.InboxAddedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:58c8dfba-d22c-4c9f-a4aa-283472e5f42a' has been added.
2019-10-09 14:38:25.091 [home.event.InboxAddedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:1e6de62d-bb45-489e-962c-afa63039b0bc' has been added.

There’s more than one of those … M3 perhaps?

As per the linked thread, binding development is active and the latest will not be in M3, you would have to manually add it. I do not know how you get a .jar file,

I’ve no idea if this would help with your problem.

Hi, I downloaded the latest M3 for windows.
I thought the binding would be in the 2.5 addons links that are downloads along with the M3.
Would not know how to get or install the jar.
Does anyone know how discovery works. specially for the WebOS binding.
or how does the \userdata\lgwebos\StoredDevices is supppose store the definitions or what it does.

HELP!!
Reinstalled fresh M3 version. The issue with a new UID discovery after a WOL to turn on the TV persists. Consequently the Power off command is ignored, have to turn the TV off manually.

THING:
Thing  lgwebos:WebOSTV:tv1  "PBA TV1" [ deviceId="627f2990-787a-4e8c-b241-49cad7e3b697" ] 

ITEMS:
Switch   PBATV1_SWITCH "POWER SWITCH FOR TV1"  (PBAtv)

Switch   PBATV1Power   "TV1 Power"   {channel="lgwebos:WebOSTV:627f2990-787a-4e8c-b241-49cad7e3b697:power"}
Switch   PBATV1_WOL         { wol="192.168.25.255#A8:23:FE:9D:21:46" }   

RULE:
rule "Power on LGvTV1 via WOL"
when 
    Item PBATV1_SWITCH received command 
then
    if (receivedCommand == ON) {
        sendCommand( PBATV1_WOL, ON ) 
        logInfo("LG.rules", "TV1 Power On") }  
    else {
        sendCommand( PBATV1Power, OFF )
        logInfo("LG.rules", "TV1 Power Off") }  
end

EVENTS.LOG
2019-10-15 10:55:00.135 [nt.ItemStatePredictedEvent] - PBATV1Power predicted to become NULL
2019-10-15 10:55:00.139 [vent.ItemStateChangedEvent] - PBATV1Power changed from NULL to OFF
2019-10-15 10:55:05.361 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command ON
2019-10-15 10:55:05.361 [nt.ItemStatePredictedEvent] - PBATV1Power predicted to become OFF
2019-10-15 10:55:21.886 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-15 10:55:21.886 [nt.ItemStatePredictedEvent] - PBATV1Power predicted to become OFF
2019-10-15 10:59:44.737 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command ON
2019-10-15 10:59:44.737 [nt.ItemStatePredictedEvent] - PBATV1Power predicted to become OFF
2019-10-15 11:02:30.967 [ome.event.ItemCommandEvent] - Item 'PBATV1_SWITCH' received command ON
2019-10-15 11:02:30.969 [vent.ItemStateChangedEvent] - PBATV1_SWITCH changed from NULL to ON
2019-10-15 11:02:31.258 [ome.event.ItemCommandEvent] - Item 'PBATV1_WOL' received command ON
2019-10-15 11:02:32.107 [vent.ItemStateChangedEvent] - PBATV1_WOL changed from NULL to ON
2019-10-15 11:02:35.984 [home.event.InboxAddedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:ee37b14e-5671-4aa5-afbd-d795647264ab' has been added.
2019-10-15 11:02:50.731 [ome.event.ItemCommandEvent] - Item 'PBATV1_SWITCH' received command OFF
2019-10-15 11:02:50.734 [vent.ItemStateChangedEvent] - PBATV1_SWITCH changed from ON to OFF
2019-10-15 11:02:50.736 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-15 11:02:50.737 [nt.ItemStatePredictedEvent] - PBATV1Power predicted to become OFF
2019-10-15 11:07:28.495 [me.event.InboxRemovedEvent] - Discovery Result with UID 'lgwebos:WebOSTV:ee37b14e-5671-4aa5-afbd-d795647264ab' has been removed.

OPENHAB.LOG
2019-10-15 11:02:31.262 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power On
2019-10-15 11:02:32.107 [INFO ] [nhab.binding.wol.internal.WolBinding] - Wake-on-LAN packet sent [broadcastIp=192.168.25.255, macaddress=a823fe9d2146]
2019-10-15 11:02:35.984 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'lgwebos:WebOSTV:ee37b14e-5671-4aa5-afbd-d795647264ab' to inbox.
2019-10-15 11:02:50.732 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off

I think here is your Problem … no Devices stored … when it goes off/on a new Discovery starts… and you became a new ID… and your Rules don’t work.

What Permissons are set? Show us -> ls -lah

You’ve seen this post? You’ve not mentioned pairing.

1 Like

It’s a windows 10 machine. I set user: “everyone, administrator” full control of directory and file.

Can someone send a sample of what should be in the file. maybe I can enter it manually and see if it stops the auto discovery.

Have you read the last Link ? There are Instructions how to add an LG TV … You need no File … you must add correctly the TV … please read the Link :slight_smile:

Sorry, what link?

OK, I reinstalled OH2 M3, did the discovery (inbox) and pairing through the PaperUI it created the entries in the json db. but it still ignores the power off command.
I am at a point of what next? now it doesn’t create the lgwebos directory. maybe I can find the raw command the binding sends and try to send it manually to see if it’s the TVs or OH2 that’s not working right.

Do you mean it works until the next power one, but then a new UID is generated?

You still don’t seem to have described any pairing actions at the TV.

1 Like

You really read this and done this?!?!?!?!

Ok, I have the same situation that the TV is not where the computer is. I’ll move to TV area and try to add it while I’m there. That makes sense.
Thanks…let you know how it goes.

Ok, Problem solved by pairing response when the message appeared on the TV screen. I now have 4 TV’s connected and working perfectly. Here is the code for any of you that need to see a working sample.

ITEMS:
// LG TV WEBOS  Items defenitions
// group control for all 4 tvs at once
Group PBAtv  "PBA-TVS"  <lgtv> 
.
// Group:Switch:OR(ON, OFF)  TVs      "All TVs [(%d)]"
.
Switch   PBATV1_SWITCH "POWER SWITCH FOR TV1"  (PBAtv)
Switch   PBATV2_SWITCH "POWER SWITCH FOR TV2"  (PBAtv)
Switch   PBATV3_SWITCH "POWER SWITCH FOR TV3"  (PBAtv)
Switch   PBATV4_SWITCH "POWER SWITCH FOR TV4"  (PBAtv)
.
Switch   PBATV1Power   "TV1 Power"   {autoupdate="false", channel="lgwebos:WebOSTV:1b60cf55-8be5-4c75-91fb-xxxxxxxxxxxx:power"}
Switch   PBATV2Power   "TV2 Power"   {channel="lgwebos:WebOSTV:cb57a57e-24f0-458a-9a81-xxxxxxxxxxxx:power"}
Switch   PBATV3Power   "TV3 Power"   {channel="lgwebos:WebOSTV:e0c46e5e-d561-481a-9da1-xxxxxxxxxxxx:power"}
Switch   PBATV4Power   "TV4 Power"   {channel="lgwebos:WebOSTV:e2a045c0-3c66-4321-xxxxxxxxxxxx:power"}
.
Switch   PBATV1_WOL         { wol="192.168.1.255#xx:xx:xx:xx:21:46" }   
Switch   PBATV2_WOL         { wol="192.168.1.255#xx:xx:xx:xx:11:0C" } 
Switch   PBATV3_WOL         { wol="192.168.1.255#xx:xx:xx:xx:98:DC" } 
Switch   PBATV4_WOL         { wol="192.168.1.255#xx:xx:xx:xx:85:2E" } 
.
RULES:
// Turn TV1 ON/OFF 
.
rule "Power on LGvTV1 via WOL"
when 
    Item PBATV1_SWITCH received command 
then
    if (receivedCommand == ON) {
        sendCommand( PBATV1_WOL, ON ) 
        logInfo("LG.rules", "TV1 Power On") }  
    else {
        sendCommand( PBATV1Power, OFF )
        logInfo("LG.rules", "TV1 Power Off") }  
end
.
//  Select HDMI-SWITCH input source  for TV1
rule "TV1 Select Input"
when 
    Item TV1Input received command 
then
    switch (receivedCommand) {
    case 0:   { sendCommand( HDMIswitch, "@T 00 00 #")  }   // PC
    case 1:   { sendCommand( HDMIswitch, "@T 00 01 #")  }   // DVD
    case 2:   { sendCommand( HDMIswitch, "@T 00 02 #")  }   // CableTV
    case 5:   { sendCommand( HDMIswitch, "@T 00 05 #")  }   // HDMI 1
    case 6:   { sendCommand( HDMIswitch, "@T 00 06 #")  }   // HDMI 2
    case 7:   { sendCommand( HDMIswitch, "@T 00 07 #")  }   // HDMI 3
    }
end
.  same for TV2, TV3, TV4
.
.
SITEMAP:
sitemap demo label="Ballroom"
{
	Frame label="LG_TV" {
        Switch item=PBAtv icon="tv" mappings=[OFF="Off", ON="On"] 
		Text label="LG TVs" icon="tv" {
           // Group item=TVs label="ALL TVs" 
        
            Frame label="TV-1" {
                Switch item=PBATV1_SWITCH 
                Switch item=TV1Input label="INPUT" mappings=[0="PC", 1="DVD", 2="Cable", 5="HDMI-1", 6="HDMI-2", 7="HDMI-3"]
                }
            Frame label="TV-2" {
                Switch item=PBATV2_SWITCH
                Switch item=TV2Input label="INPUT" mappings=[0="PC", 1="DVD", 2="Cable", 5="HDMI-1", 6="HDMI-2", 7="HDMI-3"]
                }
            Frame label="TV-3" {
                Switch item=PBATV3_SWITCH
                Switch item=TV3Input label="INPUT" mappings=[0="PC", 1="DVD", 2="Cable", 5="HDMI-1", 6="HDMI-2", 7="HDMI-3"]
                }
            Frame label="TV-4" {
                Switch item=PBATV4_SWITCH
                Switch item=TV4Input label="INPUT" mappings=[0="PC", 1="DVD", 2="Cable", 5="HDMI-1", 6="HDMI-2", 7="HDMI-3"]
                }
        }
	}
.
.

The TV’s were auto-recognized and placed in INBOX when added then the prompt to pair appeared on the TV screen. at that point replied [Yes] to accept with the tv remote and that was that…
Thanks a bunch for the help in my nubiness.

2 Likes