Skip to content

Smart Home

alexvolchetsky edited this page Nov 3, 2021 · 1 revision

This library supports smart home skills. A simple demo project was created to demonstrate smart home skill possibilities. It combines skill itself and the OAuth server (it uses IdentityServer4). You can see it in action using the following guide.

Demo project setup

  • Deploy Yandex.Alice.Sdk.Demo.SmartHome project and verify service availability curl -i -X HEAD 'https://yourhost.com/v1.0' .

  • Open https://dialogs.yandex.ru/developer and create a new Smart home skill.

  • In the Settings tab make sure you've populated the following fields correctly:

    • Backend: https://yourhost.com
    • Access type: Private

  • Populate other mandatory fields in the Settings tab.

  • Open the Account linking tab and populate the following fields:

    • Application ID: alice
    • Application secret: any value. Our client doesn't use it.
    • Authorization URL: https://yourhost.com/connect/authorize
    • Get token URL: https://yourhost.com/connect/token
    • Refresh token URL: empty. We don't use Refresh token for simplicity. This client configuration can be found here
    • Activity group ID: openid IdentityServerApi

  • Go back to the Settings tab and deploy your skill. Yandex will send requests to https://yourhost.com and will show errors if something is configured incorrectly.

  • Open Testing tab and attach the account to your skill.

    • It will open Yandex Passport. Confirm access there.

    • Next, it will redirect to https://yourhost.com/Account/Login endpoint. Fill in:

      • Username: alice
      • Password: alice
      • Remember My Login: true
    • After that, it will redirect you back to https://dialogs.yandex.ru/developer

    • Now refresh the list of devices.

    • If everything is configured correctly you should see the following screen:

    • That's it. After that, you can explore how Yandex displays info about devices.

Clone this wiki locally