registry: SecurityPanelController with Arm.Response and its errors

Alexa.SecurityPanelController is described from its page: version 3 (the stub of 1.5.2 said 1), armState and the
four alarms, Arm and Disarm. ctx.respond() answers Arm with Arm.Response under the namespace of the interface,
its payload checked (exitDelayInSeconds 0 to 255, bypassedEndpoints), and Disarm with a Response. A Disarm
carries the PIN the user said when the panel is declared with supportedAuthorizationTypes; the handler checks
it and answers UNAUTHORIZED, which goes under Alexa.SecurityPanelController like the five other error types.

A panel declared without options lists armState, where 1.5.2 listed no property; alarms are declared.
17 examples of the two pages are saved as fixtures. 215 tests pass, 207 before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 20:50:57 +00:00
parent f555a5df70
commit c59cf3ff10
39 changed files with 1248 additions and 23 deletions

View file

@ -0,0 +1,22 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "ErrorResponse",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"type": "AUTHORIZATION_REQUIRED",
"message": "You must disarm the system before you can set the requested arm state."
}
}
}

View file

@ -0,0 +1,35 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "ErrorResponse",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"type": "BYPASS_NEEDED",
"message": "Unable to arm the security panel because there are open sensors.",
"endpointsNeedingBypass": [
{
"friendlyName": "side window sensor",
"endpointId": "Endpoint ID"
},
{
"friendlyName": "front door sensor",
"endpointId": "Endpoint ID"
},
{
"friendlyName": "water sensor"
}
]
}
}
}

View file

@ -0,0 +1,18 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "ErrorResponse",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"endpointId": "Endpoint ID"
},
"payload": {
"type": "UNAUTHORIZED",
"message": "The PIN code is not correct."
}
}
}

View file

@ -0,0 +1,22 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "ErrorResponse",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"type": "UNCLEARED_ALARM",
"message": "Unable to arm or disarm the security panel because it is in alarm status."
}
}
}

View file

@ -0,0 +1,50 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Arm.Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"exitDelayInSeconds": 60
}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "burglaryAlarm",
"value": {
"value": "ALARM"
},
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,23 @@
{
"directive": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Arm",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {
"armState": "ARMED_AWAY",
"bypassType": "BYPASS_ALL"
}
}
}

View file

@ -0,0 +1,54 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Arm.Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"exitDelayInSeconds": 60,
"bypassedEndpoints": [
{
"friendlyName": "side window sensor",
"endpointId": "Endpoint ID"
},
{
"friendlyName": "front door sensor",
"endpointId": "Endpoint ID"
},
{
"friendlyName": "water sensor"
}
]
}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,22 @@
{
"directive": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Arm",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {
"armState": "ARMED_AWAY"
}
}
}

View file

@ -0,0 +1,41 @@
{
"event": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Arm.Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"exitDelayInSeconds": 60
}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,64 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "ChangeReport",
"messageId": "Unique identifier, preferably a version 4 UUID",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"change": {
"cause": {
"type": "RULE_TRIGGER"
},
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "burglaryAlarm",
"value": {
"value": "ALARM"
},
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T08:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "fireAlarm",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T08:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,64 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "ChangeReport",
"messageId": "Unique identifier, preferably a version 4 UUID",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {
"change": {
"cause": {
"type": "PHYSICAL_INTERACTION"
},
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "DISARMED",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "burglaryAlarm",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "fireAlarm",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:20:50.51Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T10:19:00.00Z",
"uncertaintyInMilliseconds": 600000
}
]
}
}

View file

@ -0,0 +1,48 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "burglaryAlarm",
"value": {
"value": "ALARM"
},
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,25 @@
{
"directive": {
"header": {
"namespace": "Alexa.SecurityPanelController",
"name": "Disarm",
"messageId": "Unique version 4 UUID",
"correlationToken": "Opaque correlation token",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID",
"cookie": {}
},
"payload": {
"authorization": {
"type": "FOUR_DIGIT_PIN",
"value": "1234"
}
}
}
}

View file

@ -0,0 +1,39 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "DISARMED",
"timeOfSample": "2024-07-03T11:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,57 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "StateReport",
"messageId": "Unique identifier, preferably a version 4 UUID",
"correlationToken": "Opaque correlation token that matches the request",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2.0 bearer token"
},
"endpointId": "Endpoint ID"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.SecurityPanelController",
"name": "armState",
"value": "ARMED_AWAY",
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "burglaryAlarm",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.SecurityPanelController",
"name": "fireAlarm",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T10:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2024-07-03T09:55:05.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}

View file

@ -0,0 +1,6 @@
{
"name": "burglaryAlarm",
"value": {
"value": "OK"
}
}

View file

@ -0,0 +1,83 @@
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "Unique identifier, preferably a version 4 UUID"
},
"payload": {
"endpoints": [
{
"endpointId": "Unique ID of the endpoint",
"manufacturerName": "Manufacturer of the endpoint",
"description": "Description to be shown in the Alexa app",
"friendlyName": "Your security panel name, displayed in the Alexa app",
"displayCategories": [
"SECURITY_PANEL"
],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.SecurityPanelController",
"version": "3",
"properties": {
"supported": [
{
"name": "armState"
},
{
"name": "burglaryAlarm"
},
{
"name": "fireAlarm"
}
],
"proactivelyReported": true,
"retrievable": true
},
"configuration": {
"supportedArmStates": [
{
"value": "ARMED_AWAY"
},
{
"value": "ARMED_STAY"
},
{
"value": "DISARMED"
}
],
"supportedAuthorizationTypes": [
{
"type": "FOUR_DIGIT_PIN"
}
]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"supported": [
{
"name": "connectivity"
}
],
"proactivelyReported": true,
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
}
]
}
]
}
}
}

View file

@ -15,6 +15,8 @@
// chosen true: a declaration lists the properties the device has, an example some of those of the interface
// folded the directives whose example the page folds away, so that it was not saved
//
// A directive is answered with a Response, or with the event responseFor() of its descriptor names.
//
// test/registry/descriptors.test.js, test/device/discovery.test.js and test/dispatch/interfaces.test.js run the
// entries. The first one fails for a descriptor of tier 1 or 2 that has no entry.
const { asset, semantics, text } = require("alex2node");
@ -109,6 +111,27 @@ module.exports = [
},
}],
},
{
namespace: "Alexa.SecurityPanelController",
page: "alexa-securitypanelcontroller",
chosen: true,
declared: [{
example: "discovery",
options: {
...reported,
supportedArmStates: ["ARMED_AWAY", "ARMED_STAY", "DISARMED"],
supportedAuthorizationTypes: ["FOUR_DIGIT_PIN"],
alarms: ["burglaryAlarm", "fireAlarm"],
},
}],
refused: [
["Arm", { armState: "ARMED" }, 'payload.armState: expected ARMED_AWAY | ARMED_STAY | ARMED_NIGHT | DISARMED, got "ARMED"'],
["Arm", { armState: "ARMED_STAY", bypassType: "BYPASS_SOME" }, 'payload.bypassType: expected BYPASS_ALL, got "BYPASS_SOME"'],
["Disarm", { authorization: { type: "FOUR_DIGIT_PIN", value: "12345" } }, 'payload.authorization.value: expected a PIN of four digits, got "12345"'],
["Disarm", { authorization: { type: "VOICE", value: "1234" } }, 'payload.authorization.type: expected FOUR_DIGIT_PIN, got "VOICE"'],
],
unfit: [["armState", "ARMED"], ["burglaryAlarm", "ALARM"], ["fireAlarm", { value: "FIRE" }]],
},
{ namespace: "Alexa.TemperatureSensor", page: "alexa-temperaturesensor", declared: [{ options: reported, example: "discovery" }] },
{
namespace: "Alexa.ThermostatController",