{
    "pluginAlias": "mqttthing",
    "pluginType": "accessory",
    "schema": {
        "type": "object",
        "properties": {
            "type": {
                "type": "string",
                "title": "Type",
                "description": "Select the accessory type.",
                "placeholder": "lightbulb",
                "oneOf": [
                    {
                        "title": "Air Pressure Sensor",
                        "enum": [
                            "airPressureSensor"
                        ]
                    },
                    {
                        "title": "Air Purifier",
                        "enum": [
                            "airPurifier"
                        ]
                    },
                    {
                        "title": "Air Quality Sensor",
                        "enum": [
                            "airQualitySensor"
                        ]
                    },
                    {
                        "title": "Carbon Dioxide Sensor",
                        "enum": [
                            "carbonDioxideSensor"
                        ]
                    },
                    {
                        "title": "Contact Sensor",
                        "enum": [
                            "contactSensor"
                        ]
                    },
                    {
                        "title": "Door",
                        "enum": [
                            "door"
                        ]
                    },
                    {
                        "title": "Doorbell",
                        "enum": [
                            "doorbell"
                        ]
                    },
                    {
                        "title": "Fan",
                        "enum": [
                            "fan"
                        ]
                    },
                    {
                        "title": "Fanv2",
                        "enum": [
                            "fanv2"
                        ]
                    },
                    {
                        "title": "Garage door opener",
                        "enum": [
                            "garageDoorOpener"
                        ]
                    },
                    {
                        "title": "Heater Cooler",
                        "enum": [
                            "heaterCooler"
                        ]
                    },
                    {
                        "title": "Humidity Sensor",
                        "enum": [
                            "humiditySensor"
                        ]
                    },
                    {
                        "title": "Irrigation System",
                        "enum": [
                            "irrigationSystem"
                        ]
                    },
                    {
                        "title": "Leak Sensor",
                        "enum": [
                            "leakSensor"
                        ]
                    },
                    {
                        "title": "Light bulb",
                        "enum": [
                            "lightbulb"
                        ]
                    },
                    {
                        "title": "Light bulb - on/off",
                        "enum": [
                            "lightbulb-OnOff"
                        ]
                    },
                    {
                        "title": "Light bulb - white dimmable (0-100)",
                        "enum": [
                            "lightbulb-Dimmable"
                        ]
                    },
                    {
                        "title": "Light bulb - white dimmable (0-255)",
                        "enum": [
                            "lightbulb-White"
                        ]
                    },
                    {
                        "title": "Light bulb - white with variable colour temperature",
                        "enum": [
                            "lightbulb-ColTemp"
                        ]
                    },
                    {
                        "title": "Light bulb - colour (separate topics)",
                        "enum": [
                            "lightbulb-Colour"
                        ]
                    },
                    {
                        "title": "Light bulb - HSV",
                        "enum": [
                            "lightbulb-HSV"
                        ]
                    },
                    {
                        "title": "Light bulb - RGB",
                        "enum": [
                            "lightbulb-RGB"
                        ]
                    },
                    {
                        "title": "Light bulb - RGBW",
                        "enum": [
                            "lightbulb-RGBW"
                        ]
                    },
                    {
                        "title": "Light bulb - RGBWW",
                        "enum": [
                            "lightbulb-RGBWW"
                        ]
                    },
                    {
                        "title": "Light Sensor",
                        "enum": [
                            "lightSensor"
                        ]
                    },
                    {
                        "title": "Lock Mechanism",
                        "enum": [
                            "lockMechanism"
                        ]
                    },
                    {
                        "title": "Microphone",
                        "enum": [
                            "microphone"
                        ]
                    },
                    {
                        "title": "Motion Sensor",
                        "enum": [
                            "motionSensor"
                        ]
                    },
                    {
                        "title": "Occupancy Sensor",
                        "enum": [
                            "occupancySensor"
                        ]
                    },
                    {
                        "title": "Outlet",
                        "enum": [
                            "outlet"
                        ]
                    },
                    {
                        "title": "Security System",
                        "enum": [
                            "securitySystem"
                        ]
                    },
                    {
                        "title": "Smoke Sensor",
                        "enum": [
                            "smokeSensor"
                        ]
                    },
                    {
                        "title": "Speaker",
                        "enum": [
                            "speaker"
                        ]
                    },
                    {
                        "title": "StatelessProgrammableSwitch",
                        "enum": [
                            "statelessProgrammableSwitch"
                        ]
                    },
                    {
                        "title": "Switch",
                        "enum": [
                            "switch"
                        ]
                    },
                    {
                        "title": "Television",
                        "enum": [
                            "television"
                        ]
                    },
                    {
                        "title": "Temperature Sensor",
                        "enum": [
                            "temperatureSensor"
                        ]
                    },
                    {
                        "title": "Thermostat",
                        "enum": [
                            "thermostat"
                        ]
                    },
                    {
                        "title": "Valve",
                        "enum": [
                            "valve"
                        ]
                    },
                    {
                        "title": "Weather Station",
                        "enum": [
                            "weatherStation"
                        ]
                    },
                    {
                        "title": "Window",
                        "enum": [
                            "window"
                        ]
                    },
                    {
                        "title": "Window Covering",
                        "enum": [
                            "windowCovering"
                        ]
                    }
                ]
            },
            "name": {
                "type": "string",
                "minLength": 1,
                "required": true,
                "title": "Name",
                "description": "Name of accessory, as displayed in HomeKit."
            },
            "url": {
                "type": "string",
                "title": "URL",
                "description": "URL of MQTT server (optional), default: mqtt://localhost:1883",
                "placeholder": "mqtt://localhost:1883"
            },
            "username": {
                "type": "string",
                "required": false,
                "title": "Username",
                "description": "Username for MQTT server (optional)"
            },
            "password": {
                "type": "string",
                "required": false,
                "title": "Password",
                "description": "Password for MQTT server (optional)"
            },
            "mqttOptions": {
                "type": "object",
                "title": "MQTT Options",
                "properties": {
                    "keepalive": {
                        "type": "integer",
                        "title": "Keep Alive",
                        "description": "Keep alive interval (seconds), or 0 to disable",
                        "placeholder": 0
                    }
                }
            },
            "mqttPubOptions": {
                "type": "object",
                "title": "MQTT Publish Options",
                "properties": {
                    "retain": {
                        "type": "boolean",
                        "title": "Retain",
                        "description": "Publishing - set Retain flag"
                    }
                }
            },
            "logMqtt": {
                "type": "boolean",
                "readOnly": false,
                "writeOnly": false,
                "title": "Log MQTT",
                "description": "Set to true to enable MQTT logging for this accessory"
            },
            "codec": {
                "type": "string",
                "title": "Codec",
                "description": "Filename of JavaScript file implementing codec"
            },
            "debounceRecvms": {
                "type": "integer",
                "title": "Receive Debounce (ms)",
                "description": "Whenever receiving a message on any configured topic, wait for the number of milliseconds specified before notifying Homekit. If a subsequent message is received during the debounce period, the debounce timer is restarted. This can be useful to filter extraneous notification messages from accessories."
            },
            "optimizePublishing": {
                "type": "boolean",
                "title": "Optimize Publishing",
                "description": "Set to true to suppress republishing of the previously-published value (on each topic)"
            },
            "topics": {
                "type": "object",
                "title": "Topics",
                "properties": {
                    "getOnline": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'online' status"
                    },
                    "getAirPressure": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'air pressure'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor','weatherStation'].includes(model.type);"
                        }
                    },
                    "getSwitch": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of switch state",
                        "condition": {
                            "functionBody": "return ['doorbell','statelessProgrammableSwitch'].includes(model.type);"
                        }
                    },
                    "getRotationMode": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'rotation mode'",
                        "condition": {
                            "functionBody": "return ['heaterCooler'].includes(model.type);"
                        }
                    },
                    "setRotationMode": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'rotation mode'",
                        "condition": {
                            "functionBody": "return ['heaterCooler'].includes(model.type);"
                        }
                    },
                    "setHSV": {
                        "type": "string",
                        "description": "In HSV mode, control topic published by mqttthing with comma-separated hue (0-360), saturation (0-100) and value (0-100)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-HSV'].includes(model.type);"
                        }
                    },
                    "getHSV": {
                        "type": "string",
                        "description": "In HSV mode, status topic used to notify mqttthing of comma-separated hue (0-360), saturation (0-100) and value (0-100)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-HSV'].includes(model.type);"
                        }
                    },
                    "getRGB": {
                        "type": "string",
                        "description": "In RGB mode, topic to notify mqttthing of comma-separated red, green and blue",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGB'].includes(model.type);"
                        }
                    },
                    "setRGB": {
                        "type": "string",
                        "description": "In RGB mode, control topic published by mqttthing with comma-separated red, green and blue (all 0-255)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGB'].includes(model.type);"
                        }
                    },
                    "getRGBW": {
                        "type": "string",
                        "description": "In RGBW mode, topic to notify mqttthing of comma-separated red, green, blue and white",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGBW'].includes(model.type);"
                        }
                    },
                    "setRGBW": {
                        "type": "string",
                        "description": "In RGBW mode, control topic published by mqttthing with comma-separated red, green, blue and white (all 0-255)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGBW'].includes(model.type);"
                        }
                    },
                    "getRGBWW": {
                        "type": "string",
                        "description": "In RGBWW mode, topic to notify mqttthing of comma-separated red, green, blue, warm_white and cold_white",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                        }
                    },
                    "setRGBWW": {
                        "type": "string",
                        "description": "In RGBWW mode, control topic published by mqttthing with comma-separated red, green, blue, warm_white and cold_white (all 0-255)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                        }
                    },
                    "getWhite": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of white level (0-255) - can be used with getRGB for RGBW with separately-published white level",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-White','lightbulb-RGB'].includes(model.type);"
                        }
                    },
                    "setWhite": {
                        "type": "string",
                        "description": "Control topic published by mqttthing with white level (0-255) - can be used with getRGB for RGBW with separately-published white level",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-White','lightbulb-RGB'].includes(model.type);"
                        }
                    },
                    "getWatts": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current consumption' [Watts] (optional, Eve-App-only)",
                        "condition": {
                            "functionBody": "return ['outlet'].includes(model.type);"
                        }
                    },
                    "getVolts": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'voltage' [Volts] (optional, Eve-App-only)",
                        "condition": {
                            "functionBody": "return ['outlet'].includes(model.type);"
                        }
                    },
                    "getAmperes": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'electricCurrent' [Amperes] (optional, Eve-App-only)",
                        "condition": {
                            "functionBody": "return ['outlet'].includes(model.type);"
                        }
                    },
                    "getTotalConsumption": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'electricCurrent' [Amperes] (optional, Eve-App-only)",
                        "condition": {
                            "functionBody": "return ['outlet'].includes(model.type);"
                        }
                    },
                    "setTargetState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target alarm state'",
                        "condition": {
                            "functionBody": "return ['securitySystem'].includes(model.type);"
                        }
                    },
                    "getTargetState": {
                        "type": "string",
                        "description": "Topic that may be published to notify HomeKit that the target alarm state has been changed externally.",
                        "condition": {
                            "functionBody": "return ['securitySystem'].includes(model.type);"
                        }
                    },
                    "getCurrentState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing that an alarm state has been achieved. HomeKit will expect current state to end up matching target state.",
                        "condition": {
                            "functionBody": "return ['securitySystem'].includes(model.type);"
                        }
                    },
                    "setActiveInput": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'active input source' (optional).",
                        "condition": {
                            "functionBody": "return ['television'].includes(model.type);"
                        }
                    },
                    "getActiveInput": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'active input source' (optional).",
                        "condition": {
                            "functionBody": "return ['television'].includes(model.type);"
                        }
                    },
                    "getWeatherCondition": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'weather condition' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getRain1h": {
                        "type": "string",
                        "title": "Get Rain 1H",
                        "description": "Topic used to notify mqttthing of 'rain [mm] in last 1h' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getRain24h": {
                        "type": "string",
                        "title": "Get Rain 24H",
                        "description": "Topic used to notify mqttthing of 'rain [mm] in last 24h' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getUVIndex": {
                        "type": "string",
                        "title": "Get UV Index",
                        "description": "Topic used to notify mqttthing of 'UV index' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getVisibility": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'visibility [km]' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getWindDirection": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'wind direction' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getWindSpeed": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'wind speed [km/h]' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getmaxWind": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'wind speed [km/h]' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getDewPoint": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'DewPoint' (optional, Eve-only)",
                        "condition": {
                            "functionBody": "return ['weatherStation'].includes(model.type);"
                        }
                    },
                    "getActive": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'active'",
                        "condition": {
                            "functionBody": "return ['airPurifier','fanv2','faucet','heaterCooler','humidifierDehumidifier','irrigationSystem','valve','cameraEventRecordingManagement','television','televisionSpeaker','targetControl'].includes(model.type);"
                        }
                    },
                    "setActive": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'active' state",
                        "condition": {
                            "functionBody": "return ['airPurifier','fanv2','faucet','heaterCooler','humidifierDehumidifier','irrigationSystem','valve','cameraEventRecordingManagement','television','televisionSpeaker','targetControl'].includes(model.type);"
                        }
                    },
                    "getAirQuality": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'air quality'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getAirQualityPPM": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'air quality voc in ppm' (Eve-only)",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "setDuration": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'default duration (seconds)' (optional, with external timer)",
                        "condition": {
                            "functionBody": "return ['valve'].includes(model.type);"
                        }
                    },
                    "getDuration": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'default duration (seconds)' (optional, with external timer)",
                        "condition": {
                            "functionBody": "return ['valve'].includes(model.type);"
                        }
                    },
                    "getBatteryLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'battery level'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor','airQualitySensor','batteryService','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getCarbonDioxideDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon dioxide detected'",
                        "condition": {
                            "functionBody": "return ['carbonDioxideSensor'].includes(model.type);"
                        }
                    },
                    "getCarbonDioxideLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon dioxide level'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor','carbonDioxideSensor'].includes(model.type);"
                        }
                    },
                    "getCarbonDioxidePeakLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon dioxide peak level'",
                        "condition": {
                            "functionBody": "return ['carbonDioxideSensor'].includes(model.type);"
                        }
                    },
                    "getCarbonMonoxideDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon monoxide detected'",
                        "condition": {
                            "functionBody": "return ['carbonMonoxideSensor'].includes(model.type);"
                        }
                    },
                    "getCarbonMonoxideLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon monoxide level'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor','carbonMonoxideSensor'].includes(model.type);"
                        }
                    },
                    "getCarbonMonoxidePeakLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'carbon monoxide peak level'",
                        "condition": {
                            "functionBody": "return ['carbonMonoxideSensor'].includes(model.type);"
                        }
                    },
                    "getChargingState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'charging state'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor','airQualitySensor','batteryService','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getContactSensorState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'contact sensor state'",
                        "condition": {
                            "functionBody": "return ['contactSensor'].includes(model.type);"
                        }
                    },
                    "getCoolingThresholdTemperature": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'cooling threshold temperature'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "setCoolingThresholdTemperature": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'cooling threshold temperature'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "getCurrentAmbientLightLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current ambient light level'",
                        "condition": {
                            "functionBody": "return ['lightSensor','weatherStation'].includes(model.type);"
                        }
                    },
                    "getCurrentDoorState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current door state' (from 'door current values'). Use either 'current door state' or 'door moving'.",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener','lockManagement'].includes(model.type);"
                        }
                    },
                    "getDoorMoving": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing whether or not the door is moving (as a simpler alternative to getCurrentDoorState). Use either 'current door state' or 'door moving'.",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener'].includes(model.type);"
                        }
                    },
                    "getCurrentAirPurifierState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current air purifier state'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    },
                    "getCurrentFanState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current fan state'",
                        "condition": {
                            "functionBody": "return ['fanv2'].includes(model.type);"
                        }
                    },
                    "getCurrentHeaterCoolerState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current heater cooler state'",
                        "condition": {
                            "functionBody": "return ['heaterCooler'].includes(model.type);"
                        }
                    },
                    "getCurrentHeatingCoolingState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current heating cooling state'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "getCurrentHorizontalTiltAngle": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current horizontal tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "getCurrentPosition": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current position'",
                        "condition": {
                            "functionBody": "return ['door','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "getCurrentRelativeHumidity": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current relative humidity'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor','humidifierDehumidifier','humiditySensor','thermostat','weatherStation'].includes(model.type);"
                        }
                    },
                    "getCurrentTemperature": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current temperature'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor','heaterCooler','temperatureSensor','thermostat','weatherStation'].includes(model.type);"
                        }
                    },
                    "getCurrentVerticalTiltAngle": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'current vertical tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "getHeatingThresholdTemperature": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'heating threshold temperature'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "setHeatingThresholdTemperature": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'heating threshold temperature'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "setHoldPosition": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'hold position'",
                        "condition": {
                            "functionBody": "return ['door','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "getInUse": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'in use' state",
                        "condition": {
                            "functionBody": "return ['outlet','irrigationSystem','valve'].includes(model.type);"
                        }
                    },
                    "getLeakDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'leak detected'",
                        "condition": {
                            "functionBody": "return ['leakSensor'].includes(model.type);"
                        }
                    },
                    "getLockCurrentState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'lock current state'",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener','lockMechanism'].includes(model.type);"
                        }
                    },
                    "getLockTargetState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'lock target state'",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener','lockMechanism'].includes(model.type);"
                        }
                    },
                    "setLockTargetState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'lock target state'",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener','lockMechanism'].includes(model.type);"
                        }
                    },
                    "getMotionDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'motion detected' state",
                        "condition": {
                            "functionBody": "return ['doorbell','lockManagement','motionSensor'].includes(model.type);"
                        }
                    },
                    "getMute": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'mute'",
                        "condition": {
                            "functionBody": "return ['microphone','speaker','televisionSpeaker'].includes(model.type);"
                        }
                    },
                    "setMute": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'mute' state",
                        "condition": {
                            "functionBody": "return ['microphone','speaker','televisionSpeaker'].includes(model.type);"
                        }
                    },
                    "getName": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'name' (optional, rarely-used)"
                    },
                    "getNitrogenDioxideDensity": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'nitrogen dioxide density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getObstructionDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'obstruction detected'",
                        "condition": {
                            "functionBody": "return ['door','garageDoorOpener','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "getOccupancyDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'occupancy detected'",
                        "condition": {
                            "functionBody": "return ['occupancySensor'].includes(model.type);"
                        }
                    },
                    "getOn": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of on/off state",
                        "condition": {
                            "functionBody": "return ['fan','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-Colour','lightbulb-ColTemp','outlet','switch','cameraControl'].includes(model.type);"
                        }
                    },
                    "setOn": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control on/off state",
                        "condition": {
                            "functionBody": "return ['fan','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','outlet','switch','cameraControl'].includes(model.type);"
                        }
                    },
                    "getHue": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of hue (range 0-360)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "setHue": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control hue (range 0-360)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "getSaturation": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of saturation (range 0-100)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "setSaturation": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control saturation (range 0-100)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "getBrightness": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of brightness (range 0-100)",
                        "condition": {
                            "functionBody": "return ['doorbell','lightbulb','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp'].includes(model.type);"
                        }
                    },
                    "setBrightness": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control brightness (range 0-100)",
                        "condition": {
                            "functionBody": "return ['doorbell','lightbulb','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp'].includes(model.type);"
                        }
                    },
                    "getColorTemperature": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of colour temperature (range 140-500)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-ColTemp','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "setColorTemperature": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control colour temperature (range 140-500)",
                        "condition": {
                            "functionBody": "return ['lightbulb','lightbulb-ColTemp','lightbulb-Colour'].includes(model.type);"
                        }
                    },
                    "getOzoneDensity": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'ozone density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getPM10Density": {
                        "type": "string",
                        "title": "Get PM10 Density",
                        "description": "Topic used to notify mqttthing of 'PM10 Density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getPM2_5Density": {
                        "type": "string",
                        "title": "Get PM2.5 Density",
                        "description": "Topic used to notify mqttthing of 'PM2.5 Density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getPositionState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'position state'",
                        "condition": {
                            "functionBody": "return ['door','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "getRemainingDuration": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'remaining duration'",
                        "condition": {
                            "functionBody": "return ['irrigationSystem','valve'].includes(model.type);"
                        }
                    },
                    "getRotationDirection": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'rotation direction'",
                        "condition": {
                            "functionBody": "return ['fan','fanv2'].includes(model.type);"
                        }
                    },
                    "setRotationDirection": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'rotation direction'",
                        "condition": {
                            "functionBody": "return ['fan','fanv2'].includes(model.type);"
                        }
                    },
                    "getRotationSpeed": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'rotation speed'",
                        "condition": {
                            "functionBody": "return ['airPurifier','fan','fanv2','heaterCooler','humidifierDehumidifier'].includes(model.type);"
                        }
                    },
                    "setRotationSpeed": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'rotation speed'",
                        "condition": {
                            "functionBody": "return ['airPurifier','fan','fanv2','heaterCooler','humidifierDehumidifier'].includes(model.type);"
                        }
                    },
                    "getSmokeDetected": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'smoke detected'",
                        "condition": {
                            "functionBody": "return ['smokeSensor'].includes(model.type);"
                        }
                    },
                    "getStatusActive": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'status active'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor', 'airQualitySensor','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getStatusFault": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'status fault'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor', 'airQualitySensor','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','faucet','humiditySensor','irrigationSystem','leakSensor','lightSensor','motionSensor','occupancySensor','securitySystem','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getStatusLowBattery": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'status low battery'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airPressureSensor','airQualitySensor','batteryService','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getStatusTampered": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'status tampered'",
                        "condition": {
                            "functionBody": "return ['airPressureSensor','airQualitySensor','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','securitySystem','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                        }
                    },
                    "getAltSensorState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'Alternate Sensor State'",
                        "condition": {
                            "functionBody": "return ['securitySystem'].includes(model.type);"
                        }
                    },
                    "getSulphurDioxideDensity": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'sulphur dioxide density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getSwingMode": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'swing mode'",
                        "condition": {
                            "functionBody": "return ['airPurifier','fanv2','heaterCooler','humidifierDehumidifier','slat'].includes(model.type);"
                        }
                    },
                    "setSwingMode": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'swing mode'",
                        "condition": {
                            "functionBody": "return ['airPurifier','fanv2','heaterCooler','humidifierDehumidifier','slat'].includes(model.type);"
                        }
                    },
                    "getTargetDoorState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target door state' (for external door control)",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener'].includes(model.type);"
                        }
                    },
                    "setTargetDoorState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target door state'",
                        "condition": {
                            "functionBody": "return ['garageDoorOpener'].includes(model.type);"
                        }
                    },
                    "getTargetAirPurifierState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target air purifier state'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    },
                    "setTargetAirPurifierState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target air purifier state'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    },
                    "getTargetFanState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target fan state'",
                        "condition": {
                            "functionBody": "return ['fanv2'].includes(model.type);"
                        }
                    },
                    "setTargetFanState": {
                        "type": "string",
                        "description": "Topic published to notify mqttthing of 'target fan state'",
                        "condition": {
                            "functionBody": "return ['fanv2'].includes(model.type);"
                        }
                    },
                    "getTargetHeaterCoolerState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target heater cooler state'",
                        "condition": {
                            "functionBody": "return ['heaterCooler'].includes(model.type);"
                        }
                    },
                    "setTargetHeaterCoolerState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target heater cooler state'",
                        "condition": {
                            "functionBody": "return ['heaterCooler'].includes(model.type);"
                        }
                    },
                    "getTargetHeatingCoolingState": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target heating cooling state'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "setTargetHeatingCoolingState": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target heating cooling state'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "getTargetHorizontalTiltAngle": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target horizontal tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "setTargetHorizontalTiltAngle": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target horizontal tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "getTargetPosition": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target position'",
                        "condition": {
                            "functionBody": "return ['door','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "setTargetPosition": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target position'",
                        "condition": {
                            "functionBody": "return ['door','window','windowCovering'].includes(model.type);"
                        }
                    },
                    "getTargetRelativeHumidity": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target relative humidity'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "setTargetRelativeHumidity": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target relative humidity'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "getTargetTemperature": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target temperature'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "setTargetTemperature": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target temperature'",
                        "condition": {
                            "functionBody": "return ['thermostat'].includes(model.type);"
                        }
                    },
                    "getTargetVerticalTiltAngle": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'target vertical tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "setTargetVerticalTiltAngle": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'target vertical tilt angle'",
                        "condition": {
                            "functionBody": "return ['windowCovering','cameraControl'].includes(model.type);"
                        }
                    },
                    "getTemperatureDisplayUnits": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'temperature display units'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "setTemperatureDisplayUnits": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'temperature display units'",
                        "condition": {
                            "functionBody": "return ['heaterCooler','thermostat'].includes(model.type);"
                        }
                    },
                    "getVOCDensity": {
                        "type": "string",
                        "title": "Get VOC Density",
                        "description": "Topic used to notify mqttthing of 'voc density'",
                        "condition": {
                            "functionBody": "return ['airQualitySensor'].includes(model.type);"
                        }
                    },
                    "getVolume": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'volume'",
                        "condition": {
                            "functionBody": "return ['doorbell','microphone','speaker','televisionSpeaker'].includes(model.type);"
                        }
                    },
                    "setVolume": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'volume'",
                        "condition": {
                            "functionBody": "return ['doorbell','microphone','speaker','televisionSpeaker'].includes(model.type);"
                        }
                    },
                    "setRemoteKey": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'remote key'",
                        "condition": {
                            "functionBody": "return ['television'].includes(model.type);"
                        }
                    },
                    "getFilterChangeIndication": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'filter change indication'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    },
                    "getFilterLifeLevel": {
                        "type": "string",
                        "description": "Topic used to notify mqttthing of 'filter life level'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    },
                    "setResetFilterIndication": {
                        "type": "string",
                        "description": "Topic published by mqttthing to control 'reset filter indication'",
                        "condition": {
                            "functionBody": "return ['airPurifier'].includes(model.type);"
                        }
                    }
                }
            },
            "startPub": {
                "type": "array",
                "title": "Topic",
                "items": {
                    "title": "Publish",
                    "type": "object",
                    "description": "publish",
                    "properties": {
                        "topic": {
                            "type": "string",
                            "title": "Topic",
                            "description": "MQTT Topic"
                        },
                        "message": {
                            "type": "string",
                            "title": "Message",
                            "description": "Message"
                        }
                    }
                }
            },
            "onlineValue": {
                "type": "string",
                "title": "Online Value",
                "description": "Value representing that an accessory is online (as received through 'getOnline') if different to 'onValue'",
                "default": "",
                "examples": [
                    "Online"
                ]
            },
            "offlineValue": {
                "type": "string",
                "title": "Offline Value",
                "description": "Value representing that an accessory is offline (as received through 'getOnline') if different to 'offValue'",
                "default": "",
                "examples": [
                    "Offline"
                ]
            },
            "chargingStateValues": {
                "type": "array",
                "minContains": 1,
                "title": "Charging State Values",
                "description": "An explanation about the purpose of this instance.",
                "items": {
                    "type": "string",
                    "title": "Items",
                    "description": "An explanation about the purpose of this instance.",
                    "placeholder": "NotCharging, Charging, or NotChargeable"
                },
                "condition": {
                    "functionBody": "return ['airPressureSensor','airPressureSensor','airQualitySensor','batteryService','carbonDioxideSensor','carbonMonoxideSensor','contactSensor','humiditySensor','leakSensor','lightSensor','motionSensor','occupancySensor','smokeSensor','temperatureSensor','valve','weatherStation'].includes(model.type);"
                }
            },
            "confirmationPeriodms": {
                "type": "integer",
                "title": "Confirmation Period (ms)",
                "description": "In order to monitor accessory responsiveness automatically, enter the time (in milliseconds) to wait after publishing a 'set' topic to receive a confirmatary 'get' topic update. The accessory must echo messages it receives through the 'setOn' subject to the 'getOn' subject, otherwise homebridge-mqttthing will mark it as unresponsive and republish on the 'setOn' subject.",
                "placeholder": 1000
            },
            "retryLimit": {
                "type": "integer",
                "title": "Confirmation Retry Limit",
                "description": "When using confirmation period, configure the number of publishing retries attempted by homebrige-mqttthing when no confirmatory 'get' topic update is received.",
                "placeholder": 3
            },
            "confirmationIndicateOffline": {
                "type": "boolean",
                "title": "Confirmation Indicate Offline",
                "description": "Indicate offline ('No Response') when confirmation message not received"
            },
            "integerValue": {
                "type": "boolean",
                "title": "Use integer values (1 and 0) instead of 'true' and 'false'",
                "description": "Use integer values 1 and 0 to represent on and off for Boolean values, instead of the default 'true' and 'false'. Alternatively specific values may be specified using 'onValue' and 'offValue'.",
                "condition": {
                    "functionBody": "return ['airPurifier','contactSensor','fan','fanv2','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','lightSensor','motionSensor','occupancySensor','outlet','smokeSensor','switch','television','valve'].includes(model.type);"
                }
            },
            "onValue": {
                "type": "string",
                "description": "Value to use to represent an 'on' or 'triggered' state (optional). Takes precedence over 'integerValue'.",
                "condition": {
                    "functionBody": "return ['airPurifier','contactSensor','fan','fanv2','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','lightSensor','motionSensor','occupancySensor','outlet','smokeSensor','switch','television','valve'].includes(model.type);"
                }
            },
            "offValue": {
                "type": "string",
                "description": "Value to use to represent an 'off' or 'not triggered' state (optional). Takes precedence over 'integerValue'.",
                "condition": {
                    "functionBody": "return ['airPurifier','contactSensor','fan','fanv2','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','lightSensor','motionSensor','occupancySensor','outlet','smokeSensor','switch','television','valve'].includes(model.type);"
                }
            },
            "otherValueOff": {
                "type": "boolean",
                "description": "When 'onValue' and 'offValue' are configured, also treat any unrecognized received values as 'off'",
                "condition": {
                    "functionBody": "return ['airPurifier','contactSensor','fan','fanv2','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','lightSensor','motionSensor','occupancySensor','outlet','smokeSensor','switch','television','valve'].includes(model.type);"
                }
            },
            "history": {
                "type": "boolean",
                "title": "Enable History service for Eve App (optional)",
                "condition": {
                    "functionBody": "return ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                }
            },
            "historyOptions": {
                "type": "object",
                "title": "History Options",
                "properties": {
                    "size": {
                        "type": "integer",
                        "title": "History Size",
                        "description": "Maximum size of stored data points (default: 4032)",
                        "condition": {
                            "functionBody": "return model.history && ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                        }
                    },
                    "noAutoTimer": {
                        "type": "boolean",
                        "title": "History No Auto-timer",
                        "description": "Disable averaging (and repeating) 10min timer",
                        "condition": {
                            "functionBody": "return model.history && ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                        }
                    },
                    "noAutoRepeat": {
                        "type": "boolean",
                        "title": "History No Auto-repeat",
                        "description": "Disable repetition of last value if no data was received in last 10min interval",
                        "condition": {
                            "functionBody": "return model.history && ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                        }
                    },
                    "mergeInterval": {
                        "type": "integer",
                        "title": "History Merge Interval (minutes)",
                        "description": "Set merge interval (in minutes) for events, which are very close in time (not in combination with autoTimer/autoRepeat)",
                        "condition": {
                            "functionBody": "return model.history && ['motionSensor'].includes(model.type);"
                        }
                    },
                    "persistencePath": {
                        "type": "string",
                        "title": "History Persistence Path",
                        "description": "Full path of directory in which to store history data (defaults to homebridge user storage path)",
                        "condition": {
                            "functionBody": "return model.history && ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                        }
                    }
                },
                "condition": {
                    "functionBody": "return model.history && ['airPressureSensor','contactSensor','humiditySensor','motionSensor','outlet','temperatureSensor','weatherStation','switch'].includes(model.type);"
                }
            },
            "airQualityValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "carbonDioxideDetectedValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "resetStateAfterms": {
                "type": "integer",
                "title": "Reset After",
                "description": "Milliseconds after which to reset state automatically (optional)",
                "condition": {
                    "functionBody": "return ['contactSensor','leakSensor','smokeSensor','switch'].includes(model.type);"
                }
            },
            "switchValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "restrictSwitchValues": {
                "type": "array",
                "items": {
                    "type": "integer"
                }
            },
            "turnOffAfterms": {
                "type": "integer",
                "title": "Turn Off After",
                "description": "Milliseconds after which to turn off automatically (optional)",
                "condition": {
                    "functionBody": "return ['fan','lightbulb','lightbulb-OnOff','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW','lightbulb-HSV','lightbulb-Dimmable','lightbulb-Colour','lightbulb-ColTemp','motionSensor','outlet','switch','valve'].includes(model.type);"
                }
            },
            "doorCurrentValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "doorTargetValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "lockValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "currentFanValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "targetFanValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "currentHeaterCoolerValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "targetHeaterCoolerValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "currentAirPurifierValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "targetAirPurifierValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "lockPhysicalControlsValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "swingModeValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "temperatureDisplayUnitsValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "heatingCoolingStateValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "minTemperature": {
                "type": "number",
                "title": "Minimum Temperature",
                "condition": {
                    "functionBody": "return ['heaterCooler','thermostat','temperatureSensor'].includes(model.type);"
                }
            },
            "maxTemperature": {
                "type": "number",
                "title": "Maximum Temperature",
                "condition": {
                    "functionBody": "return ['heaterCooler','thermostat','temperatureSensor'].includes(model.type);"
                }
            },
            "restrictHeaterCoolerState": {
                "type": "array",
                "items": {
                    "type": "integer"
                }
            },
            "restrictHeatingCoolingState": {
                "type": "array",
                "items": {
                    "type": "integer"
                }
            },
            "hex": {
                "type": "boolean",
                "title": "Use Hexadecimal",
                "description": "Format combined RGB/RGBW/RGBWW in hexadecimal (e.g. 'FFA000') instead of as comma-separated decimals (e.g. '255,160,0').",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "hexPrefix": {
                "type": "string",
                "description": "Format combined RGB/RGBW/RGBWW in hexadecimal with specified prefix (typically '#') instead of as comma-separated decimals.",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGB','lightbulb-RGBW','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "warmWhite": {
                "type": "string",
                "title": "Warm White Colour",
                "description": "In RGBWW mode, RGB value of warm white in format red,green,blue (optional)",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "coldWhite": {
                "type": "string",
                "title": "Cold White Colour",
                "description": "In RGBWW mode, RGB value of cold white in format red,green,blue (optional)",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "noWhiteMix": {
                "type": "boolean",
                "title": "Do not extract white components from colours",
                "description": "In RGBWW mode, by default (noWhiteMix: false) white components are extracted from colours and both white and colour channels can be active together. Set noWhiteMix to true to disable extraction of white components from colours - i.e. powering only RGB channels or WW/CW channels.",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "switchWhites": {
                "type": "boolean",
                "title": "Switch warm white/cold white",
                "description": "RGBWW WW is warm_white,cold_white by default. Set switchWhites to true to use cold_white,warm_white instead.",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-RGBWW'].includes(model.type);"
                }
            },
            "minColorTemperature": {
                "type": "integer",
                "title": "Minimum colour temperature value",
                "description": "When using colour temperature directly through the setColorTemperature topic, modify the minimum colour temperature value from its defaul to 140.",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-ColTemp'].includes(model.type);"
                }
            },
            "maxColorTemperature": {
                "type": "integer",
                "title": "Maximum colour temperature value",
                "description": "When using colour temperature directly through the setColorTemperature topic, modify the maximum colour temperature value from its defaul to 500.",
                "condition": {
                    "functionBody": "return ['lightbulb','lightbulb-ColTemp'].includes(model.type);"
                }
            },
            "minPosition": {
                "type": "integer",
                "title": "Minimum position value",
                "description": "Minimum position value for target position and current position",
                "condition": {
                    "functionBody": "return ['windowCovering','window','door'].includes(model.type);"
                }
            },
            "maxPosition": {
                "type": "integer",
                "title": "Maximum position value",
                "description": "Maximum position value for target position and current position",
                "condition": {
                    "functionBody": "return ['windowCovering','window','door'].includes(model.type);"
                }
            },
            "targetStateValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "currentStateValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "restrictTargetState": {
                "type": "array",
                "items": {
                    "type": "integer"
                }
            },
            "inputs": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "value": {
                            "type": "string"
                        }
                    }
                },
                "condition": {
                    "functionBody": "return ['television'].includes(model.type);"
                }
            },
            "durationTimer": {
                "type": "boolean",
                "title": "Enable duration timer (optional, recommended)",
                "condition": {
                    "functionBody": "return ['valve'].includes(model.type);"
                }
            },
            "minDuration": {
                "type": "integer",
                "title": "Minimum duration (in seconds)",
                "condition": {
                    "functionBody": "return ['valve'].includes(model.type);"
                }
            },
            "maxDuration": {
                "type": "integer",
                "title": "Maximum duration (in seconds)",
                "condition": {
                    "functionBody": "return ['valve'].includes(model.type);"
                }
            },
            "positionStateValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "doorValues": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "manufacturer": {
                "type": "string",
                "title": "Manufacturer",
                "description": "Defaults to mqttthing"
            },
            "model": {
                "type": "string",
                "title": "Model",
                "description": "Defaults to accessory type"
            },
            "serialNumber": {
                "type": "string",
                "title": "Serial Number",
                "description": "defaults to hostname and accessory name joined by a dash"
            },
            "firmwareRevision": {
                "type": "string",
                "title": "Firmware Revision",
                "description": "defaults to mqttthing version"
            }
        }
    },
    "layout": [
        "type",
        {
            "key": "name",
            "condition": {
                "functionBody": "return model.type && model.type !== 'null';"
            }
        },
        {
            "type": "fieldset",
            "expandable": true,
            "title": "MQTT Settings",
            "condition": {
                "functionBody": "return model.type && model.type !== 'null';"
            },
            "items": [
                "url",
                "username",
                "password",
                "logMqtt",
                "mqttOptions.keepalive",
                "mqttPubOptions.retain",
                "codec",
                "debounceRecvms",
                "optimizePublishing"
            ]
        },
        {
            "type": "fieldset",
            "expandable": true,
            "title": "MQTT Topics",
            "condition": {
                "functionBody": "return model.type && model.type !== 'null';"
            },
            "items": [
                "topics.setOn",
                "topics.getOn",
                "topics.setHue",
                "topics.getHue",
                "topics.setSaturation",
                "topics.getSaturation",
                "topics.setBrightness",
                "topics.getBrightness",
                "topics.setColorTemperature",
                "topics.getColorTemperature",
                "topics.getAirPressure",
                "topics.getSwitch",
                "topics.getActive",
                "topics.setActive",
                "topics.getAirQuality",
                "topics.getAirQualityPPM",
                "topics.getRotationMode",
                "topics.setRotationMode",
                "topics.getCarbonDioxideDetected",
                "topics.getCarbonDioxideLevel",
                "topics.getCarbonDioxidePeakLevel",
                "topics.getCarbonMonoxideDetected",
                "topics.getCarbonMonoxideLevel",
                "topics.getCarbonMonoxidePeakLevel",
                "topics.getContactSensorState",
                "topics.getCoolingThresholdTemperature",
                "topics.setCoolingThresholdTemperature",
                "topics.getCurrentAmbientLightLevel",
                "topics.setTargetDoorState",
                "topics.getTargetDoorState",
                "topics.getCurrentDoorState",
                "topics.getDoorMoving",
                "topics.getCurrentAirPurifierState",
                "topics.getCurrentFanState",
                "topics.getCurrentHeaterCoolerState",
                "topics.getCurrentHeatingCoolingState",
                "topics.getCurrentHorizontalTiltAngle",
                "topics.getCurrentPosition",
                "topics.getCurrentRelativeHumidity",
                "topics.getCurrentTemperature",
                "topics.getCurrentVerticalTiltAngle",
                "topics.getHeatingThresholdTemperature",
                "topics.setHeatingThresholdTemperature",
                "topics.setHoldPosition",
                "topics.getInUse",
                "topics.getLeakDetected",
                "topics.setLockTargetState",
                "topics.getLockTargetState",
                "topics.getLockCurrentState",
                "topics.getMotionDetected",
                "topics.getMute",
                "topics.setMute",
                "topics.getNitrogenDioxideDensity",
                "topics.getObstructionDetected",
                "topics.getOccupancyDetected",
                "topics.getOzoneDensity",
                "topics.getPM10Density",
                "topics.getPM2_5Density",
                "topics.getPositionState",
                "topics.setDuration",
                "topics.getDuration",
                "topics.getRemainingDuration",
                "topics.setRotationDirection",
                "topics.getRotationDirection",
                "topics.setRotationSpeed",
                "topics.getRotationSpeed",
                "topics.getSmokeDetected",
                "topics.getSulphurDioxideDensity",
                "topics.setSwingMode",
                "topics.getSwingMode",
                "topics.setTargetAirPurifierState",
                "topics.getTargetAirPurifierState",
                "topics.getTargetFanState",
                "topics.setTargetFanState",
                "topics.setTargetHeaterCoolerState",
                "topics.getTargetHeaterCoolerState",
                "topics.setTargetHeatingCoolingState",
                "topics.getTargetHeatingCoolingState",
                "topics.setTargetHorizontalTiltAngle",
                "topics.getTargetHorizontalTiltAngle",
                "topics.setTargetPosition",
                "topics.getTargetPosition",
                "topics.setTargetRelativeHumidity",
                "topics.getTargetRelativeHumidity",
                "topics.setTargetTemperature",
                "topics.getTargetTemperature",
                "topics.setTargetVerticalTiltAngle",
                "topics.getTargetVerticalTiltAngle",
                "topics.setTemperatureDisplayUnits",
                "topics.getTemperatureDisplayUnits",
                "topics.getVOCDensity",
                "topics.setVolume",
                "topics.getVolume",
                "topics.setActiveInput",
                "topics.getActiveInput",
                "topics.setRemoteKey",
                "topics.getWatts",
                "topics.getVolts",
                "topics.getAmperes",
                "topics.getTotalConsumption",
                "topics.setTargetState",
                "topics.getTargetState",
                "topics.getCurrentState",
                "topics.getWeatherCondition",
                "topics.getRain1h",
                "topics.getRain24h",
                "topics.getUVIndex",
                "topics.getVisibility",
                "topics.getWindDirection",
                "topics.getWindSpeed",
                "topics.setHSV",
                "topics.getHSV",
                "topics.setRGB",
                "topics.getRGB",
                "topics.setRGBW",
                "topics.getRGBW",
                "topics.setRGBWW",
                "topics.getRGBWW",
                "topics.setWhite",
                "topics.getWhite",
                "topics.getStatusActive",
                "topics.getStatusFault",
                "topics.getBatteryLevel",
                "topics.getStatusLowBattery",
                "topics.getChargingState",
                "topics.getStatusTampered",
                "topics.getAltSensorState",
                "topics.getOnline",
                "topics.getFilterChangeIndication",
                "topics.getFilterLifeLevel",
                "topics.setResetFilterIndication"
            ]
        },
        {
            "type": "fieldset",
            "expandable": true,
            "title": "Advanced",
            "items": [
                "integerValue",
                "onValue",
                "offValue",
                "otherValueOff",
                "resetStateAfterms",
                "turnOffAfterms",
                "history",
                "historyOptions.size",
                "historyOptions.noAutoTimer",
                "historyOptions.noAutoRepeat",
                "historyOptions.mergeInterval",
                "historyOptions.persistencePath",
                "minTemperature",
                "maxTemperature",
                "hex",
                "hexPrefix",
                "warmWhite",
                "coldWhite",
                "noWhiteMix",
                "switchWhites",
                "minColorTemperature",
                "maxColorTemperature",
                "minPosition",
                "maxPosition",
                "durationTimer",
                "minDuration",
                "maxDuration",
                "confirmationPeriodms",
                "retryLimit",
                "confirmationIndicateOffline",
                "onlineValue",
                "offlineValue",
                {
                    "key": "inputs",
                    "type": "array",
                    "items": [
                        {
                            "type": "div",
                            "displayFlex": true,
                            "flex-direction": "row",
                            "items": [
                                {
                                    "key": "inputs[].name",
                                    "flex": "1 1 50px",
                                    "notitle": true,
                                    "placeholder": "Input Name"
                                },
                                {
                                    "key": "inputs[].value",
                                    "flex": "1 1 50px",
                                    "notitle": true,
                                    "placeholder": "Input Value"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "help",
                    "helpvalue": "<strong>MQTT topics to publish on start-up</strong>"
                },
                {
                    "key": "startPub",
                    "type": "array",
                    "title": "Topic",
                    "expandable": false,
                    "notitle": true,
                    "items": [
                        {
                            "type": "div",
                            "displayFlex": true,
                            "flex-direction": "row",
                            "items": [
                                {
                                    "key": "startPub[].topic",
                                    "flex": "1 1 50px",
                                    "notitle": true,
                                    "placeholder": "Topic"
                                },
                                {
                                    "key": "startPub[].message",
                                    "flex": "1 1 50px",
                                    "notitle": true,
                                    "placeholder": "Message"
                                }
                            ]
                        }
                    ]
                },
                "topics.getName"
            ]
        },
        {
            "type": "fieldset",
            "expandable": "true",
            "title": "Accessory Information",
            "items": [
                "manufacturer",
                "model",
                "serialNumber",
                "firmwareRevision"
            ]
        }
    ]
}