User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Amazon Dash and Philips Hue

Wed Jan 04, 2017 4:36 pm

Nothing particularly revolutionary here except that its all gone together particularly easy and I thought I'd share:

I have a full multibulb colour Philips Hue lighting setup in my house, an Amazon Echo Dot, Energenie Plugs and a Sonos - using one of my four original four and half year old Raspberry Pi B's - I have linked them all together, happy to discuss how elsewhere but the subject of this post is how I integrated an Amazon Dash Button into this setup.

The trigger for this was two fold; 1. our wireless doorbell broke and 2. getting people to leave lightswitches on all the time and use Alexa or the Hue App to turn bulbs on/off/red/blue etc does not go down too well - and wireless lightswitches are expensive and difficut and expenseive to install in UK households

So what to do? In both cases I need a simple push switch that can talk wirelessly to the Raspberry Pi so it can play a doorbell chime to the Sonos or tell the Philips Hue Hub to turn on the required light (or lights)

The answer came with the Amazon Dash Button
Image

These little babies cost just FIVE POUNDS and although meant to drive orders into Amazon for products
https://www.amazon.co.uk/s/ref=nb_sb_ss ... buttons+uk

But bright souls on the internet have:

a) found a trivial way to hack this
b) identified how to trap the ARP request that goes out over wifi when the butt is pressed

These little guys are actually a little Linux box with WIFI capability and 1.5V AAA battery which only boot up when the button is pressed meaning that each is good for over a thousand presses before that little battery expires.

To configure your Amazon Dash Button for use follow the first 1 minute 40 seconds of this video
https://www.youtube.com/watch?v=x8mIGvoodDk

Don't go past 1 minute 40 seconds as after that the QuickPI example is horrid - there is better option called Dasher

The software you need on your raspberry pi is Dasher - see https://github.com/maddox/dasher

Follow the instruction to install dasher and then use the bin/find_button script to find the MAC address for your Dash Button

You then use this to update the config/config.json file so that dasher knows what to do when it sees the Dash Button pressed - here's mine (suitably obfuscated) which links the button press to turning on of a Philips Hue bulb

{"buttons":[
{
"name": "Playdoh Dash Button",
"address": "ac:63:be:29:71:21",
"timeout": "10000",
"url": "http://192.168.0.2/api/MYPHILIPSHUEID/lights/13/state",
"method": "PUT",
"json": true,
"body": {"on":true}
}
]}

You can have as many buttons as you like and you can put almost any kind of URL in there as the trigger action - which of course could be a LIGHTTY/PHP url where you could do ANYTHING AT ALL ;-)

Here are a couple of videos showing my simple setup in action:-

What you see on the Raspberry Pi
https://www.youtube.com/watch?v=57F613rx-QM
(I have simply nohup'ed the node.js dasher code so can catch the output though nohup.out)

What actually happens for me:
https://www.youtube.com/watch?v=3j1h28fs_d4

Hope that was useful for people - to confirm, I didn't create any of this stuff, I just thought I'd show people the easiest to way to set it up....
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Amazon Dash and Philips Hue

Wed Jan 04, 2017 10:37 pm

And to finish off with the doorbell requirement?

The Amazon Dash Button is reasonably weather proof and could be affixed on the outside of the house

I have this https://github.com/jishi/node-sonos-http-api installed on the same Raspberry Pi which allows me to drive my Sonos gear from the Raspberry Pi

And also allows me to change my config.json file to

{"buttons":[
{
"name": "Playdoh Dash Button",
"address": "ac:63:be:29:71:21",
"timeout": "10000",
"url": "http://192.168.0.22:5005/kitchen/clip/doorbell.mp3",
"method": "GET",
}
]}

So when the Amazon Dash button is pressed my Sonos in the kitchen plays a loud doorbell sound...
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

Return to “Automation, sensing and robotics”