I wrote this little Electron application so that I could automatically pause Spotify in my Tesla Model Y when it autoplays and I get in the car.
This polls the Spotify and Tesla APIs and detects the situation in question this way:
- Check if user is playing music on Spotify
- Check if user is detected by the car
- If (time_music_detected) and (time_user_detected) are less than 3 seconds apart, then (pause).
- Windows x64
- Theoretically, any platform would work, but I only have Windows. Others can feel free to test it out yourself!
- Head to https://github.com/jakelauer/teslafy/releases and download the most recent package
- Unzip it somewhere (maybe Program Files?)
- Run "Teslafy.exe" in the unzipped file
- The application will prompt you for your Tesla account username, as well as a Spotify app client ID and secret. Upon providing those, close the settings window and everything should start working.
- Follow instructions here: http://support.heateor.com/get-spotify-client-id-client-secret/
- Clone the repo!
- Run
yarn install
to install dependencies - Run
yarn electron
to start the project - Run
yarn build
to build Windows oryarn build:all
to build all platforms