{
  "pluginAlias": "tasmotaControl",
  "pluginType": "platform",
  "singular": true,
  "fixArrays": true,
  "strictValidation": true,
  "headerDisplay": "This plugin works with ESP devices flashed with Tasmota Firmware. Devices 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-tasmota-control).",
  "schema": {
    "type": "object",
    "properties": {
      "devices": {
        "title": "Devices",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Name",
              "type": "string",
              "placeholder": "socket",
              "required": true
            },
            "host": {
              "title": "IP/Hostname",
              "type": "string",
              "placeholder": "192.168.1.5",
              "format": "hostname",
              "required": true
            },
            "auth": {
              "title": "Authorization",
              "type": "boolean",
              "default": false,
              "required": false
            },
            "user": {
              "title": "User",
              "type": "string",
              "placeholder": "username",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].auth === true;"
              },
              "required": false
            },
            "passwd": {
              "title": "Password",
              "type": "string",
              "placeholder": "password",
              "format": "password",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].auth === true;"
              },
              "required": false
            },
            "disableAccessory": {
              "title": "Disable Accessory",
              "type": "boolean",
              "default": false,
              "description": "Here You can disable this accessory.",
              "required": false
            },
            "miElHvac": {
              "title": "RESTFul",
              "type": "object",
              "properties": {
                "heatDryFanMode": {
                  "title": "Heat",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "default": 1,
                  "oneOf": [
                    {
                      "title": "None/Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Heat",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Dry",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Fan",
                      "enum": [
                        3
                      ]
                    }
                  ],
                  "description": "Select the operating mode for Heat, if this mode is not supported, it will be disabled.",
                  "required": true
                },
                "coolDryFanMode": {
                  "title": "Cool",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "default": 1,
                  "oneOf": [
                    {
                      "title": "None/Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Cool",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Dry",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Fan",
                      "enum": [
                        3
                      ]
                    }
                  ],
                  "description": "Select the operating mode for Cool, if this mode is not supported, it will be disabled.",
                  "required": true
                },
                "autoDryFanMode": {
                  "title": "Auto",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "default": 1,
                  "oneOf": [
                    {
                      "title": "None/Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Auto",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Dry",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Fan",
                      "enum": [
                        3
                      ]
                    }
                  ],
                  "description": "Select the operating mode for Auto, if this mode is not supported, it will be disabled.",
                  "required": true
                },
                "remoteTemperatureSensor": {
                  "title": "External Sensor",
                  "type": "object",
                  "properties": {
                    "enable": {
                      "title": "Activate",
                      "type": "boolean",
                      "default": false,
                      "description": "This enable external remote sensor for A.C. device.",
                      "required": false
                    },
                    "path": {
                      "title": "Path",
                      "type": "string",
                      "format": "hostname",
                      "placeholder": "http://192.168.1.1/tempsensor",
                      "description": "Here set the path to the external temperature sensor.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true;"
                      },
                      "required": false
                    },
                    "refreshInterval": {
                      "title": "Refresh Interval",
                      "type": "number",
                      "minimum": 1.0,
                      "maximum": 600,
                      "multipleOf": 0.5,
                      "default": 5,
                      "description": "Here set the sensor data refresh time in (sec).",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true;"
                      },
                      "required": false
                    },
                    "auth": {
                      "title": "Authorization",
                      "type": "boolean",
                      "default": false,
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true;"
                      },
                      "required": false
                    },
                    "user": {
                      "title": "User",
                      "type": "string",
                      "placeholder": "username",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true && model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.auth === true;"
                      },
                      "required": false
                    },
                    "passwd": {
                      "title": "Password",
                      "type": "string",
                      "placeholder": "password",
                      "format": "password",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true && model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.auth === true;"
                      },
                      "required": false
                    }
                  }
                },
                "presets": {
                  "title": "Presets",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Preset name",
                        "description": "Your own name displayed in Homebridge/HomeKit app.",
                        "required": false
                      },
                      "mode": {
                        "title": "Operation Mode",
                        "type": "string",
                        "default": "heat",
                        "oneOf": [
                          {
                            "title": "HEAT",
                            "enum": [
                              "heat"
                            ]
                          },
                          {
                            "title": "DRY",
                            "enum": [
                              "dry"
                            ]
                          },
                          {
                            "title": "COOL",
                            "enum": [
                              "cool"
                            ]
                          },
                          {
                            "title": "FAN",
                            "enum": [
                              "fan"
                            ]
                          },
                          {
                            "title": "AUTO",
                            "enum": [
                              "auto"
                            ]
                          }
                        ],
                        "description": "Select the operation mode.",
                        "required": false
                      },
                      "setTemp": {
                        "title": "Target Temperature",
                        "type": "number",
                        "minimum": 10,
                        "maximum": 31,
                        "multipleOf": 0.5,
                        "default": 20,
                        "description": "Here set the target temperature.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices].miElHvac.presets[arrayIndices].mode === heat || return model.devices[arrayIndices].miElHvac.presets[arrayIndices].mode === cool || return model.devices[arrayIndices].miElHvac.presets[arrayIndices].mode === auto;"
                        },
                        "required": false
                      },
                      "fanSpeed": {
                        "title": "Fan Speed",
                        "type": "string",
                        "oneOf": [
                          {
                            "title": "AUTO",
                            "enum": [
                              "auto"
                            ]
                          },
                          {
                            "title": "QUIET",
                            "enum": [
                              "quiet"
                            ]
                          },
                          {
                            "title": "1",
                            "enum": [
                              "1"
                            ]
                          },
                          {
                            "title": "2",
                            "enum": [
                              "2"
                            ]
                          },
                          {
                            "title": "3",
                            "enum": [
                              "3"
                            ]
                          },
                          {
                            "title": "4",
                            "enum": [
                              "4"
                            ]
                          }
                        ],
                        "description": "Select the fan speed.",
                        "required": false
                      },
                      "swingV": {
                        "title": "VANE Vertical Direction",
                        "type": "string",
                        "default": "auto",
                        "oneOf": [
                          {
                            "title": "AUTO",
                            "enum": [
                              "auto"
                            ]
                          },
                          {
                            "title": "UP",
                            "enum": [
                              "up"
                            ]
                          },
                          {
                            "title": "UP MIDDLE",
                            "enum": [
                              "up_middle"
                            ]
                          },
                          {
                            "title": "CENTER",
                            "enum": [
                              "center"
                            ]
                          },
                          {
                            "title": "DOWN MIDDLE",
                            "enum": [
                              "down_middle"
                            ]
                          },
                          {
                            "title": "DOWN",
                            "enum": [
                              "down"
                            ]
                          },
                          {
                            "title": "SWING",
                            "enum": [
                              "swing"
                            ]
                          }
                        ],
                        "description": "Select the vane vertical direction.",
                        "required": false
                      },
                      "swingH": {
                        "title": "VANE Horizontal Direction",
                        "type": "string",
                        "default": "swing",
                        "oneOf": [
                          {
                            "title": "LEFT",
                            "enum": [
                              "left"
                            ]
                          },
                          {
                            "title": "LEFT MIDDLE",
                            "enum": [
                              "left_middle"
                            ]
                          },
                          {
                            "title": "CENTER",
                            "enum": [
                              "center"
                            ]
                          },
                          {
                            "title": "RIGHT MIDDLE",
                            "enum": [
                              "right_middle"
                            ]
                          },
                          {
                            "title": "RIGHT",
                            "enum": [
                              "right"
                            ]
                          },
                          {
                            "title": "SPLIT",
                            "enum": [
                              "split"
                            ]
                          },
                          {
                            "title": "SWING",
                            "enum": [
                              "swing"
                            ]
                          }
                        ],
                        "description": "Select the vane horizontal direction.",
                        "required": false
                      },
                      "displayType": {
                        "title": "Type",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 5,
                        "default": 0,
                        "oneOf": [
                          {
                            "title": "None/Disabled",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "Outlet",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "Switch",
                            "enum": [
                              2
                            ]
                          },
                          {
                            "title": "Motion Sensor",
                            "enum": [
                              3
                            ]
                          },
                          {
                            "title": "Occupancy Sensor",
                            "enum": [
                              4
                            ]
                          },
                          {
                            "title": "Contact Sensor",
                            "enum": [
                              5
                            ]
                          }
                        ],
                        "description": "Select the characteristic type to be displayed in HomeKit app.",
                        "required": true
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "default": false,
                        "description": "Enable/disable the accessory name as a prefix for button/sensor name.",
                        "required": false
                      }
                    }
                  }
                },
                "buttons": {
                  "title": "Button",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Button name",
                        "description": "Your own name displayed in Homebridge/HomeKit app.",
                        "required": false
                      },
                      "mode": {
                        "title": "Mode",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 53,
                        "default": 0,
                        "description": "Here select function.",
                        "oneOf": [
                          {
                            "title": "POWER",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "MODE HEAT",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "MODE DRY",
                            "enum": [
                              2
                            ]
                          },
                          {
                            "title": "MODE COOL",
                            "enum": [
                              3
                            ]
                          },
                          {
                            "title": "MODE FAN",
                            "enum": [
                              4
                            ]
                          },
                          {
                            "title": "MODE AUTO",
                            "enum": [
                              5
                            ]
                          },
                          {
                            "title": "MODE PURIFY (not implemented)",
                            "enum": [
                              6
                            ]
                          },
                          {
                            "title": "VANE H AUTO",
                            "enum": [
                              10
                            ]
                          },
                          {
                            "title": "VANE H LEFT",
                            "enum": [
                              11
                            ]
                          },
                          {
                            "title": "VANE H LEFT MIDDLE",
                            "enum": [
                              12
                            ]
                          },
                          {
                            "title": "VANE H CENTER",
                            "enum": [
                              13
                            ]
                          },
                          {
                            "title": "VANE H RIGHT MIDDLE",
                            "enum": [
                              14
                            ]
                          },
                          {
                            "title": "VANE H RIGHT",
                            "enum": [
                              15
                            ]
                          },
                          {
                            "title": "VANE H SPLIT",
                            "enum": [
                              16
                            ]
                          },
                          {
                            "title": "VANE H SWING",
                            "enum": [
                              17
                            ]
                          },
                          {
                            "title": "VANE V AUTO",
                            "enum": [
                              20
                            ]
                          },
                          {
                            "title": "VANE V UP",
                            "enum": [
                              21
                            ]
                          },
                          {
                            "title": "VANE V UP MIDDLE",
                            "enum": [
                              22
                            ]
                          },
                          {
                            "title": "VANE V CENTER",
                            "enum": [
                              23
                            ]
                          },
                          {
                            "title": "VANE V DOWN MIDDLE",
                            "enum": [
                              24
                            ]
                          },
                          {
                            "title": "VANE V DOWN",
                            "enum": [
                              25
                            ]
                          },
                          {
                            "title": "VANE V SWING",
                            "enum": [
                              26
                            ]
                          },
                          {
                            "title": "FAN AUTO",
                            "enum": [
                              30
                            ]
                          },
                          {
                            "title": "FAN QUIET",
                            "enum": [
                              31
                            ]
                          },
                          {
                            "title": "FAN SPEED 1",
                            "enum": [
                              32
                            ]
                          },
                          {
                            "title": "FAN SPEED 2",
                            "enum": [
                              33
                            ]
                          },
                          {
                            "title": "FAN SPEED 3",
                            "enum": [
                              34
                            ]
                          },
                          {
                            "title": "FAN SPEED 4",
                            "enum": [
                              35
                            ]
                          },
                          {
                            "title": "AIR DIRECTION EVEN (only as sensor now)",
                            "enum": [
                              40
                            ]
                          },
                          {
                            "title": "AIR DIRECTION INDIRECT (only as sensor now)",
                            "enum": [
                              41
                            ]
                          },
                          {
                            "title": "AIR DIRECTION DIRECT (only as sensor now)",
                            "enum": [
                              42
                            ]
                          },
                          {
                            "title": "LOCK CONTROL All (only as sensor now)",
                            "enum": [
                              50
                            ]
                          },
                          {
                            "title": "LOCK CONTROL POWER (only as sensor now)",
                            "enum": [
                              51
                            ]
                          },
                          {
                            "title": "LOCK CONTROL MODE (only as sensor now)",
                            "enum": [
                              52
                            ]
                          },
                          {
                            "title": "LOCK CONTROL TEMPERATURE (only as sensor now)",
                            "enum": [
                              53
                            ]
                          }
                        ],
                        "required": false
                      },
                      "displayType": {
                        "title": "Type",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2,
                        "default": 0,
                        "oneOf": [
                          {
                            "title": "None/Disabled",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "Outlet",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "Switch",
                            "enum": [
                              2
                            ]
                          }
                        ],
                        "description": "Select the characteristic type to be displayed in HomeKit app.",
                        "required": true
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "default": false,
                        "description": "Enable/disable the accessory name as a prefix for button name.",
                        "required": false
                      }
                    }
                  }
                },
                "sensors": {
                  "title": "Sensor",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Sensor name",
                        "description": "Your own name displayed in Homebridge/HomeKit app.",
                        "required": false
                      },
                      "mode": {
                        "title": "Mode",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 94,
                        "default": 0,
                        "description": "Here select function.",
                        "oneOf": [
                          {
                            "title": "POWER",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "MODE HEAT",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "MODE DRY",
                            "enum": [
                              2
                            ]
                          },
                          {
                            "title": "MODE COOL",
                            "enum": [
                              3
                            ]
                          },
                          {
                            "title": "MODE FAN",
                            "enum": [
                              4
                            ]
                          },
                          {
                            "title": "MODE AUTO",
                            "enum": [
                              5
                            ]
                          },
                          {
                            "title": "MODE PURIFY (not implemented)",
                            "enum": [
                              6
                            ]
                          },
                          {
                            "title": "VANE H AUTO",
                            "enum": [
                              10
                            ]
                          },
                          {
                            "title": "VANE H LEFT",
                            "enum": [
                              11
                            ]
                          },
                          {
                            "title": "VANE H LEFT MIDDLE",
                            "enum": [
                              12
                            ]
                          },
                          {
                            "title": "VANE H CENTER",
                            "enum": [
                              13
                            ]
                          },
                          {
                            "title": "VANE H RIGHT MIDDLE",
                            "enum": [
                              14
                            ]
                          },
                          {
                            "title": "VANE H RIGHT",
                            "enum": [
                              15
                            ]
                          },
                          {
                            "title": "VANE H SPLIT",
                            "enum": [
                              16
                            ]
                          },
                          {
                            "title": "VANE H SWING",
                            "enum": [
                              17
                            ]
                          },
                          {
                            "title": "VANE V AUTO",
                            "enum": [
                              20
                            ]
                          },
                          {
                            "title": "VANE V UP",
                            "enum": [
                              21
                            ]
                          },
                          {
                            "title": "VANE V UP MIDDLE",
                            "enum": [
                              22
                            ]
                          },
                          {
                            "title": "VANE V CENTER",
                            "enum": [
                              23
                            ]
                          },
                          {
                            "title": "VANE V DOWN MIDDLE",
                            "enum": [
                              24
                            ]
                          },
                          {
                            "title": "VANE V DOWN",
                            "enum": [
                              25
                            ]
                          },
                          {
                            "title": "VANE V SWING",
                            "enum": [
                              26
                            ]
                          },
                          {
                            "title": "FAN AUTO",
                            "enum": [
                              30
                            ]
                          },
                          {
                            "title": "FAN QUIET",
                            "enum": [
                              31
                            ]
                          },
                          {
                            "title": "FAN SPEED 1",
                            "enum": [
                              32
                            ]
                          },
                          {
                            "title": "FAN SPEED 2",
                            "enum": [
                              33
                            ]
                          },
                          {
                            "title": "FAN SPEED 3",
                            "enum": [
                              34
                            ]
                          },
                          {
                            "title": "FAN SPEED 4",
                            "enum": [
                              35
                            ]
                          },
                          {
                            "title": "AIR DIRECTION EVEN",
                            "enum": [
                              40
                            ]
                          },
                          {
                            "title": "AIR DIRECTION INDIRECT",
                            "enum": [
                              41
                            ]
                          },
                          {
                            "title": "AIR DIRECTION DIRECT",
                            "enum": [
                              42
                            ]
                          },
                          {
                            "title": "LOCK CONTROL All",
                            "enum": [
                              50
                            ]
                          },
                          {
                            "title": "LOCK CONTROL POWER",
                            "enum": [
                              51
                            ]
                          },
                          {
                            "title": "LOCK CONTROL MODE",
                            "enum": [
                              52
                            ]
                          },
                          {
                            "title": "LOCK CONTROL TEMPERATURE",
                            "enum": [
                              53
                            ]
                          },
                          {
                            "title": "REMOTE TEMPERATURE STATE",
                            "enum": [
                              60
                            ]
                          },
                          {
                            "title": "OPERATION STAGE NORMAL",
                            "enum": [
                              70
                            ]
                          },
                          {
                            "title": "OPERATION STAGE DEFROST",
                            "enum": [
                              71
                            ]
                          },
                          {
                            "title": "OPERATION STAGE PREHEAT",
                            "enum": [
                              72
                            ]
                          },
                          {
                            "title": "OPERATION STAGE STANDBY",
                            "enum": [
                              73
                            ]
                          },
                          {
                            "title": "FAN STAGE OFF",
                            "enum": [
                              80
                            ]
                          },
                          {
                            "title": "FAN STAGE QUIET",
                            "enum": [
                              81
                            ]
                          },
                          {
                            "title": "FAN STAGE 1",
                            "enum": [
                              82
                            ]
                          },
                          {
                            "title": "FAN STAGE 2",
                            "enum": [
                              83
                            ]
                          },
                          {
                            "title": "FAN STAGE 3",
                            "enum": [
                              84
                            ]
                          },
                          {
                            "title": "FAN STAGE 4",
                            "enum": [
                              85
                            ]
                          },
                          {
                            "title": "FAN STAGE 5",
                            "enum": [
                              86
                            ]
                          },
                          {
                            "title": "MODE STAGE AUTO OFF",
                            "enum": [
                              90
                            ]
                          },
                          {
                            "title": "MODE STAGE AUTO FAN",
                            "enum": [
                              91
                            ]
                          },
                          {
                            "title": "MODE STAGE AUTO HEAT",
                            "enum": [
                              92
                            ]
                          },
                          {
                            "title": "MODE STAGE AUTO COOL",
                            "enum": [
                              93
                            ]
                          },
                          {
                            "title": "MODE STAGE AUTO LEADER",
                            "enum": [
                              94
                            ]
                          }
                        ],
                        "required": false
                      },
                      "displayType": {
                        "title": "Type",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 3,
                        "default": 0,
                        "oneOf": [
                          {
                            "title": "None/Disabled",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "Motion Sensor",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "Occupancy Sensor",
                            "enum": [
                              2
                            ]
                          },
                          {
                            "title": "Contact Sensor",
                            "enum": [
                              3
                            ]
                          }
                        ],
                        "description": "Select the characteristic type to be displayed in HomeKit app.",
                        "required": true
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "default": false,
                        "description": "Enable/disable the accessory name as a prefix for sensor name.",
                        "required": false
                      }
                    }
                  }
                },
                "frostProtect": {
                  "title": "Frost Protect",
                  "type": "object",
                  "properties": {
                    "enable": {
                      "title": "Activate",
                      "type": "boolean",
                      "default": false,
                      "description": "This enable frost protect function.",
                      "required": false
                    },
                    "lowTemp": {
                      "title": "Low Temperature",
                      "type": "number",
                      "minimum": 4,
                      "maximum": 14,
                      "multipleOf": 0.5,
                      "default": 14,
                      "description": "Here set the low temperature at which device start to frost protect.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.frostProtect.enable === true;"
                      },
                      "required": false
                    },
                    "highTemp": {
                      "title": "High Temperature",
                      "type": "number",
                      "minimum": 6,
                      "maximum": 16,
                      "multipleOf": 0.5,
                      "default": 16,
                      "description": "Here set the high temperature at which device will be disable.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.frostProtect.enable === true;"
                      },
                      "required": false
                    }
                  }
                },
                "temperatureSensor": {
                  "title": "Room",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
                  "required": false
                },
                "temperatureSensorOutdoor": {
                  "title": "Outdoor",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
                  "required": false
                }
              }
            },
            "relaysDisplayType": {
              "title": "Display Type",
              "type": "integer",
              "minimum": 0,
              "maximum": 1,
              "default": 0,
              "oneOf": [
                {
                  "title": "Outlet",
                  "enum": [
                    0
                  ]
                },
                {
                  "title": "Switch",
                  "enum": [
                    1
                  ]
                }
              ],
              "description": "Here select characteristic display type for relays which are exposed in the HomeKit app.",
              "required": false
            },
            "relaysNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "default": false,
              "description": "Here enable/disable the accessory name as a prefix for relays name.",
              "required": false
            },
            "lightsNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "default": false,
              "description": "Here enable/disable the accessory name as a prefix for light name.",
              "required": false
            },
            "sensorsNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "default": false,
              "description": "Here enable/disable the accessory name as a prefix for sensors name.",
              "required": false
            },
            "loadNameFromDevice": {
              "title": "Load Name From Device",
              "type": "boolean",
              "default": false,
              "description": "If enabled, the accessory name will be loaded direct from device.",
              "required": false
            },
            "refreshInterval": {
              "title": "Refresh Interval",
              "type": "number",
              "minimum": 0.5,
              "maximum": 60,
              "multipleOf": 0.5,
              "default": 5,
              "description": "Here set the data refresh time in (sec).",
              "required": true
            },
            "disableLogDeviceInfo": {
              "title": "Disable Log Device Info",
              "type": "boolean",
              "default": false,
              "description": "This disable logging device info by every connections device to the network.",
              "required": false
            },
            "disableLogInfo": {
              "title": "Disable Log Info",
              "type": "boolean",
              "default": false,
              "required": false
            },
            "disableLogSuccess": {
              "title": "Disable Log Success",
              "type": "boolean",
              "default": false,
              "required": false
            },
            "disableLogWarn": {
              "title": "Disable Log Warn",
              "type": "boolean",
              "default": false,
              "required": false
            },
            "disableLogError": {
              "title": "Disable Log Error",
              "type": "boolean",
              "default": false,
              "required": false
            },
            "enableDebugMode": {
              "title": "Enable Log Debug",
              "type": "boolean",
              "default": false,
              "required": false
            }
          }
        }
      }
    }
  },
  "layout": [
    {
      "key": "devices",
      "type": "tabarray",
      "title": "{{ value.name || 'device' }}",
      "items": [
        "devices[].name",
        "devices[].host",
        "devices[].disableAccessory",
        {
          "key": "devices[]",
          "type": "section",
          "title": "Advanced Settings",
          "expandable": true,
          "expanded": false,
          "items": [
            {
              "key": "devices[]",
              "type": "tabarray",
              "title": "{{ value.title }}",
              "items": [
                {
                  "key": "devices[].miElHvac",
                  "title": "Mitsubishi AC",
                  "items": [
                    "devices[].miElHvac.heatDryFanMode",
                    "devices[].miElHvac.coolDryFanMode",
                    "devices[].miElHvac.autoDryFanMode",
                    {
                      "key": "devices[].miElHvac.remoteTemperatureSensor",
                      "type": "section",
                      "title": "Remote Temperature Sensor",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        "devices[].miElHvac.remoteTemperatureSensor.enable",
                        "devices[].miElHvac.remoteTemperatureSensor.path",
                        "devices[].miElHvac.remoteTemperatureSensor.refreshInterval",
                        "devices[].miElHvac.remoteTemperatureSensor.auth",
                        "devices[].miElHvac.remoteTemperatureSensor.user",
                        {
                          "key": "devices[].miElHvac.remoteTemperatureSensor.passwd",
                          "type": "password"
                        }
                      ]
                    },
                    {
                      "key": "devices[].miElHvac",
                      "type": "section",
                      "title": "Presets",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        {
                          "key": "devices[].miElHvac.presets",
                          "type": "tabarray",
                          "title": "{{ value.name  || 'preset'}}",
                          "items": [
                            "devices[].miElHvac.presets[].name",
                            "devices[].miElHvac.presets[].mode",
                            "devices[].miElHvac.presets[].setTemp",
                            "devices[].miElHvac.presets[].fanSpeed",
                            "devices[].miElHvac.presets[].swingV",
                            "devices[].miElHvac.presets[].swingH",
                            "devices[].miElHvac.presets[].displayType",
                            "devices[].miElHvac.presets[].namePrefix"
                          ]
                        }
                      ]
                    },
                    {
                      "key": "devices[].miElHvac",
                      "type": "section",
                      "title": "Buttons",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        {
                          "key": "devices[].miElHvac.buttons",
                          "type": "tabarray",
                          "title": "{{ value.name || 'button' }}",
                          "items": [
                            "devices[].miElHvac.buttons[].name",
                            "devices[].miElHvac.buttons[].mode",
                            "devices[].miElHvac.buttons[].displayType",
                            "devices[].miElHvac.buttons[].namePrefix"
                          ]
                        }
                      ]
                    },
                    {
                      "key": "devices[].miElHvac",
                      "type": "section",
                      "title": "Sensors",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        "devices[].miElHvac.temperatureSensor",
                        "devices[].miElHvac.temperatureSensorOutdoor",
                        {
                          "key": "devices[].miElHvac.sensors",
                          "type": "tabarray",
                          "title": "{{ value.name || 'sensor' }}",
                          "items": [
                            "devices[].miElHvac.sensors[].name",
                            "devices[].miElHvac.sensors[].mode",
                            "devices[].miElHvac.sensors[].displayType",
                            "devices[].miElHvac.sensors[].namePrefix"
                          ]
                        }
                      ]
                    },
                    {
                      "key": "devices[].miElHvac.frostProtect",
                      "type": "section",
                      "title": "Frost Protection",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        "devices[].miElHvac.frostProtect.enable",
                        "devices[].miElHvac.frostProtect.lowTemp",
                        "devices[].miElHvac.frostProtect.highTemp"
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Relays",
                  "items": [
                    "devices[].relaysDisplayType",
                    "devices[].relaysNamePrefix"
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Lights",
                  "items": [
                    "devices[].lightsNamePrefix"
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Sensors",
                  "items": [
                    "devices[].sensorsNamePrefix"
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Authorization",
                  "items": [
                    "devices[].auth",
                    "devices[].user",
                    {
                      "key": "devices[].passwd",
                      "type": "password"
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Device",
                  "items": [
                    "devices[].loadNameFromDevice",
                    "devices[].refreshInterval"
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Log",
                  "items": [
                    "devices[].disableLogDeviceInfo",
                    "devices[].disableLogInfo",
                    "devices[].disableLogSuccess",
                    "devices[].disableLogWarn",
                    "devices[].disableLogError",
                    "devices[].enableDebugMode"
                  ]
                }
              ]
            }
          ],
          "condition": {
            "functionBody": "return model.devices[arrayIndices].disableAccessory === false;"
          }
        }
      ]
    }
  ]
}