Hack the Amazon Dash button to control a SmartThings switch

project_remotes

#12

BTW, I solved the "teleporting" problem by adding transitional modes. If the mode is home and my phone or presence sensor suddenly says I've left and cone back, none of my arrival events, like unlocking the door, trigger, because I didn't go through the transitional "I'm leaving" mode first. The transitional modes are not triggered by geopresence, but rather a physical state like a contact sensor on the door.

It's more work to set up, but it fixes the drop off problem.


(Tom forti) #13

The issue is my hub thinks I left. I see this in my lock activity. I actually never looked at what my phone was doing until now and it's crazy!


#14

Yep, that's exactly what happens to me, I've posted similar screenshots in the other presence topics.

Any Geopresence which depends on your device being connected to either the hub or your home network will think that you left if the device briefly loses that connection. Then when the device reconnects, which the phone or the smartthings presence sensor will do automatically, smartthings thinks you have arrived home. Even though your device may have been sitting in one place the whole time. That's what I mean by "teleportation." And that's exactly the issue that I address with the occupancy approach in the topic I linked to in my previous post.

Since presence issue discussions would be off topic for this thread, why don't we continue further discussion on the other topic. 😎


(Tom forti) #15

Cool thanks. I'll have to look into it. Back to the topic, so being that I have a RPI already running in the house for Alexa it's not a big deal to just have the Python scrip running on it as well. Now I'm not expecting a long battery life but looking at posts it looks like the dash just runs on a AA so that's not a big deal to me to change. I just like having the idea that I have a cheap $5 button I can place where ever I want and by using a virtual switch and smart app I can have it do what ever combo I want or need it to do. No the flic is cool but it's also 40 bucks. I can hook up 8 dashes for the same price of one flic. Plus I don't feel BLE is reliable, at least with my experience with my trackR tags and my iPhone.


(Tom forti) #16

Does your scapy timeout after 2 mins or so? Both on my Mac and RPI it is. Need something that stays online too listen for the ARPs


#17

OK, the following teardown says the Dash lithium battery is spot welded in place, making it not possible to replace. They're estimating close to 1000 uses of battery life. However, as was already mentioned in this thread, the device has a built-in repeater, so that it actually will make five attempts each time if it doesn't connect to Amazon. I'm not sure whether the approach detailed in this project means you'll only get 200 button presses of battery life or not. It'll be somewhere in the range of 200 to 1000 anyway.

http://mpetroff.net/2015/05/amazon-dash-button-teardown/

So compare that to Flic's spec'd 60,000 uses. Since the Flic at Amazon costs 7 times the Dash but lasts at least 60 times as long, the Flic has a much lower cost per use over time. And the flic's battery is easily replaceable (,standard twist off compartment), preserving your investment in the device itself.

http://www.amazon.com/Flic-Wireless-Smart-Button-White/dp/B00ZAEOC5K

So as usual, it comes down to your use case. If you're using it as a switch that you only operate maybe once or twice a week, it's pretty similar to Amazon's intended use pattern and you'll probably get two years out of it. But then you have to replace the whole device.

If you're using the Dash for a switch that you expect to use four times a day, battery life will likely only be a couple of months. And then again you'll have to replace the whole device.

And if you give it to the baby to play with, it could be a few weeks.

Just sayin'...


(Andrew Mager) #18

Yea, just to be clear, this isn't meant to be a practical use case. Just hacking the button smile


(Jody) #19

As @mager pointed out this is just a fun hack. The button is 5 bucks. I am doing the interceptions on my router so the button actually thinks it's getting a response and only sends the one message. @mager just beat me to posting about it. :smiling_imp:

If you have a hackable router like dd-wrt or PFsense there are methods of intercepting and executing a script without running another server.


#20

I'm all in favor of fun hacks. 😉 💫 🚀

Just seemed like there were a lot of people, here and elsewhere, saying, "I can really use this!" And then issues like battery life, reusability, and value over time come into play.


(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.