Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 3.3 KB

README.md

File metadata and controls

62 lines (39 loc) · 3.3 KB

NFC Controller for Sonos

This app starts a Sonos favorite by scanning a NFC tag.

app icon

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.

Get it on Google Play Buy Me A Coffee

How to

  1. Print a CD cover
  2. 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

  1. Create a favorite in the Sonos app for a specific album

NFC Controller App

  1. Login with your Sonos credentials
  2. Select the Sonos group which the app should control
  3. Go to the "Pairing" section
  4. Choose the Sonos favorite from the dropdown and hit the "Pair" button
  5. 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.

animation

Technical considerations

Sonos cloud

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.

Need for Sonos favorites

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.

TODO

  • Set speaker volume to a level which was configured in the app preferences

Screenshots

1 2 3 4

Credits

Sounds: https://mixkit.co/
CD cover placeholder image: Designed by rawpixel.com / Freepik
App icon made by Flat Icons from www.flaticon.com