Custom Command: Enqueue­Play­Named­Choreo

Alexander Martin

You want to use the PlayNamedChoreo command in an onMount handler but it works very unreliably?

When a user uses the wake up word, the Smart Motion extension is temporarily disabled. As a workaround, you could work with the delay property, but even that doesn't guarantee that the command will be executed afterwards.


User: Alexa, do something Alexa: Your skill sends a response with a RenderDocument directive and your APL document uses an onMount handler with the PlayNamedChoreo command.

In this case, the Smart Motion extension may still be blocked by the wakeup word acknowledgement.

Learn more about the error states

I made this custom command "EnqueuePlayNamedChoreo" which ensures that the command is executed within a defined timeout (the default is 1 second). It checks if the Smart Motion extension is in an error state and whether the specified choreo is available.

To use the command you need to copy "EnqueuePlayNamedChoreo" (the command starts in line 24) into your APL document, also you need to load the Smart Motion Extension (this happens in line 11) in addition to configure the deviceStateName property of the extension with the value deviceState (this happens in line 7).

How to use this command:

"onMount": [{
  "type": "EnqueuePlayNamedChoreo",
  "name": "ScreenImpactCenter",
  "timeout": 3000
nameStringThe name of the choreo to be played.
timeoutnumber1000The timeout in milliseconds.
throttlenumber100The time to wait before retesting.

Be the first to comment.