set_security_status
Change your home security panel status to Disarm, Arm Home, or Arm Away using the configured security code.
Instructions
Set the security panel status. secstatus: 0=Disarm, 1=Arm Home, 2=Arm Away.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| secstatus | Yes | ||
| seccode | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:1110-1115 (handler)The actual implementation of the 'set_security_status' tool. This is an async function decorated with @mcp.tool() that takes 'secstatus' (int) and 'seccode' (str) parameters, and makes a GET request to the Domoticz API with param=setsecstatus to arm/disarm the security panel.
@mcp.tool() async def set_security_status(secstatus: int, seccode: str) -> str: """Set the security panel status. secstatus: 0=Disarm, 1=Arm Home, 2=Arm Away.""" async with create_client() as client: response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=setsecstatus&secstatus={secstatus}&seccode={urllib.parse.quote(seccode)}") return response.text - src/domoticz_mcp/server.py:1110-1110 (registration)The @mcp.tool() decorator registers this function as an MCP tool named 'set_security_status'.
@mcp.tool() - src/domoticz_mcp/server.py:1111-1111 (schema)The docstring serves as the schema/description for the tool, documenting that secstatus: 0=Disarm, 1=Arm Home, 2=Arm Away.
async def set_security_status(secstatus: int, seccode: str) -> str: