Amazon Dash Button Binding

The Amazon Dash Button is a cheap and small Wi-Fi connected device to order products from Amazon with the simple press of a button.
This Binding allows to integrate Dash Buttons into your home automation setup.

Warning:
The Dash Button will try to contact the Amazon servers every time the button is pressed.
This might not be in line with your privacy preferences but can be prevented.
Please refer to the “Preventing Communication with Amazon Servers” section for details.

Response Time:
Please be aware, that due to the operation method of this binding, the response time for a button press can be rather high (up to five seconds). You might want to keep that in mind during product selection or task assignment.

Prerequisites

The Binding uses Pcap4J in order to capture ARP and BOOTP requests send by the Amazon Dash Button.
Buttons will hence only be usable within the same network as your openHAB instance.

Start with installing libpcap (for Mac/Linux/UNIX) or WinPcap (for Windows) on your computer.
They are native libraries that power the core functionalities of Pcap4J.

Installing WinPcap on Windows

The preferred solution is WinPcap if your network interface is supported.

An alternative option is npcap with the settings “WinPcap 4.1.3 compatibility” and “Raw 802.11 Packet Capture”

Installing libpcap on Other Operating Systems

The installation methods might differ.
A few known operating systems are:

Operating System

Command

CentOS

yum install libpcap-devel

Mac

brew install libpcap

Setup Dash Button

Setting up your Dash Button is as simple as following the instructions provided by AmazonEXCEPT FOR THE LAST STEP.
Follow the instructions to set up the Dash Button in their mobile app.
When you get to the step where it asks you to pick which product you want to map it to, just quit the setup process.

Preventing Communication with Amazon Servers

Every time a Dash Button is pressed a request will be sent to the Amazon servers.
If no product was configured for the Button, a notification will be presented by the Amazon app on your smartphone.

To prevent the Dash Button from contacting the Amazon Servers, block Internet access for the device.
Please refer to the documentation of your network’s router for details.
If your network doesn’t provide that option, you can at least deal with the notifications by either uninstalling the Amazon app or disabling notifications for it (possible on most smartphone OSs).

It has shown that blocking the Dash Button communication with the Amazon servers will provoke reconnection attempts.
This increased amount of communication causes a reduced overall battery life.
The built-in AAA battery can be easily replaced.

Preventing the communication with the Amazon servers or the Amazon app is not necessary to integrate the Dash Button in openHAB.

Supported Things

There is one supported Thing, the “Amazon Dash Button”.

Discovery

Background discovery is not supported as it is not possible to distinguish between a Dash Button and other Amazon devices like the Kindle, a Fire TV or an Echo speaker.

You can start the discovery process for Dash Button devices manually.
While openHAB is in the scanning process, press the button on the Dash to be recognized and added to your Inbox.

Caution:
You have to be aware that other Amazon devices might pop up in your Inbox if they send an ARP request while scanning for Dash Buttons.
You can ignore these devices in your Inbox.

Thing Configuration

Amazon Dash Button

macAddress - The MAC address of the Amazon Dash Button.

pcapNetworkInterfaceName - The network interface which receives the packets of the Amazon Dash Button.

packetInterval - Often a single button press is recognized multiple times. You can specify how long any further detected button pressed should be ignored after one click was processed. The parameter is optional and 5000ms by default.

For manual defintion of a dashbutton Thing the MAC address can either be taken from the discovery output or can e.g. be captured through your router/DHCP frontend or with Wireshark.

Channels

Press: Trigger channel for recognizing presses on the Amazon Dash Button. A trigger channel can directly be used in a rule, check the “Full Example” section for one example.