alexa-smart-home-skill

Can't play siren audio on Chime event (Alexa.SecurityPanelController.Alert)


I'm following aws docs to find out how to play siren audio when an alarm is triggered by security device.

The discovery answer of my device is here:

{
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "messageId": "807271bc-177c-494c-bde9-f320e499f1a6",
      "payloadVersion": "3"
    },
    "payload": {
      "endpoints": [
        {
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SecurityPanelController.Alert",
              "version": "1.1",
              "properties": {
                "supported": [
                  {
                    "name": "sirenState"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "assets": [
                  {
                    "id": "b75ce6f5-1dbb-48d1-9863-7fb45444703b",
                    "url": "https://mywebsite.com/assets/public/audio/arm_sound.wav"
                  },
                  {
                    "id": "a4118533-5352-4918-b283-afc5fb6b1cd5",
                    "url": "https://mywebsite.com/assets/public/audio/beep.ogg"
                  }
                ],
                "playlists": [
                  {
                    "id": "cc2c1eb9-81eb-4d50-98c1-dc2d4fcd9e98",
                    "playOrder": [
                      {
                        "assetId": "b75ce6f5-1dbb-48d1-9863-7fb45444703b"
                      }
                    ]
                  }
                ],
                "alerts": [
                  {
                    "type": "SIREN",
                    "defaultPlaylistId": "cc2c1eb9-81eb-4d50-98c1-dc2d4fcd9e98"
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.SecurityPanelController",
              "version": "3",
              "properties": {
                "supported": [
                  {
                    "name": "armState"
                  },
                  {
                    "name": "burglaryAlarm"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              },
              "configuration": {
                "supportedArmStates": [
                  {
                    "value": "ARMED_AWAY"
                  },
                  {
                    "value": "ARMED_STAY"
                  },
                  {
                    "value": "DISARMED"
                  }
                ]
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa.EndpointHealth",
              "version": "3.2",
              "properties": {
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ],
                "proactivelyReported": true,
                "retrievable": true
              }
            },
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            }
          ],
          "description": "My alarm...",
          "displayCategories": [
            "SECURITY_PANEL"
          ],
          "endpointId": "659d0a3a6485cf4d09544f72",
          "friendlyName": "Office alarm",
          "manufacturerName": "My alarm"
        }
      ]
    }
  }
}

Here the first problem, because the Alexa App under my device settings not show any menu entry about audio play device configuration.

Going forward, when an alarm is triggered I sent the 'Chime' event as described in docs, the Alexa Gateway server response code is 202, but nothing happen. This is my event:

  {  
                "event": {
                  "header": {
                    "namespace": "Alexa.SecurityPanelController.Alert",
                    "name": "Chime",
                    "messageId": uuid.v4(),
                    "payloadVersion": "3"
                  },
                  "endpoint": {
                    "scope": {
                      "type": "BearerToken",
                      "token":  user.alexaEventGateway.access_token
                    },
                    "endpointId": device._id.toString(),
                  },
                  "payload": {
                    "playList": "cc2c1eb9-81eb-4d50-98c1-dc2d4fcd9e98",
                    "timestamp": timeOfSample
                  }
                },
                "context": {
                    "properties": [
                      {
                          "namespace": "Alexa.SecurityPanelController.Alert",
                          "name": "sirenState",
                          "value": {
                            "state": burglaryAlarm ? "ON":"OFF"
                           },
                          "timeOfSample":  timeOfSample,
                          "uncertaintyInMilliseconds": 0
                      },
                      {
                        "namespace": "Alexa.SecurityPanelController",
                        "name": "burglaryAlarm",
                        "value": {
                          "value": burglaryAlarm? 'ALARM':'OK'
                        },
                        "timeOfSample":  timeOfSample,
                        "uncertaintyInMilliseconds": 0
                      },
                      {
                          "namespace": "Alexa.SecurityPanelController",
                          "name": "armState",
                          "value": this.device.armState,
                          "timeOfSample": timeOfSample,
                          "uncertaintyInMilliseconds": 0
                      },
                      {
                        "namespace": "Alexa.EndpointHealth",
                        "name": "connectivity",
                        "value": {
                          "value": "OK"
                        },
                        "timeOfSample": timeOfSample,
                        "uncertaintyInMilliseconds": 0
                      }
                    ]
                  }
            }...)

But not sound is played, and not event is logged in the device log.


Solution

  • Please note that the chimes/siren feature is currently only supported for US, DE, FR, CA, and UK regions. So, if you are implementing chime sound events for a region other than those mentioned, you will not be able to see any sound options in the device settings page on the Alexa app, even if you send the “Chime” event correctly and Alexa Event Gateway responds with a 202 status.