Control Spotify on your computer remotely with a Google Nest e.g. "hey Google, music pause". Useful if you typically listen to music in bed from your Desktop computer.
Google Nest has native support for Spotify remote control, so you should probably only use Astra if you have additional requirements to what they offer.
Works by connecting these services up to each other, in order:
- Google Nest
- IFTTT
- Adafruit MQTT
- Astra (this app)
- Spotify Web API
- Spotify on your computer
Based on Adorable QTPI
- Install Python libraries:
pip3 install -r requirements.txt
- Copy
example.ini
toconfig.ini
- Set up an MQTT topic:
- Set up an IO Adafruit account
- Create a new feed called
astra
- In
config.ini
undermqtt
set:topic
from Feed Info under the feed's nameusername
is from My Key -> Username at the top of the pagepassword
is from My Key -> Active Key at the top of the page
- Set up a Spotify App:
- Create your Spotify app
- In
config.ini
underspotify
setclient_id
/client_secret
- Edit your app settings to add the Redirect URI
http://localhost:4000/callback
- Set up IFTTT:
- Create an IFTTT Applet
- Set If This to the Google Assistant trigger Say a phrase with both a number and a text ingredient
- Choose your activation phrase/reply, remembering to include the
$
in the phrase e.g. "music $" - Set Then That to Adafruit IO
- Choose your Feed from earlier as the Feed name
- For Data to save use Add ingredient and select TextField
- Run the script with
python3 astra.py
- Log in to Spotify to give Astra access to control your Spotify player.
- Use the voice commands you set up in IFTTT to control playback:
- "hey google, music play" -> Plays music on Spotify desktop
- "hey google, music pause" -> Pauses music on Spotify desktop