Skip to content

Commit e95fb3c

Browse files
authored
[lgtvserial] Update documentation and fix labels/descriptions (openhab#18253)
Signed-off-by: Michael Lobstein <[email protected]>
1 parent 2a7a76f commit e95fb3c

File tree

7 files changed

+85
-71
lines changed

7 files changed

+85
-71
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,79 @@
11
# LG TV Serial Binding
22

3-
This binding can send some commands typically used by LG LCD TVs (and some used by projectors).
3+
This binding controls LG TVs, monitors and projectors that have an RS-232C control port.
44

55
See below for a list of supported channels.
66

77
## Supported Things
88

9-
Supports one TV or projector per thing, also corresponding to a unique serial port.
9+
Supports one TV, monitor or projector per thing, also corresponding to a unique serial port.
1010
The protocol supports daisy-chaining of serial devices.
1111

1212
The LG serial command set appears to be similar on many models ([1], [5]), but not all commands will work on all models.
1313

14-
Some TVs may have an alternative port type instead of a standard DB9 connector, and may thus require an adapter.
14+
The control port on most TVs is a male DE-9 connector that requires a "Null modem" cable to connect to a serial port or USB to serial adapter.
1515

16-
The serial port may be marked "Service only".
16+
Some TVs have a 3.5 mm phone jack for the control port instead of a DE-9 connector, and may thus require the use of an adapter cable.
1717

18-
Tested and developed with :
18+
The 3.5 mm phone jack may work with a generic 3.5 mm TRS phone plug to DE-9 cable or possibly LG part # EAD62707901 or EAD62707902 (3.5 mm TRRS to DE-9).
1919

20-
- LG 55UF772V (with [this cable adapter](https://www.ebay.com/itm/DB9-9-Pin-Female-To-TRS-3-5mm-Male-Stereo-Serial-Data-Converter-Cable-1-8M-6Ft-/291541959764?)).
21-
- LG 47LK520 with a [serial hat](https://www.buyapi.ca/product/serial-hat-rs232/) on a Raspberry Pi
20+
The control port may be marked "Service Only".
21+
22+
Tested and developed with:
23+
24+
- LG 55UF772V with a generic 3.5 mm TRS phone plug to DE-9 cable
25+
- LG 47LK520 with a [serial hat](https://www.pishop.ca/product/serial-hat-rs232/) on a Raspberry Pi
2226

2327
## Discovery
2428

25-
No discovery supported, manual configuration is required.
29+
No discovery supported; manual configuration is required.
2630

2731
## Thing Configuration
2832

29-
It is necessary to specify the serial port device used for communication.
33+
The thing has the following configuration parameters:
34+
35+
| Parameter Label | Parameter ID | Description | Accepted values |
36+
|------------------------|----------------------|---------------------------------------------------------------------------------|------------------|
37+
| Serial Port | port | Serial port to use for connecting to TV/monitor/projector. | Serial port name |
38+
| Set ID | setId | Set ID configured in the TV. If 0, will send the commands to every chained TV. | 0-99; default 1 |
39+
40+
It is necessary to specify the serial port used for communication.
3041
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).
3142
On Windows it will be `COM1`, `COM2`, etc.
3243

33-
The set id can also be specified when using daisy-chaining.
34-
That allows you to have a thing that will handle a particular device (with set id other than 0), and another to send command on all devices (with set id equals 0).
35-
However, the item values for the thing with set id 0 will never display the right values as it receives responses from many devices.
44+
The Set ID can also be specified when using daisy-chaining.
45+
This allows you to have a Thing that will handle a particular device (with Set ID other than 0), and another to send commands to all devices (with Set equals 0).
46+
However, the item values for the Thing with Set ID 0 will never display the right values as it receives responses from many devices.
3647

3748
## Channels
3849

39-
The following channels are common to most TV through the serial or service port, taken from [4].
50+
The following channels are common to most TVs, taken from [4].
4051

41-
| Channel type id | Command | Item type | Description |
52+
| Channel ID | Command | Item Type | Description |
4253
|-----------------|---------|-----------|--------------------------------------------------|
4354
| aspect-ratio | k c | String | Adjust screen format, at least 4:3, 16:9 formats |
4455
| power | k a | Switch | Turns the device on or off |
4556
| volume | k f | Dimmer | Sets the volume, values are from 0 to 100 |
4657
| volume-mute | k e | Switch | Set mute on or off |
4758

48-
As for others, please refer to the documentation of your device in the section named "Controlling the multiple product", "External control" or any section that refers to RS-232, the names of the channels map the command names.
59+
As for others, please refer to the documentation of your device in the section named "Controlling the multiple product", "External control" or any section that refers to RS-232.
4960
If your device documentation doesn't give such information, you can look at the "LG protocol references" below and use the "Generic LG TV" thing which should contain all the different possible channels/commands.
5061

51-
Note: Devices might not respond or return an error to some command when the device is powered off which will make your items look in a wrong state until the TV turns on.
62+
Note: Devices might not respond or return an error to some command when the device is powered off which can put items in an incorrect state until the device is turned on.
5263
For instance, getting the volume status when the device is off makes no sense.
5364

5465
## All channel type ids
5566

56-
Here's a list of all the LG TV commands added to the binding, in channel type id alphabetic order
67+
Here is the list of all the LG TV commands added to the binding, in channel type id alphabetic order:
5768

58-
| Channel type id | Command | Item type | Description |
69+
| Channel ID | Command | Item Type | Description |
5970
|--------------------|---------|-----------|-----------------------------------------------------|
60-
| 3d | x t | String | To change 3D mode for tv |
61-
| 2d-extended | x v | String | To change 3D options for tv |
71+
| 3d | x t | String | To change the 3D mode |
72+
| 3d-extended | x v | String | To change the 3D options |
6273
| aspect-ratio | k c | String | To adjust the screen format |
63-
| auto-sleep | f g | Switch | Set Auto Sleep |
64-
| auto-volume | d u | Switch | Automatically adjust the volume level |
65-
| speaker | d v | Switch | Turn the speaker on or off |
74+
| auto-sleep | f g | Switch | To set the Auto Sleep function |
75+
| auto-volume | d u | Switch | To set the Auto Volume adjustment function |
76+
| speaker | d v | Switch | To turn the speaker on or off |
6677
| backlight | m g | Dimmer | To adjust screen backlight |
6778
| balance | k t | Dimmer | To adjust balance, from 0 to 100 |
6879
| bass | k s | Dimmer | To adjust bass, from 0 to 100 |
@@ -71,33 +82,32 @@ Here's a list of all the LG TV commands added to the binding, in channel type id
7182
| color-temperature | k u | String | To adjust the screen color temperature |
7283
| color-temperature2 | x u | Dimmer | To adjust color temperature, from 0 to 100 |
7384
| contrast | k g | Dimmer | To adjust screen contrast, from 0 to 100 |
74-
| dpm | f j | Switch | Set the DPM (Display Power Management) function |
85+
| dpm | f j | Switch | To set the DPM (Display Power Management) function |
7586
| energy-saving | j q | String | To control the energy saving function |
76-
| fan-fault-check | d w | Switch | To check the Fan fault of the TV |
87+
| fan-fault-check | d w | Switch | To read the Fan fault status of the device |
7788
| elapsed-time | d l | String | To read the elapsed time |
7889
| h-position | f q | Dimmer | To set the Horizontal position, from 0 to 100 |
79-
| h-size | f s | Dimmer | To set the Horizontal size, from 0 to 100 |
80-
| input | k b | String | To select input source for the Set |
81-
| input2 | x b | String | To select input source for set |
90+
| input | k b | String | To select the current input source for the device |
91+
| input2 | x b | String | To select the current input source for the device |
8292
| ism-method | j p | String | To avoid having a fixed image remain on screen |
83-
| ir-key-code | m c | String | To send IR remote key code |
84-
| lamp-fault-check | d p | Switch | To check lamp fault |
85-
| power | k a | Switch | To control Power On/Off of the set |
86-
| osd-select | k l | Switch | To select OSD (On Screen Display) on/off |
87-
| osd-language | f i | String | Set the OSD language |
93+
| ir-key-code | m c | String | To send an IR remote key code |
94+
| lamp-fault-check | d p | Switch | To read the lamp fault status of the device |
95+
| power | k a | Switch | To turn the device on or off |
96+
| osd-select | k l | Switch | To select OSD (On Screen Display) on or off |
97+
| osd-language | f i | String | To set the OSD language |
8898
| natural-mode | d j | Switch | To assign the Tile Natural mode for Tiling function |
8999
| picture-mode | d x | String | To adjust the picture mode |
90100
| power-indicator | f o | Switch | To set the LED for Power Indicator |
91101
| power-saving | f l | Switch | To set the Power saving mode |
92-
| screen-mute | k d | String | To select screen mute on/off |
102+
| screen-mute | k d | String | To select screen mute on or off |
93103
| serial-number | f y | String | To read the serial numbers |
94-
| software-version | f z | String | Check the software version |
104+
| software-version | f z | String | To read the software version |
95105
| sharpness | k k | Dimmer | To adjust screen sharpness, from 0 to 100 |
96-
| sleep-time | f f | String | Set sleep time |
106+
| sleep-time | f f | String | To set the sleep timer |
97107
| sound-mode | d y | String | To adjust the Sound mode |
98-
| speaker | d v | Switch | Turn the speaker on or off |
108+
| speaker | d v | Switch | To turn the speaker on or off |
99109
| temperature-value | d n | String | To read the inside temperature value |
100-
| tile-mode | d d | String | Change a Tile mode |
110+
| tile | d d | String | To change the Tile mode |
101111
| tile-h-position | d e | Dimmer | To set the Horizontal position, from 0 to 100 |
102112
| tile-h-size | d g | Dimmer | To set the Horizontal size, from 0 to 100 |
103113
| tile-id-set | d i | Dimmer | To assign the Tile ID for Tiling function, 0 to 25 |
@@ -106,15 +116,17 @@ Here's a list of all the LG TV commands added to the binding, in channel type id
106116
| tint | k j | Dimmer | To adjust screen tint, from 0 to 100 |
107117
| treble | k r | Dimmer | To adjust treble, from 0 to 100 |
108118
| volume | k f | Dimmer | To adjust volume, from 0 to 100 |
109-
| volume-mute | k e | Switch | Set mute on or off |
119+
| volume-mute | k e | Switch | To set mute on or off |
110120
| v-position | f r | Dimmer | To set the Vertical position, from 0 to 100 |
111-
| v-size | f t | Dimmer | To set the Vertical size, from 0 to 100 |
121+
| raw **(advanced)** | | String | To send a raw command directly to the device(s) |
122+
123+
## Not added or linked commands
112124

113-
## Not added or linked command
125+
The following commands/channels are not currently implemented in the binding but the commands could be sent via the `raw` channel.
114126

115-
| Channel type id | Command | Description
127+
| Channel ID | Command | Description
116128
|--------------------|---------|------------------------------------------------------------------------------------------------------------|
117-
| abnormal-state | k z | Used to Read the power off status when Stand-by mode |
129+
| abnormal-state | k z | Used to read the power off status when in Stand-by mode |
118130
| auto-configuration | j u | To adjust picture position and minimize image shaking automatically. it works only in RGB(PC) mode. |
119131
| power-on-delay | f h | Set the schedule delay when the power is turned on (Unit: second) |
120132
| remote-lock | k m | To control Remote Lock on/off to the set. Locks the remote control and the local keys. |
@@ -125,17 +137,19 @@ Here's a list of all the LG TV commands added to the binding, in channel type id
125137
| off-timer-on-off | f c | Set days for Off Timer |
126138
| on-timer-time | f d | Set On Timer |
127139
| off-timer-time | f e | Set Off Timer |
140+
| h-size | f s | Set the Horizontal size, from 0 to 100 |
141+
| v-size | f t | Set the Vertical size, from 0 to 100 |
128142

129143
## LG protocol references
130144

131-
[1] <https://www.lg.com/us/commercial/documents/m6503ccba-owner-manual.pdf>
145+
[1] Manual for M6503C monitor <https://gscs-b2c.lge.com/downloadFile?fileId=KROWM000237239.pdf>
132146

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

135149
[3] <https://code.google.com/archive/p/lg-tv-command/source/default/source>
136150

137151
[4] <https://github.com/suan/libLGTV_serial>
138152

139-
[5] Manual LV series, LK series, PW series and PZ series <https://gscs-b2c.lge.com/downloadFile?fileId=ujpO8yH69djwNZzwuavqpQ>
153+
[5] Manual for LV series, LK series, PW series and PZ series <https://gscs-b2c.lge.com/downloadFile?fileId=ujpO8yH69djwNZzwuavqpQ>
140154

141155
[6] Manual for LD series, LE series, LX series and PK series <https://gscs-b2c.lge.com/downloadFile?fileId=76If0tKDLOUizuoXikllgQ>

bundles/org.openhab.binding.lgtvserial/src/main/resources/OH-INF/addon/addon.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<type>binding</type>
77
<name>LG TV Serial Binding</name>
8-
<description>Controlling LG TVs using serial (RS232C) protocol</description>
8+
<description>Controls LG TVs that have an RS-232C control port</description>
99
<connection>local</connection>
1010

1111
</addon:addon>

bundles/org.openhab.binding.lgtvserial/src/main/resources/OH-INF/config/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</parameter>
1313
<parameter name="setId" type="integer" required="true">
1414
<label>Set ID</label>
15-
<description>Set ID configured in the TV. If 0, this will send a command to every chained TV.</description>
15+
<description>Set ID configured in the TV. If 0, will send the commands to every chained TV.</description>
1616
<default>1</default>
1717
</parameter>
1818
</config-description>

0 commit comments

Comments
 (0)