homebridge-lgwebos-tv
Version:
Homebridge plugin to control LG webOS TV.
1,428 lines (1,427 loc) • 75.6 kB
JSON
{
"pluginAlias": "LgWebOsTv",
"pluginType": "platform",
"singular": true,
"fixArrays": true,
"strictValidation": true,
"headerDisplay": "This plugin works with webOS based TV and are exposed to HomeKit as separate accessories and each needs to be manually paired.",
"footerDisplay": "For documentation please see [GitHub repository](https://github.com/grzegorz914/homebridge-lgwebos-tv).",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Platform",
"type": "string",
"default": "LG webOS TV"
},
"devices": {
"type": "array",
"items": {
"type": "object",
"title": "Device",
"properties": {
"name": {
"title": "Name",
"type": "string",
"placeholder": "LG TV"
},
"host": {
"title": "IP/Hostname",
"type": "string",
"placeholder": "192.168.1.8 or tv.local",
"pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)(\\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)$"
},
"mac": {
"title": "Address Mac",
"type": "string",
"placeholder": "ab:cd:ef:fe:dc:ba",
"pattern": "^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"
},
"displayType": {
"title": "Accessory type",
"type": "integer",
"minimum": 0,
"maximum": 4,
"default": 1,
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Television",
"enum": [
1
]
},
{
"title": "TV Set Top Box",
"enum": [
2
]
},
{
"title": "TV Streaming Stick",
"enum": [
3
]
},
{
"title": "Audio Receiver",
"enum": [
4
]
}
]
},
"inputs": {
"title": "Inputs",
"type": "object",
"properties": {
"getFromDevice": {
"title": "Load Inputs From Device",
"type": "boolean",
"default": false,
"description": "This function get all available inputs direct from device, manually configured inputs will be skipped."
},
"filterSystemApps": {
"title": "Hide System Apps",
"type": "boolean",
"default": false,
"description": "If enabled, all System Apps will not be displayed on the list of inputs."
},
"displayOrder": {
"title": "Display Order",
"type": "integer",
"minimum": 0,
"maximum": 4,
"description": "Here select display order of the inputs list.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Ascending by Name",
"enum": [
1
]
},
{
"title": "Descending by Name",
"enum": [
2
]
},
{
"title": "Ascending by Reference",
"enum": [
3
]
},
{
"title": "Descending by Reference",
"enum": [
4
]
}
]
},
"data": {
"title": "Inputs",
"type": "array",
"items": {
"title": "Input",
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"placeholder": "Name",
"description": "Here set Your own name."
},
"reference": {
"title": "Reference",
"type": "string",
"placeholder": "Input/App, Channel reference",
"description": "Here set the Input/App, Channel reference."
},
"mode": {
"title": "Mode",
"type": "integer",
"description": "Here select the function mode.",
"anyOf": [
{
"title": "Input/App",
"enum": [
0
]
},
{
"title": "Live TV Channel",
"enum": [
1
]
}
]
}
}
},
"condition": {
"functionBody": "return model.devices[arrayIndices].inputs.getFromDevice == false;"
}
}
}
},
"buttons": {
"title": "Button",
"type": "array",
"items": {
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 2,
"description": "Here select display type in HomeKit app.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Outlet",
"enum": [
1
]
},
{
"title": "Switch",
"enum": [
2
]
}
]
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Name",
"description": "Here set Your own name."
},
"mode": {
"title": "Mode",
"type": "integer",
"description": "Here select the function mode.",
"anyOf": [
{
"title": "Input/App",
"enum": [
0
]
},
{
"title": "Live TV Channel",
"enum": [
1
]
},
{
"title": "Remote Control",
"enum": [
2
]
}
],
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].buttons[arrayIndices[1]].displayType > 0;"
}
},
"reference": {
"title": "Reference",
"type": "string",
"placeholder": "com.webos.app.sheduler",
"description": "Here set the Input/App/Channel reference.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].buttons[arrayIndices[1]].displayType > 0 && model.devices[arrayIndices[0]].buttons[arrayIndices[1]].mode < 2;"
}
},
"command": {
"title": "RC Command",
"type": "string",
"description": "Here select the remote control command.",
"anyOf": [
{
"title": "0",
"enum": [
"0"
]
},
{
"title": "1",
"enum": [
"1"
]
},
{
"title": "2",
"enum": [
"2"
]
},
{
"title": "3",
"enum": [
"3"
]
},
{
"title": "4",
"enum": [
"4"
]
},
{
"title": "5",
"enum": [
"5"
]
},
{
"title": "6",
"enum": [
"6"
]
},
{
"title": "7",
"enum": [
"7"
]
},
{
"title": "8",
"enum": [
"8"
]
},
{
"title": "9",
"enum": [
"9"
]
},
{
"title": "Power",
"enum": [
"POWER"
]
},
{
"title": "Volume Up",
"enum": [
"VOLUMEUP"
]
},
{
"title": "Volume Down",
"enum": [
"VOLUMEDOWN"
]
},
{
"title": "Mute",
"enum": [
"MUTE"
]
},
{
"title": "Channel Up",
"enum": [
"CHANNELUP"
]
},
{
"title": "Channel Down",
"enum": [
"CHANNELDOWN"
]
},
{
"title": "Home",
"enum": [
"HOME"
]
},
{
"title": "Menu",
"enum": [
"MENU"
]
},
{
"title": "Q Menu",
"enum": [
"QMENU"
]
},
{
"title": "Menu Up",
"enum": [
"UP"
]
},
{
"title": "Menu Down",
"enum": [
"DOWN"
]
},
{
"title": "Menu Left",
"enum": [
"LEFT"
]
},
{
"title": "Menu Right",
"enum": [
"RIGHT"
]
},
{
"title": "Menu OK",
"enum": [
"ENTER"
]
},
{
"title": "Back",
"enum": [
"BACK"
]
},
{
"title": "Exit",
"enum": [
"EXIT"
]
},
{
"title": "Eject",
"enum": [
"EJECT"
]
},
{
"title": "Info",
"enum": [
"INFO"
]
},
{
"title": "Play",
"enum": [
"PLAY"
]
},
{
"title": "Pause",
"enum": [
"PAUSE"
]
},
{
"title": "Record",
"enum": [
"RECORD"
]
},
{
"title": "Fast Forward",
"enum": [
"FASTFORWARD"
]
},
{
"title": "Rewind",
"enum": [
"REWIND"
]
},
{
"title": "Red",
"enum": [
"RED"
]
},
{
"title": "Green",
"enum": [
"GREEN"
]
},
{
"title": "Yellow",
"enum": [
"YELLOW"
]
},
{
"title": "Blue",
"enum": [
"BLUE"
]
},
{
"title": "Live Zoom",
"enum": [
"LIVE_ZOOM"
]
},
{
"title": "Magnifier Zoom",
"enum": [
"MAGNIFIER_ZOOM"
]
},
{
"title": "3D Mode",
"enum": [
"3D_MODE"
]
},
{
"title": "List",
"enum": [
"LIST"
]
},
{
"title": "AD",
"enum": [
"AD"
]
},
{
"title": "Dash",
"enum": [
"DASH"
]
},
{
"title": "Favorites",
"enum": [
"FAVORITES"
]
},
{
"title": "Program",
"enum": [
"PROGRAM"
]
},
{
"title": "My Apps",
"enum": [
"MYAPPS"
]
},
{
"title": "Aspect Ratio",
"enum": [
"ASPECT_RATIO"
]
},
{
"title": "Screen Remot",
"enum": [
"SCREEN_REMOT"
]
},
{
"title": "Recent",
"enum": [
"RECENT"
]
},
{
"title": "SAP",
"enum": [
"SAP"
]
},
{
"title": "CC",
"enum": [
"CC"
]
},
{
"title": "Click",
"enum": [
"CLICK"
]
},
{
"title": "Teletext",
"enum": [
"TELETEXT"
]
},
{
"title": "Text Option",
"enum": [
"TEXTOPTION"
]
},
{
"title": "BML Data",
"enum": [
"BML_DATA"
]
},
{
"title": "3 Digital Input",
"enum": [
"3DIGIT_INPUT"
]
}
],
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].buttons[arrayIndices[1]].displayType > 0 && model.devices[arrayIndices[0]].buttons[arrayIndices[1]].mode === 2;"
}
},
"namePrefix": {
"title": "Prefix",
"type": "boolean",
"description": "Here enable the accessory name as a prefix for button name.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].buttons[arrayIndices[1]].displayType > 0;"
}
}
},
"allOf": [
{
"if": {
"required": [
"displayType"
],
"properties": {
"displayType": {
"enum": [
1,
2
]
}
}
},
"then": {
"required": [
"mode"
]
}
},
{
"if": {
"required": [
"displayType",
"mode"
],
"properties": {
"displayType": {
"enum": [
1,
2
]
},
"mode": {
"enum": [
0,
1
]
}
}
},
"then": {
"required": [
"reference"
]
}
},
{
"if": {
"required": [
"displayType",
"mode"
],
"properties": {
"displayType": {
"enum": [
1,
2
]
},
"mode": {
"enum": [
2
]
}
}
},
"then": {
"required": [
"command"
]
}
}
]
}
},
"sensors": {
"type": "array",
"items": {
"title": "Sensors",
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 3,
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Motion Sensor",
"enum": [
1
]
},
{
"title": "Occupancy Sensor",
"enum": [
2
]
},
{
"title": "Contact Sensor",
"enum": [
3
]
}
],
"description": "Here select sensor type to be exposed in HomeKit app."
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Name",
"description": "Here set Your own name."
},
"mode": {
"title": "Mode",
"type": "integer",
"minimum": 0,
"maximum": 11,
"description": "Here select the sensor mode.",
"anyOf": [
{
"title": "Input",
"enum": [
0
]
},
{
"title": "Power",
"enum": [
1
]
},
{
"title": "Volume",
"enum": [
2
]
},
{
"title": "Mute",
"enum": [
3
]
},
{
"title": "Sound Mode",
"enum": [
4
]
},
{
"title": "Sound Output",
"enum": [
5
]
},
{
"title": "Picture Mode",
"enum": [
6
]
},
{
"title": "Screen Off",
"enum": [
7
]
},
{
"title": "Screen Saver",
"enum": [
8
]
},
{
"title": "Play State",
"enum": [
9
]
},
{
"title": "Pixel Refresh",
"enum": [
10
]
},
{
"title": "Channel",
"enum": [
11
]
}
],
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].sensors[arrayIndices[1]].displayType > 0;"
}
},
"namePrefix": {
"title": "Prefix",
"type": "boolean",
"description": "Here enable the accessory name as a prefix for sensor name.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].sensors[arrayIndices[1]].displayType > 0;"
}
},
"pulse": {
"title": "Pulse",
"type": "boolean",
"description": "Here enable sensor pulse, sensor send pulse and fired on every value change of selected mode.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].sensors[arrayIndices[1]].displayType > 0;"
}
},
"reference": {
"title": "Reference",
"type": "string",
"placeholder": "Reference",
"description": "Here set the reference, sensor fired if switch to this referece.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].sensors[arrayIndices[1]].displayType > 0 && model.devices[arrayIndices[0]].sensors[arrayIndices[1]].pulse === false && (model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 0 || model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 4 || model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 5 || model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 6 || model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 11);"
}
},
"level": {
"title": "Level",
"type": "number",
"minimum": 0,
"maximum": 100,
"multipleOf": 1,
"description": "Here set the level between 0-100% at which the sensor fired.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].sensors[arrayIndices[1]].displayType > 0 && model.devices[arrayIndices[0]].sensors[arrayIndices[1]].pulse === false && model.devices[arrayIndices[0]].sensors[arrayIndices[1]].mode === 2;"
}
}
},
"allOf": [
{
"if": {
"required": [
"displayType"
],
"properties": {
"displayType": {
"enum": [
1,
2,
3
]
}
}
},
"then": {
"required": [
"mode"
]
}
},
{
"if": {
"required": [
"displayType",
"mode",
"pulse"
],
"properties": {
"displayType": {
"enum": [
1,
2,
3
]
},
"pulse": {
"const": false
},
"mode": {
"enum": [
0,
4,
5,
6,
11
]
}
}
},
"then": {
"required": [
"reference"
]
}
},
{
"if": {
"required": [
"displayType",
"mode",
"pulse"
],
"properties": {
"displayType": {
"enum": [
1,
2,
3
]
},
"pulse": {
"const": false
},
"mode": {
"enum": [
2
]
}
}
},
"then": {
"required": [
"level"
]
}
}
]
}
},
"power": {
"title": "Power",
"type": "object",
"properties": {
"broadcastAddress": {
"title": "Broadcast address",
"type": "string",
"placeholder": "255.255.255.255",
"format": "ipv4",
"description": "Her set network broadcast address, only if You use VLANS in Your network configuration and Your router/switch support IP Directed Broadcast."
},
"startInput": {
"title": "Default Input",
"type": "boolean",
"description": "This enable possibilty to set default Input/App after Power ON TV."
},
"startInputReference": {
"title": "Input Reference",
"type": "string",
"placeholder": "com.webos.app.home",
"description": "Here set the default Input/App reference.",
"condition": {
"functionBody": "return model.devices[arrayIndices].power.startInput === true"
}
}
}
},
"volume": {
"title": "Volume",
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 5,
"description": "Here select what a extra volume/mute control type You want to use.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Lightbulb",
"enum": [
1
]
},
{
"title": "Fan",
"enum": [
2
]
},
{
"title": "TV Speaker (HW buttons)",
"enum": [
3
]
},
{
"title": "TV Speaker / Lightbulb",
"enum": [
4
]
},
{
"title": "TV Speaker / Fan",
"enum": [
5
]
}
]
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Volume Control Name",
"description": "Here set Your own volume control name or leave empty.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].volume[arrayIndices[1]].displayType > 0;"
}
},
"namePrefix": {
"title": "Prefix",
"type": "boolean",
"description": "Here enable the accessory name as a prefix for volume control name.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].volume[arrayIndices[1]].displayType > 0;"
}
}
}
},
"sound": {
"title": "Sound",
"type": "object",
"properties": {
"modes": {
"title": "Sound Mode",
"type": "array",
"items": {
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 2,
"description": "Here select display type in HomeKit app.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Outlet",
"enum": [
1
]
},
{
"title": "Switch",
"enum": [
2
]
}
]
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Sound Mode Name",
"description": "Here set Your own Sound Mode name."
},
"reference": {
"title": "Mode",
"type": "string",
"description": "Here choice the Sound Mode.",
"anyOf": [
{
"title": "Ai Sound Plus",
"enum": [
"aiSoundPlus"
]
},
{
"title": "Standard",
"enum": [
"standard"
]
},
{
"title": "Movie",
"enum": [
"movie"
]
},
{
"title": "Clear Voice",
"enum": [
"clearVoice"
]
},
{
"title": "News",
"enum": [
"news"
]
},
{
"title": "Sports",
"enum": [
"sports"
]
},
{
"title": "Music",
"enum": [
"music"
]
},
{
"title": "Game",
"enum": [
"game"
]
}
],
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].modes[arrayIndices[1]].displayType > 0;"
}
},
"namePrefix": {
"title": "Prefix",
"type": "boolean",
"description": "Here enable the accessory name as a prefix for sound mode.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].modes[arrayIndices[1]].displayType > 0;"
}
}
},
"allOf": [
{
"if": {
"properties": {
"displayType": {
"enum": [
1,
2
]
}
}
},
"then": {
"required": [
"reference"
]
}
}
]
}
},
"outputs": {
"title": "Sound Output",
"type": "array",
"items": {
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 2,
"description": "Here select display type in HomeKit app.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Outlet",
"enum": [
1
]
},
{
"title": "Switch",
"enum": [
2
]
}
]
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Sound Output Name",
"description": "Here set Your own Sound Output name."
},
"reference": {
"title": "Output",
"type": "string",
"description": "Here choice the Sound Output.",
"anyOf": [
{
"title": "TV Speaker",
"enum": [
"tv_speaker"
]
},
{
"title": "External Speaker",
"enum": [
"external_speaker"
]
},
{
"title": "External Optical",
"enum": [
"external_optical"
]
},
{
"title": "External ARC",
"enum": [
"external_arc"
]
},
{
"title": "Line Out",
"enum": [
"lineout"
]
},
{
"title": "Headphone",
"enum": [
"headphone"
]
},
{
"title": "TV External Speaker",
"enum": [
"tv_external_speaker"
]
},
{
"title": "TV Speaker Headphone",
"enum": [
"tv_speaker_headphone"
]
},
{
"title": "BT Soundbar",
"enum": [
"bt_soundbar"
]
},
{
"title": "Soundbar",
"enum": [
"soundbar"
]
}
],
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].outputs[arrayIndices[1]].displayType > 0;"
}
},
"namePrefix": {
"title": "Prefix",
"type": "boolean",
"description": "Here enable the accessory name as a prefix for sound output.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].outputs[arrayIndices[1]].displayType > 0;"
}
}
},
"allOf": [
{
"if": {
"properties": {
"displayType": {
"enum": [
1,
2
]
}
}
},
"then": {
"required": [
"reference"
]
}
}
]
}
}
}
},
"picture": {
"title": "Picture",
"type": "object",
"properties": {
"brightnessControl": {
"title": "Brightness",
"type": "boolean",
"default": false,
"description": "This enable possibility adjust the Brightness."
},
"backlightControl": {
"title": "Backlight",
"type": "boolean",
"default": false,
"description": "This enable possibility adjust the Backlight."
},
"contrastControl": {
"title": "Contrast",
"type": "boolean",
"default": false,
"description": "This enable possibility adjust the Contrast."
},
"colorControl": {
"title": "Color",
"type": "boolean",
"default": false,
"description": "This enable possibility adjust the Color."
},
"modes": {
"title": "Mode",
"type": "array",
"items": {
"type": "object",
"properties": {
"displayType": {
"title": "Display Type",
"type": "integer",
"minimum": 0,
"maximum": 2,
"description": "Here select display type in HomeKit app.",
"anyOf": [
{
"title": "Disabled",
"enum": [
0
]
},
{
"title": "Outlet",
"enum": [
1
]
},
{
"title": "Switch",
"enum": [
2
]
}
]
},
"name": {
"title": "Name",
"type": "string",
"placeholder": "Picture Mode Name",
"description": "Here set Your own Picture Mode name."
},
"reference": {
"title": "Mode",
"type": "string",
"description": "Here choice the Picture Mode.",
"anyOf": [
{
"title": "Normal",
"enum": [
"normal"
]
},
{
"title": "Cinema",
"enum": [
"cinema"
]
},
{
"title": "Eco",
"enum": [
"eco"
]
},
{
"title": "Game",
"enum": [
"game"
]
},
{
"title": "Photo",
"enum": [
"photo"
]
},
{
"title": "Sports",
"enum": [
"sports"
]
},
{
"title": "Vivid",
"enum": [
"vivid"
]
},
{
"title": "Technicolor",