Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template management #3

Open
dominik-meissner opened this issue Jun 4, 2024 · 7 comments
Open

Add template management #3

dominik-meissner opened this issue Jun 4, 2024 · 7 comments

Comments

@dominik-meissner
Copy link
Contributor

I would like to manage the templates via API as well.
For instance add the v1/templates?ownerId={{unitId}} endpoints to query existing templates.

@billykuo
Copy link
Contributor

billykuo commented Jul 1, 2024

Hello! Are you referring to Room Templates on ASP Console?
If that's the case, unfortunately Room Template is a console only concept and there's currently no plan to add API support.

@dominik-meissner
Copy link
Contributor Author

Thanks for your answer. That is something that should be on the roadmap. Setting up a property with 100+ rooms requires to select every single room and apply the template by hand. To automate this process and set up a property fully automated we really need this functionality on the API.

@billykuo
Copy link
Contributor

billykuo commented Jul 2, 2024

While there's no support to use room templates with API directly, you can use API to do the same things that you can do with room templates.

For example, rather an an API to apply room template to setup skills and and settings for rooms, use https://developer.amazon.com/en-US/docs/alexa/alexa-smart-properties/endpoint-settings-api.html and https://developer.amazon.com/en-US/docs/alexa/alexa-smart-properties/skill-management-api.html directly.

We have also recently made bulk API calls easier with the introduction of ASP CLI. With the CLI you can use the update-property from cache which will hit every endpoint or unit with the setting. For units it will use the bulk operation if available. Example:
asp-cli update-property-from-cache --apply set-default-music-station --providerid “I_HEART_RADIO” --stationid “7193”

Please take a look and let me know what you think. Thanks!

@dominik-meissner
Copy link
Contributor Author

You are right, I can configure a room with the above calls.

But only to a limited degree. Templates let you predefine all device settings (language, wakeword, distance unit,...) without any device in present in the room. Having done that, all associated devices in the future will have these (pre-configured) settings. Otherwise i need to do the settings for every single device after association. Thats a big source for error. If i move devices from room to room or replace a stolen device i need to be really careful. Templates are a really good solution here.

The ASP CLI cant help here as well, it lacks the same problem: the device needs to be present in the room.

@billykuo
Copy link
Contributor

billykuo commented Jul 3, 2024

That's a good feedback. Thanks. I'm thinking one way we may be able to improve on this without needing to change the API is to have a new macro action in the CLI that can associate device to unit and also apply settings at the same time. That way the client wouldn't have to remember to do both.

@dominik-meissner
Copy link
Contributor Author

Thanks for your feedback!

The macro action will have one issue as well: Settings can only applied while the device is online. So in some corner cases the device might not be online and pushing the settings will fail. Then you need to build a workflow to recover once the device is online again (which might be a while). Template usage never has that issue.

To be honest: I am not a big fan of the CLI approach. We have build everything on NodeJS and call the endpoints our self. This gives us super flexibility to build custom workflows no one thought of. And thats why we are asking for more API access.

@billykuo
Copy link
Contributor

billykuo commented Jul 3, 2024

Understood. I just want to set expectation that an API change would be a bigger ask and support for room template is unlikely going to be available in 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants