This app starts a Sonos favorite by scanning a NFC tag.
I started this project to simplify starting audio books on Sonos for the kids. Now they have a set of printed CD covers from which they can choose what they want to listen to. Choosing the same on the display of a smartphone or tablet always felt odd somehow. Now they can search through their collection of CD cover cards and pick one. By holding the card on a smartphone the Sonos box starts playing the linked album.
- Print a CD cover
- Stick a NFC tag on the back
(I'm using photographic paper for printing. After sticking the NFC tag on the back I glue a cardboard over it.)
Sonos App
- Create a favorite in the Sonos app for a specific album
NFC Controller App
- Login with your Sonos credentials
- Select the Sonos group which the app should control
- Go to the "Pairing" section
- Choose the Sonos favorite from the dropdown and hit the "Pair" button
- Hold the NFC tag on (or behind) the phone to link the tag with the favorite
Now you can put the printed CD cover on your phone to start the album on the Sonos box. The app doesn't have to be started but the screen have to be turned on.
The app requires a Sonos login as it controls the box by sending commands to the Sonos cloud. In an early stage I was using UPNP commands which were sent to the Sonos box directly (no Sonos login necessary). But that turned out as too slow and too unstable. So I decided to send the commands through the Sonos cloud.
The Sonos Cloud API doesn't allow to play an album from e.g. Spotify in a direct way (see Stackoverflow). The workaround is to create a Sonos favorite of an album.
- Set speaker volume to a level which was configured in the app preferences
Sounds: https://mixkit.co/
CD cover placeholder image: Designed by rawpixel.com / Freepik
App icon made by Flat Icons from www.flaticon.com