Skip to content

Commit

Permalink
[Binding addons starting with "L"] Correct linter errors only. (openh…
Browse files Browse the repository at this point in the history
…ab#2964)

-  Note: Some linter errors were not corrected because I was not sure what the linter error message meant.

Signed-off-by: Brad Gilmer <[email protected]>
  • Loading branch information
bgilmer77 authored and martinvw committed Dec 15, 2017
1 parent 5c0f29e commit 99630d7
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 217 deletions.
45 changes: 22 additions & 23 deletions addons/binding/org.openhab.binding.lgtvserial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@

This binding can send some commands typically used by LG LCD TVs (and some used by projectors).

See below for a list of supported channels. The binding does not support querying the current
state from the TV, as this is not possible using the serial protocol.
See below for a list of supported channels.
The binding does not support querying the current state from the TV, as this is not possible using the serial protocol.

## Supported Things

Supports one TV or projector per thing, also corresponding to a unique serial port. The
protocol supports daisy-chaining of serial devices, but this seems unlikely for home
Supports one TV or projector per thing, also corresponding to a unique serial port.
The protocol supports daisy-chaining of serial devices, but this seems unlikely for home
applications, and this binding sends to the broadcast address.

The LG serial command set [1] appears to be similar on many models, but not all commands will
work on all models. Some TVs may have an alternative port type instead of a standard DB9
connector, and may thus require an adapter. The serial port may be marked "Service only".
The LG serial command set [1] appears to be similar on many models, but not all commands will work on all models.
Some TVs may have an alternative port type instead of a standard DB9 connector, and may thus require an adapter.
The serial port may be marked "Service only".

Tested and developed for LG 55UF772V (with [this cable adapter](http://www.ebay.com/itm/DB9-9-Pin-Female-To-TRS-3-5mm-Male-Stereo-Serial-Data-Converter-Cable-1-8M-6Ft-/291541959764?)).


## Discovery

No discovery supported, manual configuration is required. The thing may be configured through the Paper UI.

No discovery supported, manual configuration is required.
The thing may be configured through the Paper UI.

## Thing Configuration

It is necessary to specify the serial port device used for communication. On Linux systems,
this will usually be either `/dev/ttyS0`, `/dev/ttyUSB0` or `/dev/ttyACM0` (or a higher
number than `0` if multiple devices are present). On Windows it will be `COM1`, `COM2`, etc.
It is necessary to specify the serial port device used for communication.
On Linux systems, this will usually be either `/dev/ttyS0`, `/dev/ttyUSB0` or `/dev/ttyACM0` (or a higher number than `0` if multiple devices are present).
On Windows it will be `COM1`, `COM2`, etc.

## Channels

* On/off
* Input: Select video input: HDMI, Component, ect.
* Volume
* Mute
* Backlight brightness: Supports 100 levels of brightness for LCD panels.
* Color temperature: Choose among 3 color temperatures, Warm, Normal and Cool.
* On/off
* Input: Select video input: HDMI, Component, ect.
* Volume
* Mute
* Backlight brightness: Supports 100 levels of brightness for LCD panels.
* Color temperature: Choose among 3 color temperatures, Warm, Normal and Cool.

## LG protocol references

[1] https://www.lg.com/us/commercial/documents/m6503ccba-owner-manual.pdf
[1] <https://www.lg.com/us/commercial/documents/m6503ccba-owner-manual.pdf>

[2] https://sites.google.com/site/brendanrobert/projects/bits-and-pieces/lg-tv-hacks
[2] <https://sites.google.com/site/brendanrobert/projects/bits-and-pieces/lg-tv-hacks>

[3] https://code.google.com/archive/p/lg-tv-command/source/default/source
[3] <https://code.google.com/archive/p/lg-tv-command/source/default/source>
32 changes: 17 additions & 15 deletions addons/binding/org.openhab.binding.lgwebos/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LG webOS Binding

The binding integrates LG WebOS based smart TVs. This binding uses a [forked version](https://github.com/sprehn/Connect-SDK-Java-Core) of LG's [Connect SDK](https://github.com/ConnectSDK/Connect-SDK-Android-Core) library.

The binding integrates LG WebOS based smart TVs.
This binding uses a [forked version](https://github.com/sprehn/Connect-SDK-Java-Core) of LG's [Connect SDK](https://github.com/ConnectSDK/Connect-SDK-Android-Core) library.

## Supported Things

Expand All @@ -11,18 +11,21 @@ LG webOS based smart TVs are supported.

#### TV Settings

The TV must be connected to the same network as openHAB.
The TV must be connected to the same network as openHAB.
Under network settings allow "LG CONNECT APPS" to connect.

Note: Under general settings allow mobile applications to turn on the TV, if this option is available. In combination with the wake on LAN binding this will allow you to start the TV via openHAB.
Note: Under general settings allow mobile applications to turn on the TV, if this option is available.
In combination with the wake on LAN binding this will allow you to start the TV via openHAB.

## Discovery

TVs are auto discovered through SSDP in the local network. The binding broadcasts a search message via UDP on the network.
TVs are auto discovered through SSDP in the local network.
The binding broadcasts a search message via UDP on the network.

## Thing Configuration

WebOS TV has no configuration parameters. Please note that at least one channel must be bound to an item before the binding will make an attempt to connect and pair with the TV once that one is turned on.
WebOS TV has no configuration parameters.
Please note that at least one channel must be bound to an item before the binding will make an attempt to connect and pair with the TV once that one is turned on.

## Channels

Expand All @@ -38,7 +41,7 @@ WebOS TV has no configuration parameters. Please note that at least one channel
| mediaStop | Switch | Media control stop | W |
| appLauncher | String | Application ID of currently running application. This also allows to start applications on the TV by sending a specific Application ID to this channel. | RW |

## Full Example
## Example

This example assumes the IP of your smart TV is 192.168.2.119.

Expand All @@ -48,13 +51,13 @@ demo.items:
Switch LG_TV0_Power "TV Power" <television> { autoupdate="false", channel="lgwebos:WebOSTV:192_168_2_119:power" }
Switch LG_TV0_Mute "TV Mute" { channel="lgwebos:WebOSTV:192_168_2_119:mute"}
Dimmer LG_TV0_Volume "Volume [%S]" { channel="lgwebos:WebOSTV:192_168_2_119:volume" }
Number LG_TV0_VolDummy "VolumeUpDown"
Number LG_TV0_VolDummy "VolumeUpDown"
Number LG_TV0_ChannelNo "Channel [%d]" { channel="lgwebos:WebOSTV:192_168_2_119:channel" }
Number LG_TV0_ChannelDummy "ChannelUpDown"
Number LG_TV0_ChannelDummy "ChannelUpDown"
String LG_TV0_Channel "Channel [%S]" { channel="lgwebos:WebOSTV:192_168_2_119:channelName"}
String LG_TV0_Toast { channel="lgwebos:WebOSTV:192_168_2_119:toast"}
Switch LG_TV0_Stop "Stop" { autoupdate="false", channel="lgwebos:WebOSTV:192_168_2_119:mediaStop" }
String LG_TV0_Application "Application [%s]" { channel="lgwebos:WebOSTV:192_168_2_119:appLauncher"}
String LG_TV0_Application "Application [%s]" { channel="lgwebos:WebOSTV:192_168_2_119:appLauncher"}
Player LG_TV0_Player { channel="lgwebos:WebOSTV:192_168_2_119:mediaPlayer"}
// this assumes you also have the wake on lan binding configured & You need to update your broadcast and mac address
Expand All @@ -76,7 +79,7 @@ sitemap demo label="Main Menu"
Text item=LG_TV0_Channel
Switch item=LG_TV0_ChannelDown
Switch item=LG_TV0_ChannelUp
Default item=LG_TV0_Player
Default item=LG_TV0_Player
Text item=LG_TV0_Application
Selection item=LG_TV0_Application mappings=[
"com.webos.app.livetv"="TV",
Expand All @@ -102,10 +105,10 @@ demo.rules:
```
// this assumes you also have the wake on lan binding configured.
rule "Power on TV via Wake on LAN"
when
when
Item LG_TV0_Power received command ON
then
sendCommand( LG_TV0_WOL, ON)
sendCommand( LG_TV0_WOL, ON)
end
// for relative volume changes
Expand All @@ -130,9 +133,8 @@ end
```


Example of a toast message.
Example of a toast message.

```
LG_TV0_Toast.sendCommand("Hello World")
```

Loading

0 comments on commit 99630d7

Please sign in to comment.