[SOLVED]Lgwebos item linking with alexa

  • Platform information:Raspbian GNU/Linux 10 (buster)
    • Hardware: Raspberry Pi 3 Model B Rev 1.2
    • OS: Raspbian GNU/Linux 10 (buster)
    • openHAB version:openHAB 2.5.3-1 (Release Build)
  • Issue of the topic: I hav link my LG samrt TV using LG webOS Binding successfylly.
    9 channels are linked and i can control my TV using Classic UI & HAB pane.

i want to control my tv using alexa & Basic UI using whic i control all smart switches of my house.

i have created .items files and using .sitemap file i expose items on android app and BASIC UI.

i dont know how do in link items with LGTV binding items and expose them to Alexa and display on BASIC ui.

snap of LG Webos buinding items in paper ui as below.

however i created items for power , Mute & Volume for tv as below.
.Items file is as below.

Switch TV_Power1 “TV_POWER” (GF_LivingRoom_TV) ga=“Switch”,alexa=“PowerController.powerState”}
Dimmer TV_volume1 “TV_Volume” (GF_LivingRoom_TV) {ga=“Light” ,alexa=“Speaker.volume”}

.rules file is as below.

rule “TV_POWER”
when Item TV_Power1 changed
then
if(TV_Power1.state == ON){
lgwebos_WebOSTV_d0e611a2_d6a1_feeb_ffe2_e9b507edfcf7_power.postUpdate(ON)
}
if(TV_Power1.state == OFF){
lgwebos_WebOSTV_d0e611a2_d6a1_feeb_ffe2_e9b507edfcf7_power.postUpdate(OFF)
}
end

by doing this i get updates on openhab log viewer , classic ui & BASIC UI during applying any command but tv didnt follow any commands.
logviewar message is as below.
2020-04-15 14:53:10.741 [ome.event.ItemCommandEvent] - Item ‘TV_volume1’ received command 54

2020-04-15 14:53:10.769 [vent.ItemStateChangedEvent] - TV_volume1 changed from 99 to 54

2020-04-15 14:53:23.144 [ome.event.ItemCommandEvent] - Item 'TV_mute1' received command ON

2020-04-15 14:53:23.160 [vent.ItemStateChangedEvent] - TV_mute1 changed from OFF to ON

2020-04-15 14:53:23.195 [vent.ItemStateChangedEvent] - lgwebos_WebOSTV_d0e611a2_d6a1_feeb_ffe2_e9b507edfcf7_mute changed from OFF to ON

2020-04-15 14:53:28.132 [ome.event.ItemCommandEvent] - Item 'TV_mute1' received command OFF

2020-04-15 14:53:28.168 [vent.ItemStateChangedEvent] - TV_mute1 changed from ON to OFF

2020-04-15 14:53:28.187 [vent.ItemStateChangedEvent] - lgwebos_WebOSTV_d0e611a2_d6a1_feeb_ffe2_e9b507edfcf7_mute changed from ON to OFF

2020-04-15 14:53:55.889 [ome.event.ItemCommandEvent] - Item 'TV_volume1' received command 20

2020-04-15 14:53:55.911 [vent.ItemStateChangedEvent] - TV_volume1 changed from 54 to 20

2020-04-15 14:54:24.426 [ome.event.ItemCommandEvent] - Item 'TV_Power1' received command OFF

Kindly suggest how do i use items(linked by paper UI) in text editor and expose them to Alexa & Google.

Create your LG items in files and copy the channel info from PaperUI and configure it how you like.

Example:

Switch FrontPorch_Light "Front Porch Lights" <light>  ["Lighting"]  { channel="mqtt:topic:pibroker:sonoff-7CB10D:power" }

Just paste in the channel info like above.

1 Like

By following openhab Lgwebos binding documentation I understand how to link switch items.

Lgwebos Binding Documentation

1 Like