Announcing a new CLI for Alexa Smart Properties

Tim Rule Jun 03, 2024
Share:
Alexa Skills
Blog_Header_Post_Img

 

Today, Alexa Smart Properties (ASP) introduced a new ASP-CLI (Command Line Interface) tool, which is designed to simplify the process of integrating with the platform's REST APIs. This tool is released for ASP property administrators, ASP property operators, and ASP developers. With just one tool to download and configure, ASP property administrators can perform a variety of operations with a few lines of script — these would have previously required custom tool development.

Before today’s announcement, property administrators would use APIs to create, delete, modify, set settings to ASP properties, units, and devices. Integrating these APIs could be a complicated process that required administrators to allocate dedicated engineering resources.

The Command Line Interface wraps each ASP API within a command executable directly from a shell or script. For instance, executing asp-cli delete-all-reminders --unitid X is akin to integrating the API DELETE /v1/alerts/reminders?unitId={X} into a tool and executing it: this action removes all previously set reminders from devices linked to a specific unit (e.g., room) X. This operation is useful in properties with high guest turnover, preventing reminders meant for previous guests from reaching subsequent guests. Using the CLI tool, numerous simple administrative tasks concerning ASP properties, units, and devices can be completed within minutes, eliminating the need for days or weeks of integration effort. Examples of such operations include: 

  • Set the locale for one unit or a list of units - if a resident is a Spanish speaker instead of English speaker (example #1 below)
  • Get the connectivity status of all devices in a property or an org - to assess the health of a device fleet (example #2 below)
  • Enable a skill on a property, or a set of units - to extend the conversational capabilities of Alexa in the rooms (example #3 below)
  • Assign devices to rooms in a property - for example when installing new devices or replacing devices
  • Find for devices by name, model or manufacturer
  • Search rooms by name and apply settings
  • Reset all the rooms and devices with the the same configuration
  • Create a address book, create and delete a contact in an address book -so residents can call their contacts directly from Alexa
  • Create and schedule rotating campaign cards for the property - for example to advertise the upcoming yoga session in a senior living community 
  • Schedule reminders for a room - for example to remind hotel guests about upcoming checkout time or the last shuttle bus to the airport
  • Send out visual cards to support room check-ins, food menus, or hospitality events
  • Reset all settings, reminders, alarms, notifications for all devices in a room - when a guest checks out of a hotel room


Examples of commands:

Copied to clipboard
#1 asp-cli set-locales --endpointid $endpointid --value 'es-US'
#2 asp-cli get-endpoint-connectivity —endpointid $endpointid
#3 asp-cli enable-skill-multiple-units –skillid $skillid –unitids "$unitid1,$unitid2,…"

Illustration: example of a script to reset all settings and alarms in a room:

 

 

Key Benefits of the ASP-CLI:

  1. Full API Coverage: The ASP-CLI provides comprehensive coverage of the REST ASP APIs, ensuring you have access to all the existing functionalities.
  2. Scripting Samples: The tool comes with a collection of scripting samples, making it easy for you to start and learn using it.
  3. Traffic Throttling Management: Like every connected service, ASP has limits in how many API calls can be done per second (throttling). The tool handles rate limiting and failed network requests seamlessly, ensuring your API calls are made at a controlled rate and without interruptions.
  4. Pagination and Bulk Operations: The tool automatically manages pagination in returned results and leverages bulk operations where available, simplifying the processing of large data sets.
  5. Data Caching: The ASP-CLI offers a local caching functionality for units, endpoints, and skills. This improves performance by reducing redundant API requests.
  6. Output Capture and Replay: The tool supports the capture and replay of API calls, enabling you to review and reproduce API interactions for easier debugging and testing.

The CLI can be used for command lines. Because it is distributed as source code, it can also be used as a library that you integrate to your own source code to expand the capabilities of your tools.

The CLI tool is distributed running on Node.js, and can run on Windows 11, Mac, Windows Server, Linux Client and Server, Lambda functions. To use it, install Node.js, download the CLI from the GitHub repo, and start using the commands provided in the cookbook and in the sample scripts. For a complete and detailed list of instructions, follow the README and COOKBOOK.

Recommended Reading

3 questions with Labinot Bytyqi, CEO and Founder of virtual healthcare delivery platform hellocare.ai
Learn more about Alexa Smart Properties
New developer tools to build LLM-powered experiences with Alexa

Subscribe