Alexa skill for playing a random album for a given artist from spotify. This is especially useful for kids to play audio books (German: Hörspiele) from their favorite 'artist', which is not possible with the original spotify app currently.
Since the skill is based on the german language the invocation name and sub-commands are in german as well. If you want to translate the commands you have to adapt the interaction model in the Alexa developer console accordingly
„Öffne mein Hörspiel“ (or your custom invocation name)
Spiele (eine Folge) <artist>
Öffne mein Hörspiel und spiele (eine Folge) <artist>
Spiele eine andere Folge
or
Gefällt mir nicht
If you have multiple Alexas configured you can choose which Alexa (or which Group) should be used for output.
Konfiguriere Ausgabegerät
Alexa will now list all available devices and assign a number to each of them. It will then ask which number to use as default output device.
Pause
Fortfahren
- Go to https://developer.amazon.com/alexa/console/ask and sign-in.
- Follow the instructions from https://developer.amazon.com/en-US/docs/alexa/hosted-skills/alexa-hosted-skills-git-import.html#import (use https://github.com/AceTheFace/mein-hoerspiel-skill.git as .git link in step 9)
- If you receive a warning like "invalid invocation name" after import, go to "Invocation name" on the "build" tab and enter a proper invocation name, for example "mein hörspiel". Check alexa documentation to see what a proper invocation name looks like. I use "mein hörspiel".
- In order to enable the skill to access a users spotify account you have to enable "account linking" for the skill:
Use the following entries:
- Your Web Authorization URI: https://accounts.spotify.com/authorize
- Access Token URI: https://accounts.spotify.com/api/token
- Your Client ID: will be added in a later step
- Your Secret: will be added in a later step
- Your Authentication Scheme: HTTP Basic (Recommended)
- Add two scopes:
- user-read-playback-state
- user-modify-playback-state
- Keep the tab open since we need the displayed "Alexa redirect URLs" later
- Go to https://developer.spotify.com/dashboard
- Click "create app"
- Use the following entries:
- App name: Mein Hörspiel (or whatever you like)
- App description: App for 'Mein Hörspiel' Alexa skill (example)
- Redirect URI: Insert the first (!) Alexa redirect URLs from above
- Which API/SDKs are you planning to use: Web API
- Click "save"
- Click "Settings" again to edit the app configuration again
- Add the remaining two Alexa redirect URIs.
- Save configuration
Reopen "settings". It should now look like this:
Click "view client secret" and keep this tab open. Switch back to the Alexa Console Tab
Copy Spotify Client ID and Client Secret to the account linking fields "Your client ID" and "Your secret" and hit save.
In Alexa Developer Console switch to the "code" tab and hit "deploy". This will make the skill available to your Alexa account. Others cannot use it!
- Open the alexa app on your phone go to "more+" and "Skills and Games".
- Scroll down to the button "my skills"
- Scroll to the right until you see "Developer", it should display at least "1" skill. Once you select it you should see your "mein hörspiel" skill:
- Click on the skill and in next screen choose "to use skill, activate it".
- If account linking has been setup properly a spotify login dialog should show up. Once entered your spotify credentials the skill should be activated properly and you're ready to use it on your Alexa devices by using your invocation name.
Thank you!