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.
## Supported Things
Supports one TV or projector per thing, also corresponding to a unique serial port.
The protocol supports daisy-chaining of serial devices.
The LG serial command set appears to be similar on many models ([1], [5]), 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 with :
- 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?)).
- LG 47LK520 with a [serial hat](https://www.buyapi.ca/product/serial-hat-rs232/) on a Raspberry Pi
## Discovery
No discovery supported, manual configuration is required.
## 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.
The set id can also be specified when using daisy-chaining.
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).
However, the item values for the thing with set id 0 will never display the right values as it receives responses from many devices.
## Channels
The following channels are common to most TV through the serial or service port, taken from [4].
| Channel type id | Command | Item type | Description |
| aspect-ratio | k c | String | Adjust screen format, at least 4:3, 16:9 formats |
| power | k a | Switch | Turns the device on or off |
| volume | k f | Dimmer | Sets the volume, values are from 0 to 100 |
| volume-mute | k e | Switch | Set mute on or off |
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.
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.
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.
For instance, getting the volume status when the device is off makes no sense.
## All channel type ids
Here's a list of all the LG TV commands added to the binding, in channel type id alphabetic order
| Channel type id | Command | Item type | Description |