{
  "pluginAlias": "enphaseEnvoy",
  "pluginType": "platform",
  "singular": true,
  "fixArrays": true,
  "strictValidation": true,
  "headerDisplay": "This plugin works with Enphase Photovoltaic system. Devices exposed to the HomeKit needs to be added manually.",
  "footerDisplay": "For documentation, please see [GitHub repository](https://github.com/grzegorz914/homebridge-enphase-envoy).",
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "title": "Platform",
        "type": "string",
        "default": "Enphase Envoy"
      },
      "devices": {
        "title": "Devices",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "title": "Accessory name",
              "type": "string",
              "placeholder": "Accessory name",
              "description": "Accessory name to be displayed in Home app"
            },
            "host": {
              "title": "IP/Hostname",
              "type": "string",
              "placeholder": "192.168.1.10 or pv.local",
              "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)(\\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)$",
              "description": "IP Address or hostname of the Enphase Envoy gateway (defaults to envoy.local). For firmware v7+, please set the IP address."
            },
            "displayType": {
              "title": "Accessory type",
              "type": "integer",
              "minimum": 0,
              "maximum": 4,
              "default": 1,
              "description": "Accessory type for Home app",
              "anyOf": [
                {
                  "title": "Disabled",
                  "enum": [
                    0
                  ]
                },
                {
                  "title": "Light Bulb",
                  "enum": [
                    1
                  ]
                },
                {
                  "title": "Fan",
                  "enum": [
                    2
                  ]
                },
                {
                  "title": "Humidity Sensor",
                  "enum": [
                    3
                  ]
                },
                {
                  "title": "Carbon Monoxide Sensor",
                  "enum": [
                    4
                  ]
                }
              ]
            },
            "envoyFirmware7xxTokenGenerationMode": {
              "title": "Envoy Credentials Mode",
              "type": "integer",
              "minimum": 0,
              "maximum": 2,
              "default": 0,
              "description": "Method used login to Envoy api",
              "anyOf": [
                {
                  "title": "Envoy password",
                  "enum": [
                    0
                  ]
                },
                {
                  "title": "Enlighten credentials",
                  "enum": [
                    1
                  ]
                },
                {
                  "title": "Self-generated token",
                  "enum": [
                    2
                  ]
                }
              ]
            },
            "envoyPasswd": {
              "title": "Envoy password",
              "type": "string",
              "placeholder": "Envoy password",
              "description": "Envoy password (only if you altered the default password)",
              "format": "password",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 0;"
              }
            },
            "enlightenUser": {
              "title": "Enlighten username/email address",
              "type": "string",
              "placeholder": "user@example.com",
              "description": "Enphase Enlighten username.",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 1;"
              }
            },
            "enlightenPasswd": {
              "title": "Enlighten password",
              "type": "string",
              "placeholder": "password",
              "description": "Enlighten password",
              "format": "password",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 1;"
              }
            },
            "envoyToken": {
              "title": "Envoy token",
              "type": "string",
              "placeholder": "Token",
              "description": "Provide self-generated token (if relevant)",
              "format": "password",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 2;"
              }
            },
            "envoyTokenInstaller": {
              "title": "Installer",
              "type": "boolean",
              "description": "Enable for installer-provided token",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 2;"
              }
            },
            "energyMeter": {
              "title": "Energy Meter",
              "type": "boolean",
              "description": "Enables energy meter as a axtra accessory to display charts in EVE app"
            },
            "energyHistoryTime": {
              "title": "Energy History Save Time",
              "type": "integer",
              "default": 0,
              "description": "Here set the time (in years) for which the energy history data should be saved. Setting this to 0 will save all data without deleting old records (not recommended)"
            },
            "energyHistoryReserveSpace": {
              "title": "Energy History Reserve Space",
              "type": "integer",
              "default": 1,
              "description": "Here set the reserve space (in GB) after which the plugin will start deleting old records to prevent storage from being full. Setting this to 0 will disable this functionality (not recommended)"
            },
            "lockControl": {
              "title": "Lock Control",
              "type": "object",
              "properties": {
                "enable": {
                  "title": "Enable",
                  "type": "boolean",
                  "description": "Enables system control auto lock accessory"
                },
                "time": {
                  "title": "Auto Lock Time",
                  "type": "number",
                  "minimum": 1,
                  "maximum": 60,
                  "multipleOf": 1,
                  "description": "System control auto lock time (seconds)",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].lockControl.enable === true"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].lockControl.enable === true"
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "enable"
                    ],
                    "properties": {
                      "enable": {
                        "const": true
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "time"
                    ]
                  }
                }
              ]
            },
            "productionStateSensor": {
              "title": "Production State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Motion Sensor",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Occupancy Sensor",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Contact Sensor",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].productionStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].productionStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "plcLevelControl": {
              "title": "PLC Level Refresh Control",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Switch",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Outlet",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Lightbulb",
                      "enum": [
                        3
                      ]
                    }
                  ],
                  "description": "Accessory type for Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Accessory name",
                  "description": "Accessory name for Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].plcLevelControl.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].plcLevelControl.displayType > 0;"
                  }
                }
              }
            },
            "powerProductionSummary": {
              "title": "Power Summary",
              "type": "integer",
              "description": "Using the Enphase app, provide the total (W) of all microinverters (used to calculate percentage)"
            },
            "powerProductionLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "powerLevel": {
                    "title": "Power Level",
                    "type": "integer",
                    "minimum": 0,
                    "description": "Power level in (W) for comparison to sensor that was triggered",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "powerLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "energyProductionLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "energyLevel": {
                    "title": "Enargy Level",
                    "type": "integer",
                    "minimum": 0,
                    "description": "Energy level in (Wh) to compare to sensor that was triggered",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "energyLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "energyProductionLifetimeOffset": {
              "title": "Energy Lifetime Offset",
              "type": "integer",
              "description": "Here set offset in (Wh) for energy production (if needed)"
            },
            "gridProductionQualitySensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareType": {
                    "title": "Comparison type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Comparison type",
                    "anyOf": [
                      {
                        "title": "Current (A)",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Voltage (V)",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Frequency (Hz)",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Power Factor (cos φ)",
                        "enum": [
                          3
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareLevel": {
                    "title": "Comparison level",
                    "type": "number",
                    "description": "Here set level to compare at which the sensor fired.",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareType",
                        "compareMode",
                        "compareLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "powerConsumptionTotalLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "powerLevel": {
                    "title": "Power Level",
                    "type": "integer",
                    "minimum": 0,
                    "description": "Power level in (W) for comparison to sensor that was triggered",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "powerLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "energyConsumptionTotalLifetimeOffset": {
              "title": "Energy Lifetime Offset",
              "type": "integer",
              "description": "Offset in (Wh) for energy consumption total (if needed)"
            },
            "energyConsumptionTotalLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "energyLevel": {
                    "title": "Enargy Level",
                    "type": "integer",
                    "minimum": 0,
                    "description": "Energy level in (Wh) to compare to sensor that was triggered",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "energyLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "gridConsumptionTotalQualitySensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareType": {
                    "title": "Comparison type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Comparison type",
                    "anyOf": [
                      {
                        "title": "Current (A)",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Voltage (V)",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Frequency (Hz)",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Power Factor (cos φ)",
                        "enum": [
                          3
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareLevel": {
                    "title": "Comparison level",
                    "type": "number",
                    "description": "Here set level to compare at which the sensor fired.",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareType",
                        "compareMode",
                        "compareLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "powerConsumptionNetLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "powerLevel": {
                    "title": "Power Level",
                    "type": "integer",
                    "description": "Here set power level in (W) to compare at which the sensor fired, negative value (-) mean exporting energy to the grid.",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "powerLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "energyConsumptionNetLifetimeOffset": {
              "title": "Energy Lifetime Offset",
              "type": "integer",
              "description": "Offset in (Wh) for net energy consumption (if needed)"
            },
            "energyConsumptionNetLevelSensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "energyLevel": {
                    "title": "Energy Level",
                    "type": "integer",
                    "minimum": 0,
                    "description": "Here set energy level in (Wh) to compare at which the sensor fired.",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "energyLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "gridConsumptionNetQualitySensors": {
              "title": "Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory 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": "Accessory type for Home app"
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareType": {
                    "title": "Comparison type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Comparison type",
                    "anyOf": [
                      {
                        "title": "Current (A)",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Voltage (V)",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Frequency (Hz)",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Power Factor (cos φ)",
                        "enum": [
                          3
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionNetQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionNetQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "compareLevel": {
                    "title": "Comparison level",
                    "type": "number",
                    "description": "Here set level to compare at which the sensor fired.",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionNetQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionNetQualitySensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareType",
                        "compareMode",
                        "compareLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "qRelayStateSensor": {
              "title": "State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Motion Sensor",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Occupancy Sensor",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Contact Sensor",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].qRelayStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].qRelayStateSensor.displayType > 0;"
                  }
                },
                "multiphase": {
                  "title": "Multiphase",
                  "type": "boolean",
                  "description": "Enables multiphase support, if present",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].qRelayStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "acBatterieName": {
              "title": "Accessory name",
              "type": "string",
              "placeholder": "Accessory name",
              "description": "Accessory name for Home app, if not set will use default name"
            },
            "acBatterieBackupLevelSummaryAccessory": {
              "title": "AC Baterry Summary Accessory",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 5,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Light Bulb",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Fan",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Humidity Sensor",
                      "enum": [
                        3
                      ]
                    },
                    {
                      "title": "Carbon Monoxide Sensor",
                      "enum": [
                        4
                      ]
                    },
                    {
                      "title": "Battery",
                      "enum": [
                        5
                      ]
                    }
                  ]
                },
                "minSoc": {
                  "title": "Minimum SoC",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100,
                  "multipleOf": 1,
                  "description": "Minimum SoC level in (%) for ac baterry backup level summary.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].acBatterieBackupLevelSummaryAccessory.displayType > 0"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].acBatterieBackupLevelSummaryAccessory.displayType > 0"
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "displayType"
                    ],
                    "properties": {
                      "displayType": {
                        "enum": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "minSoc"
                    ]
                  }
                }
              ]
            },
            "acBatterieBackupLevelAccessory": {
              "title": "AC Battery Accessory",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Battery",
                      "enum": [
                        1
                      ]
                    }
                  ]
                },
                "minSoc": {
                  "title": "Minimum SoC",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100,
                  "multipleOf": 1,
                  "description": "Minimum SoC level in (%) for ac battery backup level.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].acBatterieBackupLevelAccessory.displayType > 0"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].acBatterieBackupLevelAccessory.displayType > 0"
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "displayType"
                    ],
                    "properties": {
                      "displayType": {
                        "enum": [
                          1
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "minSoc"
                    ]
                  }
                }
              ]
            },
            "enpowerDryContactsControl": {
              "title": "Dry Contacts Control",
              "type": "boolean",
              "description": "Enables control over dry contacts state"
            },
            "enpowerDryContactsSensor": {
              "title": "Dry Contacts Sensor",
              "type": "boolean",
              "description": "Enables monitoring of dry contacts state"
            },
            "enpowerGridStateControl": {
              "title": "Grid State Control",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type in Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Switch",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Outlet",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Lightbulb",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Accessory name",
                  "description": "Accessory name for Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enpowerGridStateControl.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enpowerGridStateControl.displayType > 0;"
                  }
                }
              }
            },
            "enpowerGridStateSensor": {
              "title": "Grid State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Motion Sensor",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Occupancy Sensor",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Contact Sensor",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enpowerGridStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enpowerGridStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "enpowerGridModeSensors": {
              "title": "Enepower Grid Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "gridMode": {
                    "title": "Mode",
                    "type": "string",
                    "description": "Grid mode",
                    "anyOf": [
                      {
                        "title": "Grid On",
                        "enum": [
                          "on-grid"
                        ]
                      },
                      {
                        "title": "Grid Off",
                        "enum": [
                          "off-grid"
                        ]
                      },
                      {
                        "title": "Multimode Grid On",
                        "enum": [
                          "multimode-ongrid"
                        ]
                      },
                      {
                        "title": "Multimode Grid Off",
                        "enum": [
                          "multimode-offgrid"
                        ]
                      },
                      {
                        "title": "Grid Tied",
                        "enum": [
                          "grid-tied"
                        ]
                      },
                      {
                        "title": "Grid Forming",
                        "enum": [
                          "grid-forming"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enpowerGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enpowerGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "gridMode"
                      ]
                    }
                  }
                ]
              }
            },
            "enchargeName": {
              "title": "Accessory name",
              "type": "string",
              "placeholder": "Accessory name",
              "description": "Accessory name for Home app, if not set will use default name"
            },
            "enchargeBackupLevelSummaryAccessory": {
              "title": "Encharge Summary Accessory",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 5,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Light Bulb",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Fan",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Humidity Sensor",
                      "enum": [
                        3
                      ]
                    },
                    {
                      "title": "Carbon Monoxide Sensor",
                      "enum": [
                        4
                      ]
                    },
                    {
                      "title": "Battery",
                      "enum": [
                        5
                      ]
                    }
                  ]
                },
                "minSoc": {
                  "title": "Minimum SoC",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100,
                  "multipleOf": 1,
                  "description": "Minimum SoC level in (%) for encharges backup level summary.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeBackupLevelSummaryAccessory.displayType > 0"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeBackupLevelSummaryAccessory.displayType > 0"
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "displayType"
                    ],
                    "properties": {
                      "displayType": {
                        "enum": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "minSoc"
                    ]
                  }
                }
              ]
            },
            "enchargeBackupLevelSummarySensors": {
              "title": "Encharge Summary Backup Level Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "compareMode": {
                    "title": "Comparison mode",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "description": "Comparison mode",
                    "anyOf": [
                      {
                        "title": ">",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": ">=",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "==",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "<",
                        "enum": [
                          3
                        ]
                      },
                      {
                        "title": "<=",
                        "enum": [
                          4
                        ]
                      },
                      {
                        "title": "!=",
                        "enum": [
                          5
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeBackupLevelSummarySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "backupLevel": {
                    "title": "Level",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "multipleOf": 1,
                    "description": "Backup level in (%) to compare to sensor that was triggered",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeBackupLevelSummarySensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeBackupLevelSummarySensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "compareMode",
                        "backupLevel"
                      ]
                    }
                  }
                ]
              }
            },
            "enchargeBackupLevelAccessory": {
              "title": "Encharge Accessory",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1,
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Battery",
                      "enum": [
                        1
                      ]
                    }
                  ],
                  "description": "Accessory type for Home app"
                },
                "minSoc": {
                  "title": "Minimum SoC",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100,
                  "multipleOf": 1,
                  "description": "Minimum SoC level in (%) for encharge backup level.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeBackupLevelAccessory.displayType > 0"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeBackupLevelAccessory.displayType > 0"
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "displayType"
                    ],
                    "properties": {
                      "displayType": {
                        "enum": [
                          1
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "minSoc"
                    ]
                  }
                }
              ]
            },
            "enchargeProfileControls": {
              "title": "Profile Control",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "description": "Accessory type in Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Lightbulb",
                        "enum": [
                          1
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Accessory name",
                    "description": "Accessory name for Home app"
                  },
                  "profile": {
                    "title": "Profile",
                    "type": "string",
                    "description": "Here select the profile.",
                    "anyOf": [
                      {
                        "title": "Savings Mode",
                        "enum": [
                          "savings-mode"
                        ]
                      },
                      {
                        "title": "Economy",
                        "enum": [
                          "economy"
                        ]
                      },
                      {
                        "title": "Full Backup",
                        "enum": [
                          "backup"
                        ]
                      },
                      {
                        "title": "Self Consumption",
                        "enum": [
                          "self-consumption"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeProfileControls[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "chargeFromGrid": {
                    "title": "Charge From Grid",
                    "type": "boolean",
                    "description": "Here allow charge from grid",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeProfileControls[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeProfileControls[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "profile"
                      ]
                    }
                  }
                ]
              }
            },
            "enchargeProfileSensors": {
              "title": "Profile Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "profile": {
                    "title": "Profile",
                    "type": "string",
                    "description": "Here select the profile.",
                    "anyOf": [
                      {
                        "title": "Savings Mode",
                        "enum": [
                          "savings-mode"
                        ]
                      },
                      {
                        "title": "Economy",
                        "enum": [
                          "economy"
                        ]
                      },
                      {
                        "title": "Full Backup",
                        "enum": [
                          "backup"
                        ]
                      },
                      {
                        "title": "Self Consumption",
                        "enum": [
                          "self-consumption"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeProfileSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeProfileSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "profile"
                      ]
                    }
                  }
                ]
              }
            },
            "enchargeStateSensor": {
              "title": "State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory 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": "Accessory type for Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "enchargeGridStateSensor": {
              "title": "Grid State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory 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": "Accessory type for Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeGridStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].enchargeGridStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "enchargeGridModeSensors": {
              "title": "Encharge Grid Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "gridMode": {
                    "title": "Mode",
                    "type": "string",
                    "description": "Here select the grid mode.",
                    "anyOf": [
                      {
                        "title": "Grid On",
                        "enum": [
                          "on-grid"
                        ]
                      },
                      {
                        "title": "Grid Off",
                        "enum": [
                          "off-grid"
                        ]
                      },
                      {
                        "title": "Multimode Grid On",
                        "enum": [
                          "multimode-ongrid"
                        ]
                      },
                      {
                        "title": "Multimode Grid Off",
                        "enum": [
                          "multimode-offgrid"
                        ]
                      },
                      {
                        "title": "Grid Tied",
                        "enum": [
                          "grid-tied"
                        ]
                      },
                      {
                        "title": "Grid Forming",
                        "enum": [
                          "grid-forming"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].enchargeGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "gridMode"
                      ]
                    }
                  }
                ]
              }
            },
            "solarGridStateSensor": {
              "title": "Grid State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory 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": "Accessory type for Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].solarGridStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].solarGridStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "solarGridModeSensors": {
              "title": "Solar Grid Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "gridMode": {
                    "title": "Mode",
                    "type": "string",
                    "description": "Grid mode",
                    "anyOf": [
                      {
                        "title": "Grid On",
                        "enum": [
                          "on-grid"
                        ]
                      },
                      {
                        "title": "Grid Off",
                        "enum": [
                          "off-grid"
                        ]
                      },
                      {
                        "title": "Multimode Grid On",
                        "enum": [
                          "multimode-ongrid"
                        ]
                      },
                      {
                        "title": "Multimode Grid Off",
                        "enum": [
                          "multimode-offgrid"
                        ]
                      },
                      {
                        "title": "Grid Tied",
                        "enum": [
                          "grid-tied"
                        ]
                      },
                      {
                        "title": "Grid Forming",
                        "enum": [
                          "grid-forming"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].solarGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].solarGridModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "gridMode"
                      ]
                    }
                  }
                ]
              }
            },
            "generatorStateControl": {
              "title": "State Control",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Switch",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Outlet",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Lightbulb",
                      "enum": [
                        3
                      ]
                    }
                  ],
                  "description": "Accessory type in Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Accessory name",
                  "description": "Accessory name for Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].generatorStateControl.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].generatorStateControl.displayType > 0;"
                  }
                }
              }
            },
            "generatorStateSensor": {
              "title": "State Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory 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": "Accessory type for Home app"
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].generatorStateSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].generatorStateSensor.displayType > 0;"
                  }
                }
              }
            },
            "generatorModeControls": {
              "title": "Mode Control",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type in Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Switch",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Outlet",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Lightbulb",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Mode name",
                    "description": "Accessory name for Home app"
                  },
                  "mode": {
                    "title": "Mode",
                    "type": "string",
                    "description": "Mode",
                    "anyOf": [
                      {
                        "title": "Off",
                        "enum": [
                          "off"
                        ]
                      },
                      {
                        "title": "On",
                        "enum": [
                          "on"
                        ]
                      },
                      {
                        "title": "Auto",
                        "enum": [
                          "auto"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].generatorModeControls[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].generatorModeControls[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "mode"
                      ]
                    }
                  }
                ]
              }
            },
            "generatorModeSensors": {
              "title": "Mode Sensors",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "displayType": {
                    "title": "Accessory type",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3,
                    "description": "Accessory type for Home app",
                    "anyOf": [
                      {
                        "title": "Disabled",
                        "enum": [
                          0
                        ]
                      },
                      {
                        "title": "Motion Sensor",
                        "enum": [
                          1
                        ]
                      },
                      {
                        "title": "Occupancy Sensor",
                        "enum": [
                          2
                        ]
                      },
                      {
                        "title": "Contact Sensor",
                        "enum": [
                          3
                        ]
                      }
                    ]
                  },
                  "name": {
                    "title": "Accessory name",
                    "type": "string",
                    "placeholder": "Sensor name",
                    "description": "Name for the sensor accessory in the Home app"
                  },
                  "mode": {
                    "title": "Mode",
                    "type": "string",
                    "description": "Mode",
                    "anyOf": [
                      {
                        "title": "Off",
                        "enum": [
                          "off"
                        ]
                      },
                      {
                        "title": "On",
                        "enum": [
                          "on"
                        ]
                      },
                      {
                        "title": "Auto",
                        "enum": [
                          "auto"
                        ]
                      }
                    ],
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].generatorModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  },
                  "namePrefix": {
                    "title": "Prefix",
                    "type": "boolean",
                    "description": "Use the accessory name as a prefix",
                    "condition": {
                      "functionBody": "return model.devices[arrayIndices[0]].generatorModeSensors[arrayIndices[1]].displayType > 0;"
                    }
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "displayType"
                      ],
                      "properties": {
                        "displayType": {
                          "enum": [
                            1,
                            2,
                            3
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "mode"
                      ]
                    }
                  }
                ]
              }
            },
            "dataRefreshControl": {
              "title": "Data Refresh Control",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type in Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Switch",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Outlet",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Lightbulb",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Accessory name",
                  "description": "Accessory name for Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].dataRefreshControl.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].dataRefreshControl.displayType > 0;"
                  }
                }
              }
            },
            "dataRefreshSensor": {
              "title": "Data Refresh Sensor",
              "type": "object",
              "properties": {
                "displayType": {
                  "title": "Accessory type",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3,
                  "description": "Accessory type for Home app",
                  "anyOf": [
                    {
                      "title": "Disabled",
                      "enum": [
                        0
                      ]
                    },
                    {
                      "title": "Motion Sensor",
                      "enum": [
                        1
                      ]
                    },
                    {
                      "title": "Occupancy Sensor",
                      "enum": [
                        2
                      ]
                    },
                    {
                      "title": "Contact Sensor",
                      "enum": [
                        3
                      ]
                    }
                  ]
                },
                "name": {
                  "title": "Accessory name",
                  "type": "string",
                  "placeholder": "Sensor name",
                  "description": "Name for the sensor accessory in the Home app",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].dataRefreshSensor.displayType > 0;"
                  }
                },
                "namePrefix": {
                  "title": "Prefix",
                  "type": "boolean",
                  "description": "Use the accessory name as a prefix",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].dataRefreshSensor.displayType > 0;"
                  }
                }
              }
            },
            "productionDataRefreshTime": {
              "title": "Production",
              "type": "number",
              "minimum": 0.5,
              "maximum": 60,
              "multipleOf": 0.5,
              "default": 10,
              "description": "Production data refresh time (seconds)"
            },
            "liveDataRefreshTime": {
              "title": "Live Data",
              "type": "number",
              "minimum": 0.5,
              "maximum": 60,
              "multipleOf": 0.5,
              "default": 5,
              "description": "Live data refresh time (seconds)",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode > 0;"
              }
            },
            "ensembleDataRefreshTime": {
              "title": "Ensemble",
              "type": "number",
              "minimum": 0.5,
              "maximum": 60,
              "multipleOf": 0.5,
              "default": 15,
              "description": "Ensemble data refresh time (seconds)",
              "condition": {
                "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode > 0;"
              }
            },
            "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 connect to the network"
                },
                "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"
                }
              }
            },
            "restFul": {
              "title": "RESTFul",
              "type": "object",
              "properties": {
                "enable": {
                  "title": "Enable",
                  "type": "boolean",
                  "default": false,
                  "description": "Enable REST service"
                },
                "port": {
                  "title": "TCP port",
                  "type": "integer",
                  "placeholder": 3000,
                  "description": "TCP listening port for REST service",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].restFul.enable === true;"
                  }
                }
              }
            },
            "mqtt": {
              "title": "MQTT",
              "type": "object",
              "properties": {
                "enable": {
                  "title": "Enable",
                  "type": "boolean",
                  "default": false,
                  "description": "This enable MQTT client."
                },
                "host": {
                  "title": "IP/Hostname",
                  "type": "string",
                  "placeholder": "192.168.1.20 or mqtt.local",
                  "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)(\\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)$",
                  "description": "Here set the IP/Hostname of MQTT Broker.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
                  }
                },
                "port": {
                  "title": "Port",
                  "type": "integer",
                  "placeholder": 1883,
                  "description": "Here set the port of MQTT Broker.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
                  }
                },
                "clientId": {
                  "title": "Client ID",
                  "type": "string",
                  "placeholder": "client id",
                  "description": "Here optional set the Client ID of MQTT Broker.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
                  }
                },
                "prefix": {
                  "title": "Prefix",
                  "type": "string",
                  "placeholder": "home",
                  "description": "Here set the prefix.",
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
                  }
                },
                "auth": {
                  "title": "Authorization",
                  "type": "object",
                  "properties": {
                    "enable": {
                      "title": "Enable",
                      "type": "boolean",
                      "description": "This enable authorization for MQTT Broker."
                    },
                    "user": {
                      "title": "User",
                      "type": "string",
                      "placeholder": "user",
                      "description": "Here set the user of MQTT Broker.",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].mqtt.auth.enable === true;"
                      }
                    },
                    "passwd": {
                      "title": "Password",
                      "type": "string",
                      "placeholder": "password",
                      "description": "Here set the password of MQTT Broker.",
                      "format": "password",
                      "condition": {
                        "functionBody": "return model.devices[arrayIndices].mqtt.auth.enable === true;"
                      }
                    }
                  },
                  "condition": {
                    "functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
                  },
                  "allOf": [
                    {
                      "if": {
                        "required": [
                          "enable"
                        ],
                        "properties": {
                          "enable": {
                            "const": true
                          }
                        }
                      },
                      "then": {
                        "required": [
                          "user",
                          "passwd"
                        ]
                      }
                    }
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "enable"
                    ],
                    "properties": {
                      "enable": {
                        "const": true
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "host"
                    ]
                  }
                }
              ]
            }
          },
          "required": [
            "name",
            "displayType"
          ],
          "allOf": [
            {
              "if": {
                "required": [
                  "displayType"
                ],
                "properties": {
                  "displayType": {
                    "enum": [
                      1,
                      2,
                      3,
                      4
                    ]
                  }
                }
              },
              "then": {
                "required": [
                  "envoyFirmware7xxTokenGenerationMode"
                ]
              }
            },
            {
              "if": {
                "required": [
                  "envoyFirmware7xxTokenGenerationMode"
                ],
                "properties": {
                  "envoyFirmware7xxTokenGenerationMode": {
                    "enum": [
                      1
                    ]
                  }
                }
              },
              "then": {
                "required": [
                  "enlightenUser",
                  "enlightenPasswd"
                ]
              }
            },
            {
              "if": {
                "required": [
                  "envoyFirmware7xxTokenGenerationMode"
                ],
                "properties": {
                  "envoyFirmware7xxTokenGenerationMode": {
                    "enum": [
                      2
                    ]
                  }
                }
              },
              "then": {
                "required": [
                  "envoyToken"
                ]
              }
            }
          ]
        }
      }
    }
  },
  "layout": [
    {
      "key": "devices",
      "type": "tabarray",
      "title": "{{ value.name || 'System' }}",
      "items": [
        "devices[].name",
        "devices[].host",
        "devices[].displayType",
        {
          "key": "devices[]",
          "type": "section",
          "title": "Credentials",
          "expandable": true,
          "expanded": false,
          "items": [
            "devices[].envoyFirmware7xxTokenGenerationMode",
            {
              "key": "devices[].envoyPasswd",
              "type": "password"
            },
            "devices[].enlightenUser",
            {
              "key": "devices[].enlightenPasswd",
              "type": "password"
            },
            {
              "key": "devices[].envoyToken",
              "type": "password"
            },
            "devices[].envoyTokenInstaller"
          ]
        },
        {
          "key": "devices[]",
          "type": "section",
          "title": "Advanced Settings",
          "expandable": true,
          "expanded": false,
          "items": [
            {
              "key": "devices[]",
              "type": "tabarray",
              "title": "{{ value.title }}",
              "items": [
                {
                  "key": "devices[]",
                  "title": "Envoy",
                  "items": [
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "Production State",
                          "items": [
                            {
                              "key": "devices[].productionStateSensor",
                              "type": "section",
                              "title": "Sensor",
                              "description": "Section for enabling sensor for production state monitoring (firmware v7.0+ requires installer credentials)",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].productionStateSensor.displayType",
                                "devices[].productionStateSensor.name",
                                "devices[].productionStateSensor.namePrefix"
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "PLC Level",
                          "items": [
                            {
                              "key": "devices[].plcLevelControl",
                              "type": "section",
                              "title": "Refresh Control",
                              "description": "Section for enabling additional accessory for PLC level refresh control (firmware v7.0+ requires installer credentials)",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].plcLevelControl.displayType",
                                "devices[].plcLevelControl.name",
                                "devices[].plcLevelControl.namePrefix"
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "Data Refresh",
                          "items": [
                            "devices[].productionDataRefreshTime",
                            "devices[].liveDataRefreshTime",
                            "devices[].ensembleDataRefreshTime",
                            {
                              "key": "devices[].dataRefreshControl",
                              "type": "section",
                              "title": "Control",
                              "description": "Section for enabling additional accessory for data refresh control",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].dataRefreshControl.displayType",
                                "devices[].dataRefreshControl.name",
                                "devices[].dataRefreshControl.namePrefix"
                              ]
                            },
                            {
                              "key": "devices[].dataRefreshSensor",
                              "type": "section",
                              "title": "Sensor",
                              "description": "Section for enabling sensor for data refresh monitoring",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].dataRefreshSensor.displayType",
                                "devices[].dataRefreshSensor.name",
                                "devices[].dataRefreshSensor.namePrefix"
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "System Control",
                          "items": [
                            {
                              "key": "devices[].lockControl",
                              "type": "section",
                              "title": "Lock Control",
                              "description": "Section for enabling additional accessory for System control",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].lockControl.enable",
                                "devices[].lockControl.time",
                                "devices[].lockControl.namePrefix"
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "Energy Management",
                          "description": "Section for enabling energy meter monitoring and management of energy history data",
                          "items": [
                            "devices[].energyMeter",
                            "devices[].energyHistoryTime",
                            "devices[].energyHistoryReserveSpace"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Production",
                  "items": [
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[]",
                          "title": "Power",
                          "items": [
                            "devices[].powerProductionSummary",
                            {
                              "key": "devices[]",
                              "type": "section",
                              "title": "Sensors",
                              "description": "Section for creating sensors for power level monitoring",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                {
                                  "key": "devices[].powerProductionLevelSensors",
                                  "type": "tabarray",
                                  "title": "{{ value.name || 'Sensor' }}",
                                  "items": [
                                    "devices[].powerProductionLevelSensors[].displayType",
                                    "devices[].powerProductionLevelSensors[].name",
                                    "devices[].powerProductionLevelSensors[].compareMode",
                                    "devices[].powerProductionLevelSensors[].powerLevel",
                                    "devices[].powerProductionLevelSensors[].namePrefix"
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Energy",
                          "items": [
                            "devices[].energyProductionLifetimeOffset",
                            {
                              "key": "devices[]",
                              "type": "section",
                              "title": "Sensors",
                              "description": "Section for creating sensors for energy level monitoring",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                {
                                  "key": "devices[].energyProductionLevelSensors",
                                  "type": "tabarray",
                                  "title": "{{ value.name || 'Sensor' }}",
                                  "items": [
                                    "devices[].energyProductionLevelSensors[].displayType",
                                    "devices[].energyProductionLevelSensors[].name",
                                    "devices[].energyProductionLevelSensors[].compareMode",
                                    "devices[].energyProductionLevelSensors[].energyLevel",
                                    "devices[].energyProductionLevelSensors[].namePrefix"
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Grid ",
                          "items": [
                            {
                              "key": "devices[]",
                              "type": "section",
                              "title": "Sensors",
                              "description": "Section for enabling sensor for grid quality monitoring",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                {
                                  "key": "devices[].gridProductionQualitySensors",
                                  "type": "tabarray",
                                  "title": "{{ value.name || 'Sensor' }}",
                                  "items": [
                                    "devices[].gridProductionQualitySensors[].displayType",
                                    "devices[].gridProductionQualitySensors[].name",
                                    "devices[].gridProductionQualitySensors[].compareType",
                                    "devices[].gridProductionQualitySensors[].compareMode",
                                    "devices[].gridProductionQualitySensors[].compareLevel",
                                    "devices[].gridProductionQualitySensors[].namePrefix"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Consumption",
                  "items": [
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[]",
                          "title": "Total",
                          "items": [
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "title": "Power",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for power level monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].powerConsumptionTotalLevelSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].powerConsumptionTotalLevelSensors[].displayType",
                                            "devices[].powerConsumptionTotalLevelSensors[].name",
                                            "devices[].powerConsumptionTotalLevelSensors[].compareMode",
                                            "devices[].powerConsumptionTotalLevelSensors[].powerLevel",
                                            "devices[].powerConsumptionTotalLevelSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "title": "Energy",
                                  "items": [
                                    "devices[].energyConsumptionTotalLifetimeOffset",
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for energy level monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].energyConsumptionTotalLevelSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].energyConsumptionTotalLevelSensors[].displayType",
                                            "devices[].energyConsumptionTotalLevelSensors[].name",
                                            "devices[].energyConsumptionTotalLevelSensors[].compareMode",
                                            "devices[].energyConsumptionTotalLevelSensors[].energyLevel",
                                            "devices[].energyConsumptionTotalLevelSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "title": "Grid ",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for enabling sensor for grid quality monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].gridConsumptionTotalQualitySensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].gridConsumptionTotalQualitySensors[].displayType",
                                            "devices[].gridConsumptionTotalQualitySensors[].name",
                                            "devices[].gridConsumptionTotalQualitySensors[].compareType",
                                            "devices[].gridConsumptionTotalQualitySensors[].compareMode",
                                            "devices[].gridConsumptionTotalQualitySensors[].compareLevel",
                                            "devices[].gridConsumptionTotalQualitySensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Net",
                          "items": [
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "title": "Power",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for power level monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].powerConsumptionNetLevelSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].powerConsumptionNetLevelSensors[].displayType",
                                            "devices[].powerConsumptionNetLevelSensors[].name",
                                            "devices[].powerConsumptionNetLevelSensors[].compareMode",
                                            "devices[].powerConsumptionNetLevelSensors[].powerLevel",
                                            "devices[].powerConsumptionNetLevelSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "title": "Energy",
                                  "items": [
                                    "devices[].energyConsumptionNetLifetimeOffset",
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for energy level monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].energyConsumptionNetLevelSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].energyConsumptionNetLevelSensors[].displayType",
                                            "devices[].energyConsumptionNetLevelSensors[].name",
                                            "devices[].energyConsumptionNetLevelSensors[].compareMode",
                                            "devices[].energyConsumptionNetLevelSensors[].energyLevel",
                                            "devices[].energyConsumptionNetLevelSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "title": "Grid ",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for enabling sensor for grid quality monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].gridConsumptionNetQualitySensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].gridConsumptionNetQualitySensors[].displayType",
                                            "devices[].gridConsumptionNetQualitySensors[].name",
                                            "devices[].gridConsumptionNetQualitySensors[].compareType",
                                            "devices[].gridConsumptionNetQualitySensors[].compareMode",
                                            "devices[].gridConsumptionNetQualitySensors[].compareLevel",
                                            "devices[].gridConsumptionNetQualitySensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Q-Relay",
                  "items": [
                    {
                      "key": "devices[].qRelayStateSensor",
                      "type": "section",
                      "title": "State Sensor",
                      "description": "Section for enabling sensor for q-relay state monitoring",
                      "expandable": true,
                      "expanded": false,
                      "items": [
                        "devices[].qRelayStateSensor.displayType",
                        "devices[].qRelayStateSensor.name",
                        "devices[].qRelayStateSensor.namePrefix",
                        "devices[].qRelayStateSensor.multiphase"
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "AC Batteries",
                  "items": [
                    "devices[].acBatterieName",
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[]",
                          "type": "section",
                          "title": "Backup",
                          "items": [
                            {
                              "key": "devices[].acBatterieBackupLevelSummaryAccessory",
                              "type": "section",
                              "title": "Level Summary",
                              "description": "Section for enabling additional accessory for ac batteries backup level summary",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].acBatterieBackupLevelSummaryAccessory.displayType",
                                "devices[].acBatterieBackupLevelSummaryAccessory.minSoc",
                                "devices[].acBatterieBackupLevelSummaryAccessory.namePrefix"
                              ]
                            },
                            {
                              "key": "devices[].acBatterieBackupLevelAccessory",
                              "type": "section",
                              "title": "Level Individual",
                              "description": "Section for enabling additional accessory for ac battery backup level",
                              "expandable": true,
                              "expanded": false,
                              "items": [
                                "devices[].acBatterieBackupLevelAccessory.displayType",
                                "devices[].acBatterieBackupLevelAccessory.minSoc",
                                "devices[].acBatterieBackupLevelAccessory.namePrefix"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "Ensemble",
                  "items": [
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[]",
                          "title": "Enpower",
                          "items": [
                            "devices[].enpowerDryContactsControl",
                            "devices[].enpowerDryContactsSensor",
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Grid",
                                  "items": [
                                    {
                                      "key": "devices[].enpowerGridStateControl",
                                      "type": "section",
                                      "title": "State Control",
                                      "description": "Section for enabling additional accessory for grid state control",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enpowerGridStateControl.displayType",
                                        "devices[].enpowerGridStateControl.name",
                                        "devices[].enpowerGridStateControl.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[].enpowerGridStateSensor",
                                      "type": "section",
                                      "title": "State Sensor",
                                      "description": "Section for enabling sensor for grid state monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enpowerGridStateSensor.displayType",
                                        "devices[].enpowerGridStateSensor.name",
                                        "devices[].enpowerGridStateSensor.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Mode Sensors",
                                      "description": "Section for creating sensors for grid mode monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].enpowerGridModeSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].enpowerGridModeSensors[].displayType",
                                            "devices[].enpowerGridModeSensors[].name",
                                            "devices[].enpowerGridModeSensors[].gridMode",
                                            "devices[].enpowerGridModeSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Encharges",
                          "items": [
                            "devices[].enchargeName",
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "State",
                                  "items": [
                                    {
                                      "key": "devices[].enchargeStateSensor",
                                      "type": "section",
                                      "title": "Sensor",
                                      "description": "Section for enabling sensor for encharges state monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enchargeStateSensor.displayType",
                                        "devices[].enchargeStateSensor.name",
                                        "devices[].enchargeStateSensor.namePrefix"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Backup",
                                  "items": [
                                    {
                                      "key": "devices[].enchargeBackupLevelSummaryAccessory",
                                      "type": "section",
                                      "title": "Level Summary",
                                      "description": "Section for enabling additional accessory for encharges backup level summary",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enchargeBackupLevelSummaryAccessory.displayType",
                                        "devices[].enchargeBackupLevelSummaryAccessory.minSoc",
                                        "devices[].enchargeBackupLevelSummaryAccessory.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[].enchargeBackupLevelAccessory",
                                      "type": "section",
                                      "title": "Level Individual",
                                      "description": "Section for enabling additional accessory for encharge backup level",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enchargeBackupLevelAccessory.displayType",
                                        "devices[].enchargeBackupLevelAccessory.minSoc",
                                        "devices[].enchargeBackupLevelAccessory.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Level Sensors",
                                      "description": "Section for creating conditional sensors to monitor encharges SoC",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].enchargeBackupLevelSummarySensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].enchargeBackupLevelSummarySensors[].displayType",
                                            "devices[].enchargeBackupLevelSummarySensors[].name",
                                            "devices[].enchargeBackupLevelSummarySensors[].compareMode",
                                            "devices[].enchargeBackupLevelSummarySensors[].backupLevel",
                                            "devices[].enchargeBackupLevelSummarySensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Profile",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Controls",
                                      "description": "Section for creating additional accessory for encharge profile control",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].enchargeProfileControls",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Control' }}",
                                          "items": [
                                            "devices[].enchargeProfileControls[].displayType",
                                            "devices[].enchargeProfileControls[].name",
                                            "devices[].enchargeProfileControls[].profile",
                                            "devices[].enchargeProfileControls[].chargeFromGrid",
                                            "devices[].enchargeProfileControls[].namePrefix"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for encharge profile monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].enchargeProfileSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].enchargeProfileSensors[].displayType",
                                            "devices[].enchargeProfileSensors[].name",
                                            "devices[].enchargeProfileSensors[].profile",
                                            "devices[].enchargeProfileSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Grid",
                                  "items": [
                                    {
                                      "key": "devices[].enchargeGridStateSensor",
                                      "type": "section",
                                      "title": "State Sensor",
                                      "description": "Section for enabling sensor for grid state monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].enchargeGridStateSensor.displayType",
                                        "devices[].enchargeGridStateSensor.name",
                                        "devices[].enchargeGridStateSensor.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Mode Sensors",
                                      "description": "Section for enabling sensor for grid mode monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].enchargeGridModeSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].enchargeGridModeSensors[].displayType",
                                            "devices[].enchargeGridModeSensors[].name",
                                            "devices[].enchargeGridModeSensors[].gridMode",
                                            "devices[].enchargeGridModeSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Solar",
                          "items": [
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Grid",
                                  "items": [
                                    {
                                      "key": "devices[].solarGridStateSensor",
                                      "type": "section",
                                      "title": "State Sensor",
                                      "description": "Section for enabling sensor for grid state monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].solarGridStateSensor.displayType",
                                        "devices[].solarGridStateSensor.name",
                                        "devices[].solarGridStateSensor.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Mode Sensors",
                                      "description": "Section for enabling sensor for grid mode monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].solarGridModeSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].solarGridModeSensors[].displayType",
                                            "devices[].solarGridModeSensors[].name",
                                            "devices[].solarGridModeSensors[].gridMode",
                                            "devices[].solarGridModeSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "key": "devices[]",
                          "title": "Generator",
                          "items": [
                            {
                              "key": "devices[]",
                              "type": "tabarray",
                              "title": "{{ value.title }}",
                              "items": [
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "State",
                                  "items": [
                                    {
                                      "key": "devices[].generatorStateControl",
                                      "type": "section",
                                      "title": "Control",
                                      "description": "Section for enabling additional accessory for state control",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].generatorStateControl.displayType",
                                        "devices[].generatorStateControl.name",
                                        "devices[].generatorStateControl.namePrefix"
                                      ]
                                    },
                                    {
                                      "key": "devices[].generatorStateSensor",
                                      "type": "section",
                                      "title": "Sensor",
                                      "description": "Section for enabling sensor for generator state monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        "devices[].generatorStateSensor.displayType",
                                        "devices[].generatorStateSensor.name",
                                        "devices[].generatorStateSensor.namePrefix"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "key": "devices[]",
                                  "type": "section",
                                  "title": "Mode",
                                  "items": [
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Controls",
                                      "description": "Section for creating additional accessories for generator mode control",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].generatorModeControls",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Control' }}",
                                          "items": [
                                            "devices[].generatorModeControls[].displayType",
                                            "devices[].generatorModeControls[].name",
                                            "devices[].generatorModeControls[].mode",
                                            "devices[].generatorModeControls[].namePrefix"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "key": "devices[]",
                                      "type": "section",
                                      "title": "Sensors",
                                      "description": "Section for creating sensors for generator mode monitoring",
                                      "expandable": true,
                                      "expanded": false,
                                      "items": [
                                        {
                                          "key": "devices[].generatorModeSensors",
                                          "type": "tabarray",
                                          "title": "{{ value.name || 'Sensor' }}",
                                          "items": [
                                            "devices[].generatorModeSensors[].displayType",
                                            "devices[].generatorModeSensors[].name",
                                            "devices[].generatorModeSensors[].mode",
                                            "devices[].generatorModeSensors[].namePrefix"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "key": "devices[].log",
                  "type": "section",
                  "title": "Log",
                  "description": "Section for enable/disable individual log.",
                  "items": [
                    "devices[].log.deviceInfo",
                    "devices[].log.success",
                    "devices[].log.info",
                    "devices[].log.warn",
                    "devices[].log.error",
                    "devices[].log.debug"
                  ]
                },
                {
                  "key": "devices[]",
                  "title": "External Integrations",
                  "items": [
                    {
                      "key": "devices[]",
                      "type": "tabarray",
                      "title": "{{ value.title }}",
                      "items": [
                        {
                          "key": "devices[].restFul",
                          "title": "RESTFul",
                          "items": [
                            "devices[].restFul.enable",
                            "devices[].restFul.port"
                          ]
                        },
                        {
                          "key": "devices[].mqtt",
                          "title": "MQTT",
                          "items": [
                            "devices[].mqtt.enable",
                            "devices[].mqtt.host",
                            "devices[].mqtt.port",
                            "devices[].mqtt.clientId",
                            "devices[].mqtt.prefix",
                            {
                              "key": "devices[].mqtt.auth",
                              "title": "Authorization",
                              "items": [
                                "devices[].mqtt.auth.enable",
                                "devices[].mqtt.auth.user",
                                {
                                  "key": "devices[].mqtt.auth.passwd",
                                  "type": "password"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}