I have a group switch to turn on and off 4 tv’s and also have individual switches for each. when I press the group button all 4 switches go into a continuous loop turning each switch on and off. This also happens to each switch individually when pressed.
Rules:
// Turn TV1 ON/OFF
rule "Power ON LGvTV1 via WOL"
when
Item PBATV1Power received command
then
if ( receivedCommand == ON )
sendCommand( PBATV1_WOL, ON )
logInfo("LG.rules", "TV1 Power ON")
end
rule "Power OFF LGvTV1 "
when
Item PBATV1Power received command
then
if ( receivedCommand == OFF )
sendCommand( PBATV1Power, OFF )
logInfo("LG.rules", "TV1 Power Off")
end
**** I tried this alternate rule and it does the same thing
// Turn TV2 On/Off rules
rule "Power on LGvTV2 via WOL"
when
Item PBATV2Power received command
then
if (receivedCommand == ON)
sendCommand( PBATV2_WOL, ON )
else
sendCommand( PBATV2Power, OFF )
logInfo("LG.rules", "TV2 Power Off")
end
ITEMS:
Group PBAtv "PBA-TVS" <lgtv>
Group:Switch:OR(ON, OFF) TVs "All TVs [(%d)]"
Switch PBATV1Power "TV1 Power" (PBAtv, TVs) {channel="lgwebos:WebOSTV:93d6e248-596d-40b2-bf27-2f93e0c70c1b:power"}
Switch PBATV2Power "TV2 Power" (PBAtv, TVs) {channel="lgwebos:WebOSTV:c9bd12f1-9313-4903-b117-bb58460250cc:power"}
Switch PBATV3Power "TV3 Power" (PBAtv, TVs) {channel="lgwebos:WebOSTV:3670e8fa-33e6-45cf-b1de-857ec1d3f7bf:power"}
Switch PBATV4Power "TV4 Power" (PBAtv, TVs) {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" }
SITEMAP:
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=PBATV1Power
Switch item=TV1Input label="INPUT" mappings=[0="PC", 1="DVD", 2="HDMI-1",3="HDMI-2",4="HDMI-3"]
}
Frame label="TV-2" {
Switch item=PBATV2Power
Switch item=TV2Input label="INPUT" mappings=[0="PC", 1="DVD", 2="HDMI-1",3="HDMI-2",4="HDMI-3"]
}
Frame label="TV-3" {
Switch item=PBATV3Power
Switch item=TV3Input label="INPUT" mappings=[0="PC", 1="DVD", 2="HDMI-1",3="HDMI-2",4="HDMI-3"]
}
Frame label="TV-4" {
Switch item=PBATV4Power
Switch item=TV4Input label="INPUT" mappings=[0="PC", 1="DVD", 2="HDMI-1",3="HDMI-2",4="HDMI-3"]
}
}
}
EVENTS.LOG
* this is what happens when a single tv switch is pressed:
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.600 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.616 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
2019-10-02 15:28:29.631 [ome.event.ItemCommandEvent] - Item 'PBATV1Power' received command OFF
OPENHAB.LOG
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power ON
2019-10-02 15:29:12.017 [INFO ] [ipse.smarthome.model.script.LG.rules] - TV1 Power Off