Jump to content
C4 Forums | Control4

Amazon Dash Buttons?


jr219

Recommended Posts

Has anyone played with the Amazon Dash buttons and integrated them into C4? I picked up a few of them to play with when they offered them for sale to developers. They are fairly amazing devices and I think could easily integrate with IFTTT or other services. 

-jr

Link to comment
Share on other sites


Sorry, I really wasn't clear.. I was referring to the IoT button, which is customizable and programmable via the AMZ infrastructure.  I realize that the actual Dash buttons tied to products aren't able to be integrated. 

https://aws.amazon.com/iotbutton/

This button, when pressed can run a Lambda process to do basically anything...

-jr

Link to comment
Share on other sites

still not easy to integrate with control4...there is no externally exposed web service to call.  The closest thing you can do is to have it call the IFTTT maker channel and use the IFTTT driver to trigger on control4. no direct integration

Link to comment
Share on other sites

I'm preparing a driver and just such a "productized" server appliance now.  Nearly done with it.  The driver will receive inputs from any number of named dash buttons, and you can program whatever action you want for them.  The server is based off of my homebridge appliance.  I already have all the components of the system working, and I'm just finishing up the web configuration portal (to make setup/management super easy).  After some thought, the driver itself will be free.  If you already have my homebridge appliance, the update that includes dash buttons will be free.  You can either buy my homebridge appliance (which also lets you use it for HomeKit) for $225, or a stripped down Dash Button only version for $100.  I also allow you to license the entire OS image of either for $50.

Link to comment
Share on other sites

  • 2 months later...

I know that you can "hack" the regular buttons by running a network sniffer to catch the request and by not completing the setup it won't actually order anything.  It would be up to you to then trigger something in C4.  I don't think it would work natively, but if there is enough interest a product could be created (edit - I just saw the post above detailing a product in the works already).

Here's some good links on how others have made this work:

https://blog.cloudstitch.com/how-i-hacked-amazon-s-5-wifi-button-to-track-baby-data-794214b0bdd8

https://blog.cloudstitch.com/i-turned-my-baby-dash-button-hack-into-a-pager-for-toddlers-2cde1e59769a

https://www.networkworld.com/article/2991411/internet-of-things/hacking-amazons-dash-button.html

I personally would add a step on my home firewall to block the dash buttons from talking to the internet so you *really* can't accidentally order anything online.  Good luck!

Edited by RussDraper
Saw the post by Joshua about creating a product
Link to comment
Share on other sites

I have done some other similar things to send info to/from Control4 from other systems.  I would think that one of the best ways to do this would be to use the RyanE's WebEvents driver.  That way assuming you could cause a Dash button press to trigger a hit on a specific URL on your C4 controller then should be set to go.

Link to comment
Share on other sites

52 minutes ago, zaphod said:

I have done some other similar things to send info to/from Control4 from other systems.  I would think that one of the best ways to do this would be to use the RyanE's WebEvents driver.  That way assuming you could cause a Dash button press to trigger a hit on a specific URL on your C4 controller then should be set to go.

you can't do that. Dash buttons don't work like that. you have sniff traffic

Link to comment
Share on other sites

But couldn't you have a sniffer that when it sniffs the traffic does a URL post?

It looks like that is what happens with this python code for IFTTT from here https://familab.org/2016/02/hacking-the-amazon-dash-button-to-make-a-simple-cheap-iot-place-anywhere-networked-button-3/ - the code is pasted below.

So take this code and change the requests.post line to something like:

requests.post("http://192.168.1.99:8080/dashbutton1") assuming that your controller is at 192.168.1.99

And then add some C4 code to handle the dashbutton1 command.  You could also remove all of the lines from the code that deal with the Hue as that isn't needed.

And Amazon sells "hackable" IoT Dash buttons - but I think they try to tie you into using AWS for this.  You could probably find more code on AWS.

 

from phue import Bridge # for hue
import logging # for the following line
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # suppress IPV6 warning on startup
from scapy.all import * # for sniffing for the ARP packets
import requests # for posting to the IFTTT Maker Channel
 
# setting up and connecting to Hue bridge
b = Bridge('192.168.1.243')
b.get_api()
 
# it takes a minute for the scapy sniffing to initialize, so I print this to know when it's actually ready to go
print('Init done.')
 
def arp_display(pkt):
  if pkt[ARP].op == 1: #who-has (request)
    if pkt[ARP].psrc == '0.0.0.0': # ARP Probes will match this
        if pkt[ARP].hwsrc == '74:75:48:a5:33:be': # this is the first button MAC address
            # [Black Button 1]
            print("Pushed Black Button 1")
 
            # trigger IFTTT Maker Channel Event "dashButton1"
            requests.post("https://maker.ifttt.com/trigger/dashButton1/with/key/VnQ2CMKQEU")
            b.set_light([1,2,3,4,5,6,7,8,9,10],'on', False) # hue lights off
 
        elif pkt[ARP].hwsrc == '10:ae:60:64:04:95': 
            print("Pushed Black Button 2")
        else:
            print("ARP Probe from unknown device: " + pkt[ARP].hwsrc)
 
print(sniff(prn=arp_display, filter="arp", store=0))

 

Link to comment
Share on other sites

But couldn't you have a sniffer that when it sniffs the traffic does a URL post?
It looks like that is what happens with this python code for IFTTT from here https://familab.org/2016/02/hacking-the-amazon-dash-button-to-make-a-simple-cheap-iot-place-anywhere-networked-button-3/ - the code is pasted below.
So take this code and change the requests.post line to something like:
requests.post("http://192.168.1.99:8080/dashbutton1") assuming that your controller is at 192.168.1.99
And then add some C4 code to handle the dashbutton1 command.  You could also remove all of the lines from the code that deal with the Hue as that isn't needed.
And Amazon sells "hackable" IoT Dash buttons - but I think they try to tie you into using AWS for this.  You could probably find more code on AWS.
 
from phue import Bridge # for hueimport logging # for the following linelogging.getLogger("scapy.runtime").setLevel(logging.ERROR) # suppress IPV6 warning on startupfrom scapy.all import * # for sniffing for the ARP packetsimport requests # for posting to the IFTTT Maker Channel# setting up and connecting to Hue bridgeb = Bridge('192.168.1.243')b.get_api()# it takes a minute for the scapy sniffing to initialize, so I print this to know when it's actually ready to goprint('Init done.')def arp_display(pkt): if pkt[ARP].op == 1: #who-has (request)   if pkt[ARP].psrc == '0.0.0.0': # ARP Probes will match this       if pkt[ARP].hwsrc == '74:75:48:a5:33:be': # this is the first button MAC address           # [black Button 1]           print("Pushed Black Button 1")           # trigger IFTTT Maker Channel Event "dashButton1"           requests.post("https://maker.ifttt.com/trigger/dashButton1/with/key/VnQ2CMKQEU")           b.set_light([1,2,3,4,5,6,7,8,9,10],'on', False) # hue lights off       elif pkt[ARP].hwsrc == '10:ae:60:64:04:95':            print("Pushed Black Button 2")       else:           print("ARP Probe from unknown device: " + pkt[ARP].hwsrc)print(sniff(prn=arp_display, filter="arp", store=0))

 

Yes. Totally. You just have run the sniffer on another box. You can't get deep enough in C4 with a driver to run a sniffer on a controller. I asked.

Sent from my Nexus 6P using Tapatalk

Link to comment
Share on other sites

Joshua has already done most of this I believe with his appliance. And driver. On RPi

Post nine on this thread.

Amazon Dash Buttons?

https://r.tapatalk.com/shareLink?share_fid=76380&share_tid=24249&share_pid=199666&url=http://www.c4forums.com/index.php?/topic/24249-Amazon-Dash-Buttons%3F/page__view__findpost__p__199666&share_type=t




Happy Automating!!

Link to comment
Share on other sites

  • 7 months later...

I was able to achieve this with a raspberry pi. By networking scanning the devices mac. The dash buttons stay offline until the button is pressed. Once they connect they appear on the network send their command then go offline.

So I Treat the connect as a press. So when the raspberry pi notices the element come online from its mac id it then sends a restful push to a controller. However I built this for a crestron project so it would take a bit of time to make a control4 driver.

Link to comment
Share on other sites

9 minutes ago, Engineerisaac said:

I was able to achieve this with a raspberry pi. By networking scanning the devices mac. The dash buttons stay offline until the button is pressed. Once they connect they appear on the network send their command then go offline.

So I Treat the connect as a press. So when the raspberry pi notices the element come online from its mac id it then sends a restful push to a controller. However I built this for a crestron project so it would take a bit of time to make a control4 driver.

That’s exaxtly what mine does. I have the control4 driver already done. I have the code to monitor the buttons done. What’s left is to make it more than a DIY project. Everything I sell is “commercial grade” and I have software that makes discovery of new buttons super-simple and doesn’t require anything that my parents can’t do by following simple instructions and using a web browser. 

Sure, if you’re reasonably DIY oriented, setting up your own is pretty easy, but I try to take it that last step. 

Link to comment
Share on other sites

I've learned to do that with control4 too. I'm a big fan of pushing it to its limits. I get conflicted sometimes as i know that Linux shell can do so much more. But I don't dare do it to customers as it voids all warranties. And utah generally frowns upon us programmers tinkering in busybox.

 

Link to comment
Share on other sites

2 minutes ago, Engineerisaac said:

I've learned to do that with control4 too. I'm a big fan of pushing it to its limits. I get conflicted sometimes as i know that Linux shell can do so much more. But I don't dare do it to customers as it voids all warranties. And utah generally frowns upon us programmers tinkering in busybox.

 

Yep. I’ll tinker in busybox for my own purposes, but I’d never make a product out of it. Lol. 

Link to comment
Share on other sites

1 minute ago, Pounce said:

How do you handle multiple button push with your setup? Like if I pushed a button 4 times quickly. Can I get 4 events? Or do essentially debounce that to 1 event?

Since my setup detects the button coming online and attaching to the network, if you press it 4 times in quick succession it’ll only register as one push, because the network won’t have been turned off yet between presses. 

Link to comment
Share on other sites

  • 1 year later...
On 6/27/2017 at 7:36 AM, Joshua Pressnell said:

I'm preparing a driver and just such a "productized" server appliance now.  Nearly done with it.  The driver will receive inputs from any number of named dash buttons, and you can program whatever action you want for them.  The server is based off of my homebridge appliance.  I already have all the components of the system working, and I'm just finishing up the web configuration portal (to make setup/management super easy).  After some thought, the driver itself will be free.  If you already have my homebridge appliance, the update that includes dash buttons will be free.  You can either buy my homebridge appliance (which also lets you use it for HomeKit) for $225, or a stripped down Dash Button only version for $100.  I also allow you to license the entire OS image of either for $50.

I’ve been dying to get my hands on this ....anyway to sell me your version?

Link to comment
Share on other sites

Try this for adding a keyfob of buttons. Get a sonoff rf bridge. Flash it with tasmota or OpenMQTTGateway . Run an MQTT broker and use the MQTT driver. Get the sonoff 4 button rf keyfob. Bridge is like 15 bucks. Keyfobs are about 5 bucks. Using MQTT makes a lot of things very easy and flexible.

Dash buttons were killed earlier this year.

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.