Hack the Amazon Dash button to control a SmartThings switch

project_remotes

(Jim W) #21

To me the fun part of "hacking" something is that when it stops working you can continue to hack on it to try and make it better. While the battery is spot welded in place, the tabs it's on look easy enough to cut off and then I can add my own battery solution (or I can jury-rig a my own tabs to keep the battery in the same hardware).

Thank you for the teardown link, that was interesting. As an edit at the end of that link, it seems people are already figuring out how to reprogram the dash completely. Thus it may be possible to have Dash work with SmartThings without the need for the intercept script & server.


#22

It's a start. They haven't figured out how to access the WiFi features yet, though--just make the LED button blink on the dash itself.

But all that kind of noodling around is fun when you like that kind of thing. 😎

These days, I'm grateful for well-engineered stuff that works to solve practical problems. Because I deal with a lot of practical problems. But I certainly understand the joy of exploration.

Just wanted to make sure people who were looking for practical solutions understood what was being discussed.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy; NOT a SmartThings Employee.) #23

I didn't mean to imply that there are no uses for these Dash Buttons ... they definitely seem appropriate for children due to their robust form factor.

However, the point of a $5.00 button is to save money because you are using them in quantity -- quantity sufficient to justify running the server as well (yes -- a few of us have servers running, of course, but ... not everyone!).

But there is one point not mentioned: These are pretty insecure. MAC addresses can be spoofed. I wonder if these broadcast their MACs at any time before being in WiFI encrypted mode.

So while I can think of 1 or 2 uses for them, that's too few when a relatively cheap alternative is available. I'm not sure what minimum quantity would be worthwhile.


For the "Presence" case, car or otherwise, consider my beta SmartApp which would enhance security by requiring you to not just press one Button, but a sequence of Buttons (a PIN) of as little as, well, 1 or 2 digits, frankly. This gives you 2-Factor Authentication for arrival presence (the unique secure Z-Wave Aeon Minimote Device, and the PIN sequence you must enter, making the Device unusable by intruders):


(The fish is still dead.) #24

Remove the count parameter from the sniff() call. That tells it how many packets to sniff before quitting. @mager, consider this a PR for the final script from the OP. =)

-- print sniff(prn=arp_display, filter="arp", store=0, count=10)
++ print sniff(prn=arp_display, filter="arp", store=0)


(Pablo) #25

Thank you for the post. I came up with my own implementation as a result of your documentation. I'm intercepting at the HTTPS layer instead (it does away with the need for sniffing, and can run as non-root).

My writeup here: http://pablo.averbuj.com/2015/09/21/how-im-using-amazon-dash-buttons-for-smartthings


#26

You really should be giving Mager credit for this in your own site. You even acknowledge here that your method was derived from his. Just saying :smile:


(Scott Windmiller) #27

Just following up on how the battery life seems to be working on this. Too bad there is not a way to replace the battery.


(Colin) #28

Just wanted to point out that if you have a decent router, you should be able to log in and view your DHCP leases and get the MAC address for the button there, no python required


(Cinghia Lino) #29

time to create a new account.


(Tom forti) #30

Found this the other day. Useful for May different projects with a dash.
https://github.com/hortinstein/node-dash-button


(Oceans Crashing) #31

This article seems to be targeted at tinkerers, who are likely to have at least one device in their home running an HTTP stack that is available on-demand. Running a 24 hour server needn't be expensive; The Photon (Sparkfun Core,) Arduino, and even Pi can be powered with very modest current draws.

I just started playing with my first Dash button recently, but I ran it through about 300 cycles, and the battery is still going strong. I get the feeling that your 2 month estimate is undershooting what the dash and a AA battery can get done. If it really came to it, the on-board LED can be bypassed for some power savings.

The Flic button is something I'm looking at also, but it's not a replacement for me; You can only pair the Flic with one device (phone) at a time. For me, that's a deal breaker. If I'm just out of range, and my girlfriend would like to use the Flic button, she's out of luck. Unless I share the button with her, and she sets up the actions for her phone.

This is one scenario where a central server is beneficial; If we have a lightweight device listening for button-presses, that server is a one-stop-shop for programming buttons. And if I administer that device, I most likely have access to my personal libraries and APIs, instead of being limited to whatever Flic, or whatever the company may be, approves and exposes.

I would love it if Flic would support and encourage more open-source development.


#32

I understand.

At my house we have several tablets around in permanent locations which act as home automation dashboards. So we pair the flics to those. Rather than to any one person's phone. We also use the tablets as iBeacon receivers. So I have an IBeacon on my wheelchair which then gets picked up by the different tablets. Rather then positioning the IBeacon on the wall and picking it up on my phone.

So just depends on how you have things set up. 😎


(zraken) #33

A couple of things to note on this hack:

url = 'YOUR_API_ENDPOINT'

should really be

url = 'YOUR_API_ENDPOINT/switches'

you need to remember to add /switches at the end of what you copy from the App IDE screen as shown in the original post.

Also, once you've got the Dash setup without picking the item to ship you will get a notification on your mobile app every time you press the button reminding you to complete the setup. This is very annoying so you might want to consider creating a separate Amazon account for the Dash so you won't be bothered with these notifications on your regular account.


(Tom forti) #34

Another interesting thing i found https://aws.amazon.com/iot/button/


(Ash (www.smart-dots.com) / Ashutosh Jaiswal) #35

I can think of a use case with this button that will help me . My HVAC system uses the 4 inch filter that lasts somewhere between 4 to 6 months per filter and is inserted in line with the HVAC unit.

One problem I have is I tend to lose track of when I changed the filter. A button like this if placed next to the HVAC system can be pushed everytime I change the filter and when I push the button a smart app can perhaps keep a track of the date.. And send push notifications when the filter gets 3 months old .. 6 months old or past due..this can also be combined with a smart thermostat if the ON time of a thermostat can be some how calculated and accumulated over time.. With these inputs I can determine how many hours was the filter on as well as then last changed date - will make things more efficient.. No?


(Chris Eaton) #36

I’m running dd-wrt; would you mind sharing some information on your router configuration that emulates a response to the dash? I’m assuming this both saves battery and prevents the notification from the Amazon Shopping app, which would be really nice.


(Jody) #37

Not my exact code from last year, but here is a good tutorial.


(Anthony Williams) #38

So im pretty sure that this code works but something is not working in the ide i keep getting IllegalStateException wheneven i use this code or even the Alfred Workflow from the code repo. It says getReader() is already in use which sounds like someone screwed up on the back end code and now its not working properly thanks Smartthings i was so looking forward to using my dash buttons …


(Cadocomp) #39

Where do I put this updated Python Script? I have the MAC and when I push the button, it tried to launch that Python script from my PC (I believe) and then Amazon App opens and asks me to finish setup. Sorry Noob question


#40

@ruricu for ddwrt http://nbiq.blogspot.ca/2016/07/connecting-amazon-dash-buttons-to-ifttt.html
for tomato https://davekz.com/hacking-amazon-dash-buttons/
hope it helps!