Homebridge plugin for LG webOS TVs
!---[](https://discord.gg/5c8njh)---
homebridge-webos-tv
is a plugin for homebridge which allows you to control your LG webOS TV from your Home app! It should work with all TVs that support webOS2 and newer.
If you are already running a TV with native Homekit integration then you can still benefit from using this plugin with adding even more features and functionality to your TV.
If you are new to homebridge, please first read the homebridge documentation.
If you are running on a Raspberry, you will find a tutorial in the homebridge wiki.
Install homebridge:
sudo npm install -g homebridge
Install homebridge-webos-tv:
sudo npm install -g homebridge-webos-tv
Add the webostv
platform in config.json
in your home directory inside .homebridge
.
Add your TV or multiply TVs in the devices
or tvs
array.
Example configuration:
{
"platforms": [
{
"platform": "webostv",
"devices": [
{
"name": "My webOS tv",
"ip": "192.168.0.40",
"mac": "ab:cd:ef:fe:dc:ba",
"pollingInterval": 10,
"volumeControl": "buttons",
"channelControl": false,
"mediaControl": false,
"serviceMenuButton": true,
"appButtons": [
{
"appId": "com.webos.app.livetv",
"name": "Live TV"
},
{
"appId": "com.webos.app.hdmi1",
"name": "PS4"
},
{
"appId": "youtube.leanback.v4",
"name": "YouTube",
"params": {
"contentTarget": "https://www.youtube.com/tv?v=Bey4XXJAqS8"
}
}
],
"channelButtons": [
3,
5,
7
],
"notificationButtons": [
{
"message": "Motion detected - living room",
"name": "Living room motion",
"appId": "com.webos.app.browser",
"params": {
"target": "https://www.google.com/"
}
},
{
"message": "Motion detected - kitchen",
"name": "Kitchen motion"
}
],
"remoteControlButtons": [
"HOME",
"EXIT"
],
"soundOutputButtons": [
"tv_speaker",
"external_optical",
"headphone"
],
"remoteSequenceButtons": [
{
"sequence": [
"HOME",
"RIGHT",
"RIGHT",
"RIGHT",
"ENTER"
],
"name": "screen_share_seq"
},
{
"sequence": [
"VOLUMEUP",
"VOLUMEDOWN",
"MUTE",
"MUTE"
],
"name": "volume_seq",
"interval": 1000
}
],
"ccRemoteRemap": {
"arrowup": "VOLUMEUP",
"arrowdown": "VOLUMEDOWN",
"arrowleft": "CHANNELDOWN",
"arrowright": "CHANNELUP",
"select": "PROGRAM",
"back": "BACK",
"playpause": "YELLOW",
"information": "TELETEXT",
"youtube.leanback.v4":{
"information": "MUTE",
"select": "HOME"
}
},
"pictureModeButtons": [
"eco",
"game",
"cinema"
],
"soundModeButtons": [
"standard",
"music"
],
"triggers": {
"volume":{
"threshold": 50,
"name": "Volume above 50"
},
"backlight":{
"threshold": 70
}
}
}
]
}
]
}
You also need to enable mobile TV on on your TV for the turn on feature to work correctly.
This is located on your TV under Settings > General > Mobile TV On
On newer TVs LG Connect Apps under the network settings needs to be enabled.
Since HomeKit expects only one TV per bridge they will be declared as external accessories and acts as a bridge.
This means that a TV will not appear in your Home app until you add it!
To add a TV to HomeKit follow this steps:
For more info check the homebridge wiki Connecting Homebridge To HomeKit.
Inputs and apps are automatically fetched from your TV. As default only Live TV and basic external inputs (HDMI1, HDMI2, etc) are enabled in the “inputs spinner”. To add more apps to the spinner simply go on the accessory configuration in the Home app and check all the inputs which you would like to have in the spinner.
platform
[required]devices
or tvs
[required]name
[required]ip
[required]mac
[required]broadcastAdr
[optional]keyFile
[optional]EISDIR
error. Default: “~/.homebridge/.webosTv/keyFile_xxx”prefsDir
[optional]pollingInterval
[optional]deepDebugLog
[optional]silentLog
[optional]hideTvService
[optional]volumeLimit
[optional]volumeControl
[optional]channelControl
[optional]mediaControl
[optional]screenControl
[optional]screenSaverControl
[optional]serviceMenuButton
[optional]ezAdjustButton
[optional]backlightControl
[optional]brightnessControl
[optional]colorControl
[optional]contrastControl
[optional]ccRemoteRemap
[optional]appButtons
[optional]channelButtons
[optional]notificationButtons
[optional]remoteControlButtons
[optional]remoteSequenceButtons
[optional]remoteControlButtons
above,soundOutputButtons
[optional]pictureModeButtons
[optional]soundModeButtons
[optional]triggers
[optional]
Whether the triggers service is enabled. This allows to create occupancy sensors which trigger when the specified threshold is reached. Default: “” (disabled)
The plugin also offers a command line interface to control your TV directly from the command line.
Just type webostv
in the console to get a list of available options.
If you have any issues with the plugin or TV services then you can run homebridge in debug mode, which will provide some additional information. This might be useful for debugging issues.
Homebridge debug mode:
homebridge -D
Deep debug log, add the following to your config.json:
"deepDebugLog": true
This will enable additional extra log which might be helpful to debug all kind of issues. Just be aware that this will produce a lot of log information so it is recommended to use a service like https://pastebin.com/ when providing the log for inspection.
Most probably the ports assigned to your tv accessory are not open in your firewall.
To fix that you need to first update the config.json with a fixed range of ports like this:
...
"bridge": {
"name": "Homebridge",
"username": "**:**:**:**:**:**",
"pin": "***-**-***",
"port": 51283
},
"ports": {
"start": 52100,
"end": 52150
},
...
After that make sure that the specified range of ports is open in your firewall to allow connections.
When you try to add your TV to the HomeKit app but it is not visbile even when in the homebridge UI it appears, then it most probably is a homebridge cache issue.
Go to Homebridge Settings and click on Unpair Bridges / Cameras / TVs / External Accessories
and remove the TV from the list. After that try to add your TV to the HomeKit app.
Use the Reset Connection
button and after that try to add your TV to the HomeKit app.
lgtv2 - the Node.js remote control module for LG WebOS smart TVs.
HAP-NodeJS & homebridge - for making this possible.