The TV must support the Vizio SmartCast API that is found on 2016 and later models.
## Supported Things
There is currently only one supported thing type, which represents a Vizio TV using the `vizio_tv` id.
Multiple Things can be added if more than one Vizio TV is to be controlled.
## Discovery
Auto-discovery is supported if the Vizio TV can be located on the local network using mDNS.
Otherwise the thing must be manually added.
When the TV is discovered, a pairing process to obtain an authentication token from the TV must be completed using the openHAB console. See below for details.
| hostName | The host name or IP address of the Vizio TV. Mandatory. |
| port | The port on the Vizio TV that listens for https connections. Default 7345; Use 9000 for older model TVs. |
| authToken | The token that is used to authenticate all commands sent to the TV. See below for instructions to obtain via the openHAB console. |
| appListJson | A JSON string that defines the apps that are available in the `activeApp` channel drop down. See below for instructions for editing. |
### Console Commands for Pairing:
To obtain an authorization token that enables openHAB to authenticate with the TV, the following console commands must be used while the TV is turned on.
The first command will send a pairing start request to the TV. This triggers the TV to display a 4-digit pairing code on screen that must be sent with the second command.
| power | Switch | Turn the power on the TV on or off. Note: TV may not turn on if power is switched off and the TV is configured for Eco mode. |
| volume | Dimmer | Control the volume on the TV (0-100%). |
| mute | Switch | Mute or unmute the volume on the TV. |
| source | String | Select the source input on the TV. The dropdown list is automatically populated from the TV. |
| activeApp | String | A dropdown containing a list of streaming apps defined by the `appListJson` config option that can be launched by the binding. An app started via remote control is automatically selected. |
| control | Player | Control Playback e.g. Play/Pause/Next/Previous/FForward/Rewind |
### List of available button commands for Vizio TVs:
PowerOn
PowerOff
PowerToggle
VolumeUp
VolumeDown
MuteOn **(may only work as a toggle)**
MuteOff **(may only work as a toggle)**
MuteToggle
ChannelUp
ChannelDown
PreviousCh
InputToggle
SeekFwd
SeekBack
Play
Pause
Up
Down
Left
Right
Ok
Back
Info
Menu
Home
Exit
Smartcast
ccToggle
PictureMode
WideMode
WideToggle
### App List Configuration:
The Vizio API to launch and identify currently running apps on the TV is very complex.
To handle this, the binding maintains a JSON database of applications and their associated metadata in order to populate the `activeApp` dropdown with available apps.
When the thing is started for the first time, this JSON database is saved into the `appListJson` configuration parameter.
This list of apps can be edited via the script editor on the thing configuration.
By editing the JSON, apps that are not desired can be removed from the `activeApp` dropdown and newly discovered apps can be added.
An entry for an application has a `name` element and a `config` element containing `APP_ID`, `NAME_SPACE` and `MESSAGE` (null for most apps):
If an app is running that is not currently recognized by the binding, the `activeApp` channel will display a message that contains the `APP_ID` and `NAME_SPACE` which can be used to create the missing record for that app in the JSON.
If an app that is in the JSON database fails to start when selected, try adjusting the `NAME_SPACE` value for that app.
If all text in `appListJson` is removed (set to null) and the thing configuration saved, the binding will restore `appListJson` from the binding's JSON db.