{
	"pluginAlias": "eDomoticz",
	"pluginType": "platform",
	"singular": false,
	"headerDisplay": "Homebridge plugin for Domoticz.\n\n1. Open the Home <img src='https://user-images.githubusercontent.com/3979615/78010622-4ea1d380-738e-11ea-8a17-e6a465eeec35.png' height='16.42px'> app on your device.\n2. Tap the Home tab, then tap <img src='https://user-images.githubusercontent.com/3979615/78010869-9aed1380-738e-11ea-9644-9f46b3633026.png' height='16.42px'>.\n3. Tap *Add Accessory*, and scan the QR code, alternatively select *I Don't Have a Code or Cannot Scan*.\n4. Enter the Homebridge PIN, this can be found under the QR code in Homebridge UI or your Homebridge logs.",
	"footerDisplay": "For help visit [eDomoticz on GitHub](https://github.com/PatchworkBoy/homebridge-edomoticz) or [Domoticz forum thread](https://www.domoticz.com/forum/viewtopic.php?f=36&t=10272)",
	"schema": {
		"type": "object",
		"properties": {
			"name": {
				"title": "Name",
				"type": "string",
				"default": "Domoticz",
				"required": true
			},
			"server": {
				"title": "Server",
				"type": "string",
				"default": "127.0.0.1",
				"required": true,
				"description": "If Domoticz is set up to use basic or form login authentication, set Server to 'user:pass@ipadress'."
			},
			"port": {
				"title": "Port",
				"type": "string",
				"default": "8080",
				"required": true
			},
			"webroot": {
 				"title": "Webroot",
 				"type": "string",
 				"default": "",
 				"required": false
 			},
			"roomid": {
				"title": "Room ID",
				"type": "integer",
				"default": 0,
				"required": true,
				"description": "If Room ID is set to 0 homebridge loads ALL sensors. Room ID is domoticz roomplan’s idx number"
			},
			"mqtt": {
				"title": "Enable MQTT",
				"type": "boolean",
				"default": 1,
				"description": "By default, the plugin will grab hardware information regarding MQTT from Domoticz if MQTT is checked. Advanced users can override their MQTT. In config, <code>\"mqtt\": true</code> can be changed to:<br><code>\"mqtt\": {<br>\"host\":\"alternate.mgtt.com\",<br>\"port\": 1234,<br>\"topic\": \"domoticz/out\",<br>\"username\": \"username\",<br>\"password\": \"password\"<br>}</code>"
			},
			"ssl": {
				"title": "Enable SSL",
				"type": "boolean",
				"default": 0,
				"description": "You will need to specify your SSL port - usually Port 443 by default."
			},
			"dimFix": {
				"title": "Dim Offset",
				"type": "integer",
				"default": 0,
				"description": "The dimFix variable relates to an early issue between HomeKit and Domoticz regarding scaling of dimmer values. If you find that you can never set your dimmers to 100%, then set this variable to 1. If you find that, when you set your dimmers, this starts a never ending loop of brightness increasing by 1%, then you MUST omit this variable or set it to 0."
			},
			"legacyBlinds": {
				"title": "Use legacy blind support",
				"type": "integer",
				"default": 0,
				"description": "If you use blinds, set this option to 1 if you use an older version of domoticz (until 2022-beta.14535). If using a more recent version, set to 0. When set to 0, the new reverse state and position will be used"
			},
			"excludedDevices": {
				"title": "Exluded Devices",
				"type": "array",
				"items": {
					"title": "Excluded Device IDX",
					"type": "string",
                    			"pattern": "^[0-9]"
				}
			}
		}
	},
	"form": [
		"name", {
			"type": "flex",
			"items": [
				"server",
				"port",
				"webroot",
				"roomid"
			]
		}, {
			"type": "fieldset",
			"title": "Exclude Devices",
			"expandable": true,
			"expanded": false,
			"items": [{
					"type": "help",
					"helpvalue": "<h6>Exclude Devices</h6><em class='primary-text'>To prevent certain Domoticz devices from showing up in HomeBridge, add IDX of the device.</em>"
				}, {
					"nodescription": true,
					"notitle": true,
					"key": "excludedDevices",
					"type": "array",
					"items": [{
							"type": "div",
							"displayFlex": true,
							"flex-direction": "row",
							"items": [{
									"key": "excludedDevices[]",
									"flex": "1 1 50px",
									"notitle": true,
									"placeholder": "Enter device IDX..."
								}
							]
						}
					]
				}
			]
		}, {
			"type": "fieldset",
			"expandable": true,
			"title": "Advanced Settings",
			"items": [

				"dimFix",
				"legacyBlinds",
				"mqtt",
				"ssl"
			]
		}
	]
}
