{
  "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": {
      "name": {
        "title": "Platform",
        "type": "string",
        "default": "Tasmota Control"
      },
      "devices": {
        "title": "Devices",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Name",
              "type": "string",
              "placeholder": "socket"
            },
            "host": {
              "title": "IP/Hostname",
              "type": "string",
              "placeholder": "192.168.1.5",
              "format": "hostname"
            },
            "auth": {
              "title": "Authorization",
              "type": "boolean",
              "default": false
            },
            "user": {
              "title": "User",
              "type": "string",
              "placeholder": "username",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].auth === true;"
              }
            },
            "passwd": {
              "title": "Password",
              "type": "string",
              "placeholder": "password",
              "format": "password",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].auth === true;"
              }
            },
            "disableAccessory": {
              "title": "Disable Accessory",
              "type": "boolean",
              "default": false,
              "description": "Here You can disable this accessory."
            },
            "miElHvac": {
              "title": "RESTFul",
              "type": "object",
              "properties": {
                "heatDryFanMode": {
                  "title": "Heat",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "anyOf": [
                    {
                      "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."
                },
                "coolDryFanMode": {
                  "title": "Cool",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "anyOf": [
                    {
                      "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."
                },
                "autoDryFanMode": {
                  "title": "Auto",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "anyOf": [
                    {
                      "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."
                },
                "remoteTemperatureSensor": {
                  "title": "External Sensor",
                  "type": "object",
                  "properties": {
                    "enable": {
                      "title": "Activate",
                      "type": "boolean",
                      "default": false,
                      "description": "This enable external remote sensor for A.C. device."
                    },
                    "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;"
                      }
                    },
                    "refreshInterval": {
                      "title": "Refresh Interval",
                      "type": "number",
                      "minimum": 1.0,
                      "maximum": 600,
                      "multipleOf": 0.5,
                      "description": "Here set the sensor data refresh time in (sec).",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true;"
                      }
                    },
                    "auth": {
                      "title": "Authorization",
                      "type": "boolean",
                      "default": false,
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true;"
                      }
                    },
                    "user": {
                      "title": "User",
                      "type": "string",
                      "placeholder": "username",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.enable === true && model.devices[arrayIndices].miElHvac.remoteTemperatureSensor.auth === true;"
                      }
                    },
                    "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;"
                      }
                    }
                  },
                  "allOf": [
                    {
                      "if": {
                        "required": [
                          "enable"
                        ],
                        "properties": {
                          "enable": {
                            "const": true
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "path",
                          "refreshInterval"
                        ]
                      }
                    },
                    {
                      "if": {
                        "required": [
                          "auth"
                        ],
                        "properties": {
                          "auth": {
                            "const": true
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "user",
                          "passwd"
                        ]
                      }
                    }
                  ]
                },
                "presets": {
                  "title": "Presets",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "displayType": {
                        "title": "Type",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 5,
                        "anyOf": [
                          {
                            "title": "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."
                      },
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Preset name",
                        "description": "Your own name displayed in Homebridge/HomeKit app."
                      },
                      "mode": {
                        "title": "Operation Mode",
                        "type": "string",
                        "anyOf": [
                          {
                            "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.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "setTemp": {
                        "title": "Target Temperature",
                        "type": "number",
                        "minimum": 10,
                        "maximum": 31,
                        "multipleOf": 0.5,
                        "description": "Here set the target temperature.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0 && (model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].mode === heat || model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].mode === cool || model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].mode === auto);"
                        }
                      },
                      "fanSpeed": {
                        "title": "Fan Speed",
                        "type": "string",
                        "anyOf": [
                          {
                            "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.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "swingV": {
                        "title": "VANE Vertical Direction",
                        "type": "string",
                        "anyOf": [
                          {
                            "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.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "swingH": {
                        "title": "VANE Horizontal Direction",
                        "type": "string",
                        "anyOf": [
                          {
                            "title": "AIR DIRECTION",
                            "enum": [
                              "airdirection"
                            ]
                          },
                          {
                            "title": "LEFT",
                            "enum": [
                              "left"
                            ]
                          },
                          {
                            "title": "LEFT MIDDLE",
                            "enum": [
                              "left_middle"
                            ]
                          },
                          {
                            "title": "LEFT CENTER",
                            "enum": [
                              "left_center"
                            ]
                          },
                          {
                            "title": "CENTER",
                            "enum": [
                              "center"
                            ]
                          },
                          {
                            "title": "RIGHT CENTER",
                            "enum": [
                              "right_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.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "description": "Enable/disable the accessory name as a prefix for button/sensor name.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.presets[arrayIndices[1]].displayType > 0;"
                        }
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "required": [
                            "displayType"
                          ],
                          "properties": {
                            "displayType": {
                              "enum": [
                                1,
                                2,
                                3,
                                4,
                                5
                              ]
                            }
                          }
                        },
                        "then": {
                          "required": [
                            "mode",
                            "setTemp",
                            "fanSpeed",
                            "swingV",
                            "swingH"
                          ]
                        }
                      }
                    ]
                  }
                },
                "buttons": {
                  "title": "Button",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "displayType": {
                        "title": "Type",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2,
                        "anyOf": [
                          {
                            "title": "Disabled",
                            "enum": [
                              0
                            ]
                          },
                          {
                            "title": "Outlet",
                            "enum": [
                              1
                            ]
                          },
                          {
                            "title": "Switch",
                            "enum": [
                              2
                            ]
                          }
                        ],
                        "description": "Select the characteristic type to be displayed in HomeKit app."
                      },
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Button name",
                        "description": "Your own name displayed in Homebridge/HomeKit app."
                      },
                      "mode": {
                        "title": "Mode",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 63,
                        "description": "Here select function.",
                        "anyOf": [
                          {
                            "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": "VANE H LEFT",
                            "enum": [
                              10
                            ]
                          },
                          {
                            "title": "VANE H LEFT MIDDLE",
                            "enum": [
                              11
                            ]
                          },
                          {
                            "title": "VANE H LEFT CENTER",
                            "enum": [
                              12
                            ]
                          },
                          {
                            "title": "VANE H CENTER",
                            "enum": [
                              13
                            ]
                          },
                          {
                            "title": "VANE H RIGHT CENTER",
                            "enum": [
                              14
                            ]
                          },
                          {
                            "title": "VANE H RIGHT MIDDLE",
                            "enum": [
                              15
                            ]
                          },
                          {
                            "title": "VANE H RIGHT",
                            "enum": [
                              16
                            ]
                          },
                          {
                            "title": "VANE H SPLIT",
                            "enum": [
                              17
                            ]
                          },
                          {
                            "title": "VANE H SWING",
                            "enum": [
                              18
                            ]
                          },
                          {
                            "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 INDIRECT",
                            "enum": [
                              40
                            ]
                          },
                          {
                            "title": "AIR DIRECTION DIRECT",
                            "enum": [
                              41
                            ]
                          },
                          {
                            "title": "AIR DIRECTION EVEN",
                            "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": "PURIFY",
                            "enum": [
                              60
                            ]
                          },
                          {
                            "title": "ECONO COOL",
                            "enum": [
                              61
                            ]
                          },
                          {
                            "title": "POWER FULL",
                            "enum": [
                              62
                            ]
                          },
                          {
                            "title": "NIGHT MODE",
                            "enum": [
                              63
                            ]
                          }
                        ],
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.buttons[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "description": "Enable/disable the accessory name as a prefix for button name.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.buttons[arrayIndices[1]].displayType > 0;"
                        }
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "required": [
                            "displayType"
                          ],
                          "properties": {
                            "displayType": {
                              "enum": [
                                1,
                                2
                              ]
                            }
                          }
                        },
                        "then": {
                          "required": [
                            "mode"
                          ]
                        }
                      }
                    ]
                  }
                },
                "sensors": {
                  "title": "Sensor",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "displayType": {
                        "title": "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": "Select the characteristic type to be displayed in HomeKit app."
                      },
                      "name": {
                        "title": "Name",
                        "type": "string",
                        "placeholder": "Sensor name",
                        "description": "Your own name displayed in Homebridge/HomeKit app."
                      },
                      "mode": {
                        "title": "Mode",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 94,
                        "description": "Here select function.",
                        "anyOf": [
                          {
                            "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": "PURIFY",
                            "enum": [
                              6
                            ]
                          },
                          {
                            "title": "VANE H LEFT",
                            "enum": [
                              10
                            ]
                          },
                          {
                            "title": "VANE H LEFT MIDDLE",
                            "enum": [
                              11
                            ]
                          },
                          {
                            "title": "VANE H LEFT CENTER",
                            "enum": [
                              12
                            ]
                          },
                          {
                            "title": "VANE H CENTER",
                            "enum": [
                              13
                            ]
                          },
                          {
                            "title": "VANE H RIGHT CENTER",
                            "enum": [
                              14
                            ]
                          },
                          {
                            "title": "VANE H RIGHT MIDDLE",
                            "enum": [
                              15
                            ]
                          },
                          {
                            "title": "VANE H RIGHT",
                            "enum": [
                              16
                            ]
                          },
                          {
                            "title": "VANE H SPLIT",
                            "enum": [
                              17
                            ]
                          },
                          {
                            "title": "VANE H SWING",
                            "enum": [
                              18
                            ]
                          },
                          {
                            "title": "VANE H AIR DIRECTION",
                            "enum": [
                              19
                            ]
                          },
                          {
                            "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 STATUS NORMAL",
                            "enum": [
                              70
                            ]
                          },
                          {
                            "title": "OPERATION STATUS FILTER",
                            "enum": [
                              71
                            ]
                          },
                          {
                            "title": "OPERATION STATUS DEFROST",
                            "enum": [
                              72
                            ]
                          },
                          {
                            "title": "OPERATION STATUS STANDBY",
                            "enum": [
                              73
                            ]
                          },
                          {
                            "title": "OPERATION STATUS PREHEAT",
                            "enum": [
                              74
                            ]
                          },
                          {
                            "title": "FAN STATUS OFF",
                            "enum": [
                              80
                            ]
                          },
                          {
                            "title": "FAN STATUS QUIET",
                            "enum": [
                              81
                            ]
                          },
                          {
                            "title": "FAN STATUS 1",
                            "enum": [
                              82
                            ]
                          },
                          {
                            "title": "FAN STATUS 2",
                            "enum": [
                              83
                            ]
                          },
                          {
                            "title": "FAN STATUS 3",
                            "enum": [
                              84
                            ]
                          },
                          {
                            "title": "FAN STATUS 4",
                            "enum": [
                              85
                            ]
                          },
                          {
                            "title": "FAN STATUS 5",
                            "enum": [
                              86
                            ]
                          },
                          {
                            "title": "MODE STATUS AUTO OFF",
                            "enum": [
                              90
                            ]
                          },
                          {
                            "title": "MODE STATUS AUTO FAN",
                            "enum": [
                              91
                            ]
                          },
                          {
                            "title": "MODE STATUS AUTO HEAT",
                            "enum": [
                              92
                            ]
                          },
                          {
                            "title": "MODE STATUS AUTO COOL",
                            "enum": [
                              93
                            ]
                          },
                          {
                            "title": "MODE STATUS AUTO LEADER",
                            "enum": [
                              94
                            ]
                          }
                        ],
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.sensors[arrayIndices[1]].displayType > 0;"
                        }
                      },
                      "namePrefix": {
                        "title": "Prefix",
                        "type": "boolean",
                        "description": "Enable/disable the accessory name as a prefix for sensor name.",
                        "condition": {
                          "functionBody": "return model.devices[arrayIndices[0]].miElHvac.sensors[arrayIndices[1]].displayType > 0;"
                        }
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "required": [
                            "displayType"
                          ],
                          "properties": {
                            "displayType": {
                              "enum": [
                                1,
                                2,
                                3
                              ]
                            }
                          }
                        },
                        "then": {
                          "required": [
                            "mode"
                          ]
                        }
                      }
                    ]
                  }
                },
                "frostProtect": {
                  "title": "Frost Protect",
                  "type": "object",
                  "properties": {
                    "enable": {
                      "title": "Activate",
                      "type": "boolean",
                      "default": false,
                      "description": "This enable frost protect function."
                    },
                    "lowTemp": {
                      "title": "Low Temperature",
                      "type": "number",
                      "minimum": 4,
                      "maximum": 14,
                      "multipleOf": 0.5,
                      "description": "Here set the low temperature at which device start to frost protect.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.frostProtect.enable === true;"
                      }
                    },
                    "highTemp": {
                      "title": "High Temperature",
                      "type": "number",
                      "minimum": 6,
                      "maximum": 16,
                      "multipleOf": 0.5,
                      "description": "Here set the high temperature at which device will be disable.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].miElHvac.frostProtect.enable === true;"
                      }
                    }
                  },
                  "allOf": [
                    {
                      "if": {
                        "required": [
                          "enable"
                        ],
                        "properties": {
                          "enable": {
                            "const": true
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "lowTemp",
                          "highTemp"
                        ]
                      }
                    }
                  ]
                },
                "temperatureSensor": {
                  "title": "Room",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable extra room temperature sensor to use with automations in HomeKit app."
                },
                "temperatureSensorOutdoor": {
                  "title": "Outdoor",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app."
                }
              }
            },
            "relaysDisplayType": {
              "title": "Display Type",
              "type": "integer",
              "minimum": 0,
              "maximum": 1,
              "anyOf": [
                {
                  "title": "Outlet",
                  "enum": [
                    0
                  ]
                },
                {
                  "title": "Switch",
                  "enum": [
                    1
                  ]
                }
              ],
              "description": "Here select characteristic display type for relays which are exposed in the HomeKit app."
            },
            "relaysNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "description": "Here enable/disable the accessory name as a prefix for relays name."
            },
            "lightsNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "description": "Here enable/disable the accessory name as a prefix for light name."
            },
            "fansNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "description": "Here enable/disable the accessory name as a prefix for fan name."
            },
            "sensorsNamePrefix": {
              "title": "Name Prefix",
              "type": "boolean",
              "description": "Here enable/disable the accessory name as a prefix for sensors name."
            },
            "loadNameFromDevice": {
              "title": "Load Name From Device",
              "type": "boolean",
              "description": "If enabled, the accessory name will be loaded direct from device."
            },
            "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)."
            },
            "log": {
              "title": "Log",
              "type": "object",
              "properties": {
                "deviceInfo": {
                  "title": "Device Info",
                  "type": "boolean",
                  "default": true,
                  "description": "This enable log level device info, will display overall device info by every plugin restart"
                },
                "success": {
                  "title": "Success",
                  "type": "boolean",
                  "default": true,
                  "description": "This enable log level success"
                },
                "info": {
                  "title": "Info",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable log level info"
                },
                "warn": {
                  "title": "Warn",
                  "type": "boolean",
                  "default": true,
                  "description": "This enable log level warn"
                },
                "error": {
                  "title": "Error",
                  "type": "boolean",
                  "default": true,
                  "description": "This enable log level error"
                },
                "debug": {
                  "title": "Debug",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable log level debug"
                }
              }
            }
          },
          "required": [
            "name",
            "host"
          ],
          "allOf": [
            {
              "if": {
                "required": [
                  "auth"
                ],
                "properties": {
                  "auth": {
                    "const": true
                  }
                }
              },
              "then": {
                "required": [
                  "user",
                  "passwd"
                ]
              }
            }
          ]
        }
      }
    }
  },
  "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[].displayType",
                            "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[].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[].displayType",
                            "devices[].miElHvac.buttons[].name",
                            "devices[].miElHvac.buttons[].mode",
                            "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[].displayType",
                            "devices[].miElHvac.sensors[].name",
                            "devices[].miElHvac.sensors[].mode",
                            "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": "Fans",
                  "items": [
                    "devices[].fansNamePrefix"
                  ]
                },
                {
                  "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[].log",
                  "title": "Log",
                  "items": [
                    "devices[].log.deviceInfo",
                    "devices[].log.success",
                    "devices[].log.info",
                    "devices[].log.warn",
                    "devices[].log.error",
                    "devices[].log.debug"
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}