{
  "pluginAlias": "FibaroHC",
  "pluginType": "platform",
  "singular": true,
  "headerDisplay": "Homebridge plugin for Fibaro Home Center.",
  "footerDisplay": "For additonal information visit [Plugin Homepage](https://github.com/ilcato/homebridge-fibaro-home-center).",
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "description": "Plugin name as displayed in the homebridge log.",
        "title": "Name",
        "type": "string",
        "required": true,
        "default": "FibaroHC"
      },
      "url": {
        "description": "E.G.: 192.168.1.100 (replace with Home Center IP) or https://hc-00000XXX.local (replace with your HC serial number, get ca.cer file from HC and put it in Homebridge in same folder as config.json) or http://hc-00000XXX.local (replace with your HC serial number). Using https may be mandatory if you configured HC to use it. Homebridge and HC / Yubii Home should be in the same local network with the same IP address range (same subnet), E.G. 192.168.1.XXX.",
        "title": "Address: IP or URL",
        "type": "string",
        "required": true
      },
      "username": {
        "description": "Username for Home Center.",
        "title": "Username",
        "type": "string",
        "required": true
      },
      "password": {
        "description": "Password for Home Center.",
        "title": "Password",
        "type": "string",
        "required": true
      },
      "pollerperiod": {
        "description": "Polling interval for querying Fibaro Home Center (0: disabled, recomended: 3, 1 or 2 seconds allows for a more responsive update of the Home app when changes appear outside the HomeKit environment). If it is disabled the Home app is not updated automatically when such a change happen but only when you close a panel and reopen it. Enabling this option is useful to read the new state when controlling devices outside HomeKit, E.G.: via Fibaro, physical buttons, scenes and automations.",
        "title": "Poller period (refresh interval)",
        "type": "number",
        "required": false,
        "default": 3,
        "placeholder": 3,
        "maximum": 100,
        "step": 0.1,
        "minimum": 0
      },
      "markDeadDevices": {
        "description": "Show dead devices as not responding in HomeKit. Dead devices are devices that have connection problems and in the Fibaro hub selected option to mark such devices. Warning: Not responding device in HomeKit can break automation, it is recommended to place such device in a separate automation.",
        "title": "Mark dead devices",
        "type": "boolean",
        "required": false,
        "default": false,
        "placeholder": false
      },
      "thermostattimeout": {
        "description": "Set the duration in seconds (60 - 1 minute, 3600 - 1 hour) of the manual setting for the thermostatic controls (defaults to 7200, 2 hours)",
        "title": "Number of seconds for the thermostat timeout",
        "type": "integer",
        "required": false,
        "default": 7200,
        "placeholder": 7200,
        "minimum": 60
      },
      "thermostatmaxtemperature": {
        "description": "Set the maximum allowed temperature in celcius for the thermostatic controls (defaults to 100 degrees celcius)",
        "title": "Themostat Max Temperature",
        "type": "integer",
        "required": false,
        "default": 100,
        "placeholder": 100,
        "minimum": 0
      },
      "switchglobalvariables": {
        "description": "A comma separeted list of Fibaro Home Center global variables acting like a bistable switch.",
        "title": "Global variables switches",
        "type": "string",
        "required": false
      },
      "dimmerglobalvariables": {
        "description": "A comma separeted list of Fibaro Home Center global variables acting like a dimmer.",
        "title": "Global variables dimmers",
        "type": "string",
        "required": false
      },
      "adminUsername": {
        "title": "Admin username for accessing Fibaro Home Center machine (only for setting global variables).",
        "type": "string",
        "required": false,
        "description": "If user provided above doesn't have admin rights in your Home Center, enter admin username of your Home Center to set global variables."
      },
      "adminPassword": {
        "title": "Admin password for accessing Fibaro Home Center machine (only for setting global variables).",
        "type": "string",
        "required": false,
        "description": "If user provided above doesn't have admin rights in your Home Center, enter password of your Home Center to set global variables."
      },
      "securitysystem": {
        "description": "Enable or disable the Security system, see homepage for detail.",
        "title": "Security system",
        "type": "string",
	"required": true,      
        "oneOf": [
          {
            "title": "Enabled",
            "enum": [
              "enabled"
            ]
          },
          {
            "title": "Disabled",
            "enum": [
              "disabled"
            ]
          }
        ],
        "default": "disabled"
      },
      "addRoomNameToDeviceName": {
        "description": "If enabled, to each device name will be added the name of the room in which it is located. Warning: changing this may cause that some of your devices will be removed and add as new.",
        "title": "Add room name to device name.",
        "type": "string",
	"required": true,      
        "oneOf": [
          {
            "title": "After device name",
            "enum": [
              "enabled"
            ]
          },
	  {
            "title": "Before device name",
            "enum": [
              "enabledBefore"
            ]
          },
          {
            "title": "Disabled",
            "enum": [
              "disabled"
            ]
          }
        ],
        "default": "disabled"
      },
      "doorbellDeviceId": {
        "description": "Device ID acting as a doorbell (Only binary type of sensors are supported)",
        "title": "Doorbell device ID",
        "type": "integer",
        "required": false
      },
      "logsLevel": {
        "description": "Choose what logs to display. The most important logs will be displayed regardless of this choice.",
        "title": "Logs Level",
        "type": "integer",
        "default": 1,
        "required": true,
        "oneOf": [
          {
            "title": "Disabled",
            "enum": [
              0
            ]
          },
          {
            "title": "Only changes",
            "enum": [
              1
            ]
          },
          {
            "title": "All Logs",
            "enum": [
              2
            ]
          }
        ]
      },
      "devices": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "title": "Device ID",
              "type": "integer",
              "required": true,
              "description": "Device ID (like: 41)."
            },
            "displayAs": {
              "title": "Display as",
              "description": "Display as: switch, dimmer, blind etc. or exclude device.",
              "type": "string",
              "default": "switch",
              "oneOf": [
                {
                  "title": "Switch",
                  "enum": [
                    "switch"
                  ]
                },
                {
                  "title": "Dimmer",
                  "enum": [
                    "dimmer"
                  ]
                },
                {
                  "title": "Blind",
                  "enum": [
                    "blind"
                  ]
                },
                {
                  "title": "Blind with tilt angle",
                  "enum": [
                    "blind2"
                  ]
                },
                {
                  "title": "Garage",
                  "enum": [
                    "garage"
                  ]
                },
                {
                  "title": "Temperature",
                  "enum": [
                    "temperature"
                  ]
                },
                {
                  "title": "Humidity",
                  "enum": [
                    "humidity"
                  ]
                },
                {
                  "title": "Light sensor",
                  "enum": [
                    "lightSensor"
                  ]
                },
                {
                  "title": "Motion",
                  "enum": [
                    "motion"
                  ]
                },
                {
                  "title": "Leak",
                  "enum": [
                    "leak"
                  ]
                },
                {
                  "title": "Smoke sensor",
                  "enum": [
                    "smoke"
                  ]
                },
                {
                  "title": "Security",
                  "enum": [
                    "security"
                  ]
                },
                {
                  "title": "Air Quality Sensor - PM2.5",
                  "enum": [
                    "airQualitySensorPm25"
                  ]
                },
                {
                  "title": "Outlet",
                  "enum": [
                    "outlet"
                  ]
                },
                {
                  "title": "Exclude device",
                  "enum": [
                    "exclude"
                  ]
                }
              ],
              "required": true
            }
          }
        }
      }
    }
  },
  "layout": [
    {
      "type": "fieldset",
      "title": "Basic settings",
      "description": "",
      "expandable": true,
      "expanded": true,
      "items": [
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "url"
          ]
        },
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "username",
            "password"
          ]
        }
      ]
    },
    {
      "type": "fieldset",
      "title": "Advanced settings",
      "description": "",
      "expandable": true,
      "expanded": false,
      "items": [
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "pollerperiod",
            "markDeadDevices",
            "securitysystem"
          ]
        },
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "addRoomNameToDeviceName",
            "doorbellDeviceId"
          ]
        },
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "thermostattimeout",
            "thermostatmaxtemperature"
          ]
        }
      ]
    },
    {
      "type": "fieldset",
      "title": "Global variables",
      "description": "",
      "expandable": true,
      "expanded": false,
      "items": [
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "switchglobalvariables",
            "dimmerglobalvariables"
          ]
        },
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "adminUsername",
            "adminPassword"
          ]
        }
      ]
    },
    {
      "type": "fieldset",
      "title": "Logs",
      "description": "",
      "expandable": true,
      "expanded": false,
      "items": [
        {
          "type": "flex",
          "flex-flow": "row wrap",
          "items": [
            "name",
            "logsLevel"
          ]
        }
      ]
    },
    {
      "type": "array",
      "key": "devices",
      "title": "Individual devices settings",
      "description": "The ability to add individual settings for each device. Provide ID and choose as which device to display. This way you can also add any device that is not currently supported. Warning: Selecting incorrect type may cause errors. The changed device may not display correctly (e.g. display both as the old type and as a new one), in this situation, remove this device from the cache (Homebridge settings).",
      "buttonText": "Add",
      "expandable": true,
      "expanded": false,
      "items": [
        "devices[].id",
        "devices[].displayAs"
      ]
    }
  ],
  "form": null,
  "display": null
}
