Ever walked into a room in your house and just wanted to hear music?
Sure you can get your phone out, load up your Sonos app, select a room, then a playlist but wouldn't it be great if that could all happen through one click of a button?
That is exactly what this project will enable you to do and it does not require any coding, just configuration on existing applications available through Github. With all the components to hand this setup process should not take more than an hour.
If your just interested in how to hack an Amazon Dash then read Steps 1 + 2.
Step 1 - Get and Hack your Amazon Dash ButtonGet an Amazon Dash button and download the Amazon App to your mobile.
Follow the instructions on the app to register the Dash button BUT make sure you skip the last part where you are asked to associate the Dash with a particular product. Just quit from the app.
Amazon will keep on reminding you to complete the setup, however if this gets annoying just uninstall the app.
Step 2 - Setup Dasher on your Raspberry PiDasher is the piece of software that will talk to your Dash button and allow you to do cool things with it. Follow this link and scroll down to the Setup part. I used a Pi3 but it should work with any Raspberry Pi product.
I do strongly suggest that your Pi is wired up to your network via Ethernet. With WiFi I frequently found that the Dash click was not being picked up by dasher.
Step 3 - Get your Raspberry Pi to talk to SonosSo far we have hacked the dash button and got it talking to a server side piece of software called dasher. Now we need dasher to talk to our Sonos system. To achieve this install this application from Github called node-sonos-http-api. Again follow the setup instructions in the readme file.
Step 4 - Putting it all togetherNow its about configuration. Go into the configuration file for dasher using nano editor:
pi@raspberrypi:~/dasher/config $ sudo nano config.json
The configuration file controls what happens when you click the Dash button. In the example below I have told it to call a playlist I have on Sonos called 'work tunes' in my 'office'.
{"buttons":[
{
"name": "Sonos Playlist",
"address": "50:f5:da:1d:01:86",
"url": "http://192.168.1.93:5005/office/playlist/work%20tunes,
"protocol": "udp"
}
]}
Notes: '%20' is used to encode spacing in the URL link. Also, You will need to change 192.168.1.93 to the IP address of your Raspberry Pi, the port (5005) stays the same. Create your own configuration file and save it.
Finally, run the dasher application and the node-sonos-http-api. If you have done this correctly it should look like this:
Now click your Dash button and enjoy the music! Any questions let me know.
Comments