{
  "pluginAlias": "security-system",
  "pluginType": "accessory",
  "headerDisplay": "Create a fully-featured security system accessory for HomeKit.  Exposes switches, sensors, and interfaces that work with the four built-in Homekit security modes: 'Off', 'Home', 'Away', and 'Night'",
  "footerDisplay": "[Need help?](https://github.com/MiguelRipoll23/homebridge-securitysystem/issues) | [Donate](https://buymeacoffee.com/miguelripoll23)",
  "schema": {
    "title": "Security System",
    "type": "object",
    "properties": {
      "name": {
        "title": "Name",
        "description": "Name for your security system that shows up in Homekit.",
        "type": "string",
        "default": "Security System",
        "required": true
      },
      "serial_number": {
        "title": "Serial Number",
        "description": "",
        "type": "string",
        "default": "S3CUR1TYSYST3M",
        "required": true
      },
      "disabled_modes": {
        "title": "Disabled Modes",
        "description": "",
        "type": "array",
        "required": false,
        "uniqueItems": true,
        "items": {
          "title": "Mode",
          "type": "string",
          "enum": ["Home", "Away", "Night"]
        }
      },
      "default_mode": {
        "title": "Default Mode",
        "description": "",
        "type": "string",
        "default": "Off",
        "required": true,
        "enum": ["Off", "Home", "Away", "Night"]
      },
      "arm_seconds": {
        "title": "Arming Delay (seconds)",
        "description": "Give yourself time to leave before the system is armed.",
        "type": "integer",
        "default": 0,
        "required": false,
        "minimum": 0
      },
      "trigger_seconds": {
        "title": "Trigger Delay (seconds)",
        "description": "Give yourself time to disable the system when you get home.",
        "type": "integer",
        "default": 0,
        "required": false,
        "minimum": 0
      },
      "reset_minutes": {
        "title": "Reset Delay (minutes)",
        "description": "The system will remain triggered for this long (unless otherwise reset).",
        "type": "integer",
        "default": 10,
        "required": false,
        "minimum": 1
      },
      "mode_switches": {
        "title": "Show Mode Switches",
        "description": "Adds switches for setting and reading the security system's active mode (bypassing HomeKit confirmations).",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "mode_home_switch_name": {
        "title": "Home-Mode Switch Name",
        "description": "\"Set-only\" switch; trying to turn it off does nothing.",
        "type": "string",
        "default": "Set Home-Mode",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home') && model.mode_switches === true;"
        }
      },
      "mode_away_switch_name": {
        "title": "Away-Mode Switch Name",
        "description": "\"Set-only\" switch; trying to turn it off does nothing.",
        "type": "string",
        "default": "Set Away-Mode",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away') && model.mode_switches === true;"
        }
      },
      "mode_night_switch_name": {
        "title": "Night-Mode Switch Name",
        "description": "\"Set-only\" switch; trying to turn it off does nothing.",
        "type": "string",
        "default": "Set Night-Mode",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night') && model.mode_switches === true;"
        }
      },
      "mode_off_switch": {
        "title": "Show Off-Mode Switch",
        "description": "Adds a switch to disarm the security system (only if \"Show Mode Switches\" is also enabled).",
        "type": "boolean",
        "default": true,
        "required": false,
        "condition": {
          "functionBody": "return model.mode_switches === true;"
        }
      },
      "mode_off_switch_name": {
        "title": "Off-Mode Switch Name",
        "description": "\"Set-only\" switch; trying to turn it off does nothing.  Turning this switch ON disarms the security system.",
        "type": "string",
        "default": "Set Off-Mode",
        "required": false,
        "condition": {
          "functionBody": "return model.mode_switches === true && model.mode_off_switch === true;"
        }
      },
      "mode_away_extended_switch": {
        "title": "Show Extended Away-Mode Switch",
        "description": "Adds an additional Away-Mode switch that can be used in automations (e.g. for extended time away such as vacation).",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "mode_away_extended_switch_trigger_seconds": {
        "title": "Extended Away-Mode Set Delay (seconds)",
        "description": "Give yourself time to leave before the system is armed.",
        "type": "integer",
        "default": 0,
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return model.mode_away_extended_switch === true;"
        }
      },
      "mode_away_extended_switch_name": {
        "title": "Extended Away-Mode Switch Name",
        "description": "\"Set-only\" switch; trying to turn it off does nothing.",
        "type": "string",
        "default": "Set Extended Away-Mode",
        "required": false,
        "condition": {
          "functionBody": "return model.mode_away_extended_switch === true;"
        }
      },
      "mode_pause_switch": {
        "title": "Show Mode Pause Switch",
        "description": "Adds a switch that will disarm the security system for a set period of time.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "pause_minutes": {
        "title": "Pause Time (minutes)",
        "description": "Set to 0 to pause indefinitely.",
        "type": "integer",
        "default": 0,
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return model.mode_pause_switch === true;"
        }
      },
      "mode_pause_switch_name": {
        "title": "Mode Pause Name",
        "description": "",
        "type": "string",
        "default": "Mode Pause",
        "required": false,
        "condition": {
          "functionBody": "return model.mode_pause_switch === true;"
        }
      },
      "arming_lock_switch": {
        "title": "Show Arming Lock Switch (experimental)",
        "description": "Adds a global switch that will prevent arming the security system.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "arming_lock_switches": {
        "title": "Show Arming Lock Mode Switches (experimental)",
        "description": "Adds switches that will prevent arming the security system when their mode is set.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "trip_switch": {
        "title": "Show Global Trip Switch",
        "description": "Adds a global switch that will trip the security system if any mode other than \"Off\" is active.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "trip_switch_name": {
        "title": "Global Trip Switch Name",
        "description": "",
        "type": "string",
        "default": "Global Trip",
        "required": false,
        "condition": {
          "functionBody": "return model.trip_switch === true;"
        }
      },
      "trip_override_switch": {
        "title": "Show Trip Override Switch",
        "description": "Adds a switch that will immediately and unconditionally trigger the security system, even if it is disarmed (e.g. for use as an SOS/Panic switch).",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "trip_override_switch_name": {
        "title": "Trip Override Switch Name",
        "description": "",
        "type": "string",
        "default": "Trip Override",
        "required": false,
        "condition": {
          "functionBody": "return model.trip_override_switch === true;"
        }
      },
      "trip_mode_switches": {
        "title": "Show Trip Mode Switches",
        "description": "Adds switches for each mode that will trigger the security system if their respective mode is active.",
        "type": "boolean",
        "default": true,
        "required": false
      },
      "trip_home_switch_name": {
        "title": "Trip Home Switch Name",
        "description": "",
        "type": "string",
        "default": "Trip Home",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home') && model.trip_mode_switches === true;"
        }
      },
      "trip_away_switch_name": {
        "title": "Trip Away Switch Name",
        "description": "",
        "type": "string",
        "default": "Trip Away",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away') && model.trip_mode_switches === true;"
        }
      },
      "trip_night_switch_name": {
        "title": "Trip Night Switch Name",
        "description": "",
        "type": "string",
        "default": "Trip Night",
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night') && model.trip_mode_switches === true;"
        }
      },
      "trip_home_switches": {
        "title": "Custom Trip Home Switches",
        "description": "Additional trip switches for Home mode. Name will be prepended with \"Trip Home\".",
        "type": "array",
        "items": {
          "title": "Switch",
          "type": "object",
          "properties": {
            "label": {
              "title": "Label",
              "type": "string",
              "required": true
            }
          }
        },
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home');"
        }
      },
      "trip_away_switches": {
        "title": "Custom Trip Away Switches",
        "description": "Additional trip switches for Away mode. Name will be prepended with \"Trip Away\".",
        "type": "array",
        "items": {
          "title": "Switch",
          "type": "object",
          "properties": {
            "label": {
              "title": "Label",
              "type": "string",
              "required": true
            }
          }
        },
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away');"
        }
      },
      "trip_night_switches": {
        "title": "Custom Trip Night Switches",
        "description": "Additional trip switches for Night mode. Name will be prepended with \"Trip Night\".",
        "type": "array",
        "items": {
          "title": "Switch",
          "type": "object",
          "properties": {
            "label": {
              "title": "Label",
              "type": "string",
              "required": true
            }
          }
        },
        "required": false,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night');"
        }
      },
      "audio_switch": {
        "title": "Show Audio Enable Switch",
        "description": "Adds a global switch to enable or disable audio except for alarm triggered.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "audio_switch_name": {
        "title": "Audio Enable Switch Name",
        "description": "",
        "type": "string",
        "default": "Enable Audio",
        "required": false,
        "condition": {
          "functionBody": "return model.audio_switch === true;"
        }
      },
      "arming_sensor": {
        "title": "Show Arming Sensor",
        "description": "Adds a sensor that asserts when the security system is being armed.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "tripped_sensor": {
        "title": "Show Tripped Sensor",
        "description": "Adds a sensor that pulses at the set rate when any of the Trip switches have been turned on.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "tripped_sensor_seconds": {
        "title": "Tripped Sensor Pulse Rate (seconds)",
        "description": "",
        "type": "integer",
        "default": 5,
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return model.tripped_sensor === true;"
        }
      },
      "triggered_sensor": {
        "title": "Show Triggered Sensor",
        "description": "Adds a sensor that pulses at the set rate when the security system has been triggered.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "triggered_sensor_seconds": {
        "title": "Triggered Sensor Pulse Rate (seconds)",
        "description": "",
        "type": "integer",
        "default": 5,
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return model.triggered_sensor === true;"
        }
      },
      "reset_sensor": {
        "title": "Show Triggered Reset Sensor",
        "description": "Adds a sensor that asserts when the security system has reset after being triggered.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "audio": {
        "title": "Play Sounds (local-only, ffmpeg required)",
        "description": "Warns of pending or current events by playing sounds.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "audio_language": {
        "title": "Audio Language",
        "description": "",
        "type": "string",
        "default": "en-US",
        "required": false,
        "enum": ["en-US", "de-DE"]
      },
      "audio_extra_variables": {
        "title": "Audio Extra Variables",
        "description": "Add extra environment variables to the ffplay command that will be executed",
        "type": "array",
        "items": {
          "title": "Environment Variable",
          "type": "object",
          "properties": {
            "key": {
              "title": "Name",
              "type": "string",
              "required": true
            },
            "value": {
              "title": "Value",
              "type": "string",
              "required": true
            }
          }
        },
        "required": false
      },
      "audio_path": {
        "title": "Custom Audio Path",
        "description": "Instructions will be created in this path.",
        "type": "string",
        "required": false,
        "placeholder": "/home/user/sounds"
      },
      "audio_volume": {
        "title": "Audio Volume",
        "description": "",
        "type": "string",
        "required": false,
        "default": 100,
        "placeholder": "100"
      },
      "audio_arming_looped": {
        "title": "Loop Arming Sound",
        "description": "",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "audio_alert_looped": {
        "title": "Loop Tripped Sound",
        "description": "",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "server_port": {
        "title": "Listening Port",
        "description": "",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "placeholder": 80
      },
      "server_api_key": {
        "title": "API Key",
        "description": "A key used to protect the server and authenticate requests.",
        "type": "string",
        "required": false,
        "placeholder": "your-api-key"
      },
      "webhook_url": {
        "title": "Base URL",
        "description": "",
        "type": "string",
        "required": false,
        "format": "uri",
        "placeholder": "http://localhost"
      },
      "webhook_target_home": {
        "title": "Target Mode: Home",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/target/home"
      },
      "webhook_target_away": {
        "title": "Target Mode: Away",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/target/away"
      },
      "webhook_target_night": {
        "title": "Target Mode: Night",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/target/night"
      },
      "webhook_target_off": {
        "title": "Target Mode: Off",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/target/off"
      },
      "webhook_current_home": {
        "title": "Current Mode: Home",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/home"
      },
      "webhook_current_away": {
        "title": "Current Mode: Away",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/away"
      },
      "webhook_current_night": {
        "title": "Current Mode: Night",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/night"
      },
      "webhook_current_off": {
        "title": "Current Mode: Off",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/off"
      },
      "webhook_current_warning": {
        "title": "Current Event: Warning",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/warning"
      },
      "webhook_current_triggered": {
        "title": "Current Mode: Triggered",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/current/triggered"
      },
      "command_target_home": {
        "title": "Target Mode: Home",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo target home"
      },
      "command_target_away": {
        "title": "Target Mode: Away",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo target away"
      },
      "command_target_night": {
        "title": "Target Mode: Night",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo target night"
      },
      "command_target_off": {
        "title": "Target Mode: Off",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo target off"
      },
      "command_current_home": {
        "title": "Current Mode: Home",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current home"
      },
      "command_current_away": {
        "title": "Current Mode: Away",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current away"
      },
      "command_current_night": {
        "title": "Current Mode: Night",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current night"
      },
      "command_current_off": {
        "title": "Current Mode: Off",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current off"
      },
      "command_current_warning": {
        "title": "Current Event: Warning",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current warning"
      },
      "command_current_triggered": {
        "title": "Current Mode: Triggered",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "echo current triggered"
      },
      "mqtt_broker": {
        "title": "MQTT Broker URL",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "mqtt://localhost:1883"
      },
      "mqtt_username": {
        "title": "MQTT Username",
        "description": "",
        "type": "string",
        "required": false
      },
      "mqtt_password": {
        "title": "MQTT Password",
        "description": "",
        "type": "string",
        "required": false
      },
      "mqtt_topic": {
        "title": "MQTT Topic",
        "description": "",
        "type": "string",
        "default": "security-system/state",
        "required": false
      },
      "mqtt_client_id": {
        "title": "MQTT Client ID",
        "description": "",
        "type": "string",
        "required": false
      },
      "log_directory": {
        "title": "Log Directory Path",
        "description": "",
        "type": "string",
        "required": false,
        "placeholder": "/home/user/logs"
      },
      "save_state": {
        "title": "Save Data Using Storage",
        "description": "Persists the previous state after shutdowns and reboots.",
        "type": "boolean",
        "default": true,
        "required": false
      },
      "test_mode": {
        "title": "Enable Test Mode",
        "description": "Ignores the webhook and command when the security system triggers.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "home_arm_seconds": {
        "title": "Home Arming Delay (seconds)",
        "description": "Overrides the global Arming Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home');"
        }
      },
      "away_arm_seconds": {
        "title": "Away Arming Delay (seconds)",
        "description": "Overrides the global Arming Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away');"
        }
      },
      "night_arm_seconds": {
        "title": "Night Arming Delay (seconds)",
        "description": "Overrides the global Arming Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night');"
        }
      },
      "home_trigger_seconds": {
        "title": "Home Trigger Delay (seconds)",
        "description": "Overrides the global Trigger Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home');"
        }
      },
      "away_trigger_seconds": {
        "title": "Away Trigger Delay (seconds)",
        "description": "Overrides the global Trigger Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away');"
        }
      },
      "night_trigger_seconds": {
        "title": "Night Trigger Delay (seconds)",
        "description": "Overrides the global Trigger Delay if set.",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night');"
        }
      },
      "override_off": {
        "title": "Trigger During Off Mode",
        "description": "Allows the security system to be triggered while disarmed.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "reset_off_flow": {
        "title": "Reset Using Off Mode",
        "description": "Resets the security system when triggered by passing through the Off mode.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "proxy_mode": {
        "title": "Enable Proxy Mode",
        "description": "Ignores webhooks/commands for server requests.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "double_knock": {
        "title": "Use Double-Knock",
        "description": "Requires Trip switches to be turned on twice within a time window for the system to be triggered.",
        "type": "boolean",
        "default": false,
        "required": false
      },
      "double_knock_seconds": {
        "title": "Time Window (seconds)",
        "description": "",
        "type": "integer",
        "default": 90,
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return model.double_knock === true;"
        }
      },
      "home_double_knock_seconds": {
        "title": "Home Double-Knock Window (seconds)",
        "description": "",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Home') && model.double_knock === true;"
        }
      },
      "away_double_knock_seconds": {
        "title": "Away Double-Knock Window (seconds)",
        "description": "",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Away') && model.double_knock === true;"
        }
      },
      "night_double_knock_seconds": {
        "title": "Night Double-Knock Window (seconds)",
        "description": "",
        "type": "integer",
        "required": false,
        "minimum": 0,
        "condition": {
          "functionBody": "return !(model.disabled_modes || []).includes('Night') && model.double_knock === true;"
        }
      },
      "double_knock_modes": {
        "title": "Double-Knock Modes",
        "description": "",
        "type": "array",
        "default": [],
        "required": false,
        "uniqueItems": true,
        "items": {
          "title": "Mode",
          "type": "string",
          "enum": ["Home", "Away", "Night"]
        },
        "condition": {
          "functionBody": "return model.double_knock === true;"
        }
      }
    }
  },
  "layout": [
    "name",
    "serial_number",
    "disabled_modes",
    "default_mode",
    {
      "type": "div",
      "displayFlex": true,
      "flex-flow": "row wrap",
      "flex-direction": "row",
      "items": ["arm_seconds", "trigger_seconds", "reset_minutes"]
    },
    {
      "type": "fieldset",
      "title": "Switches",
      "description": "Create simpler automations or bypass HomeKit confirmations.",
      "expandable": true,
      "expanded": false,
      "items": [
        "mode_switches",
        "mode_home_switch_name",
        "mode_away_switch_name",
        "mode_night_switch_name",
        "mode_off_switch",
        "mode_off_switch_name",
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": [
            "mode_away_extended_switch",
            "mode_away_extended_switch_trigger_seconds",
            "mode_away_extended_switch_name"
          ],
          "condition": {
            "functionBody": "return !(model.disabled_modes || []).includes('Away');"
          }
        },
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row",
          "flex-direction": "row",
          "items": ["mode_pause_switch", "pause_minutes"]
        },
        "mode_pause_switch_name",
        "arming_lock_switch",
        "arming_lock_switches",
        "trip_switch",
        "trip_switch_name",
        "trip_override_switch",
        "trip_override_switch_name",
        "trip_mode_switches",
        "trip_home_switch_name",
        "trip_away_switch_name",
        "trip_night_switch_name",
        {
          "key": "trip_home_switches",
          "type": "tabarray",
          "title": "{{ value.label || 'Home Switch' }}",
          "items": ["trip_home_switches[].label"]
        },
        {
          "key": "trip_away_switches",
          "type": "tabarray",
          "title": "{{ value.label || 'Away Switch' }}",
          "items": ["trip_away_switches[].label"]
        },
        {
          "key": "trip_night_switches",
          "type": "tabarray",
          "title": "{{ value.label || 'Night Switch' }}",
          "items": ["trip_night_switches[].label"]
        },
        "audio_switch",
        "audio_switch_name"
      ]
    },
    {
      "type": "fieldset",
      "title": "Sensors",
      "description": "Automate based on custom events or get alerted by multiple notifications.",
      "expandable": true,
      "expanded": false,
      "items": [
        "arming_sensor",
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row",
          "flex-direction": "row",
          "items": ["tripped_sensor", "tripped_sensor_seconds"]
        },
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row",
          "flex-direction": "row",
          "items": ["triggered_sensor", "triggered_sensor_seconds"]
        },
        "reset_sensor"
      ]
    },
    {
      "type": "fieldset",
      "title": "Audio",
      "description": "Play sounds on your connected speakers to notify events.",
      "expandable": true,
      "expanded": false,
      "items": [
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": ["audio", "audio_language"]
        },
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": ["audio_path", "audio_volume"]
        },
        "audio_arming_looped",
        "audio_alert_looped",
        {
          "key": "audio_extra_variables",
          "type": "tabarray",
          "title": "{{ value.key || 'Environment Variable' }}",
          "items": [
            "audio_extra_variables[].key",
            "audio_extra_variables[].value"
          ]
        }
      ]
    },
    {
      "type": "fieldset",
      "title": "Server",
      "description": "Expose a server to interact with the security system remotely.",
      "expandable": true,
      "expanded": false,
      "items": ["server_port", "server_api_key"]
    },
    {
      "type": "fieldset",
      "title": "Webhooks",
      "description": "Interact with other devices or web services during events",
      "expandable": true,
      "expanded": false,
      "items": [
        "webhook_url",
        "webhook_target_home",
        "webhook_target_away",
        "webhook_target_night",
        "webhook_target_off",
        "webhook_current_home",
        "webhook_current_away",
        "webhook_current_night",
        "webhook_current_off",
        "webhook_current_warning",
        "webhook_current_triggered"
      ]
    },
    {
      "type": "fieldset",
      "title": "Commands",
      "description": "Execute commands on this device based on events.",
      "expandable": true,
      "expanded": false,
      "items": [
        "command_target_home",
        "command_target_away",
        "command_target_night",
        "command_target_off",
        "command_current_home",
        "command_current_away",
        "command_current_night",
        "command_current_off",
        "command_current_warning",
        "command_current_triggered"
      ]
    },
    {
      "type": "fieldset",
      "title": "MQTT",
      "description": "Publish state updates to an MQTT broker.",
      "expandable": true,
      "expanded": false,
      "items": [
        "mqtt_broker",
        "mqtt_username",
        "mqtt_password",
        "mqtt_topic",
        "mqtt_client_id"
      ]
    },
    {
      "type": "fieldset",
      "title": "Advanced Options",
      "description": "",
      "expandable": true,
      "expanded": false,
      "items": [
        "log_directory",
        "save_state",
        "test_mode",
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": ["home_arm_seconds", "away_arm_seconds", "night_arm_seconds"]
        },
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": [
            "home_trigger_seconds",
            "away_trigger_seconds",
            "night_trigger_seconds"
          ]
        },
        "override_off",
        "reset_off_flow",
        "proxy_mode",
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": ["double_knock", "double_knock_seconds"]
        },
        {
          "type": "div",
          "displayFlex": true,
          "flex-flow": "row wrap",
          "flex-direction": "row",
          "items": [
            "home_double_knock_seconds",
            "away_double_knock_seconds",
            "night_double_knock_seconds"
          ]
        },
        "double_knock_modes"
      ]
    }
  ]
}
