{"id":20488166,"url":"https://github.com/mwittig/pimatic-amazing-dash-button","last_synced_at":"2025-04-13T16:05:07.312Z","repository":{"id":57324187,"uuid":"67295867","full_name":"mwittig/pimatic-amazing-dash-button","owner":"mwittig","description":"Pimatic plugin for Amazon's dash-buttons","archived":false,"fork":false,"pushed_at":"2019-05-31T14:09:19.000Z","size":70,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T16:04:59.883Z","etag":null,"topics":["amazon-dash","amazon-dash-button","dash-button","dash-buttons","dashbutton","home-automation","pimatic","pimatic-plugin"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwittig.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-03T15:00:57.000Z","updated_at":"2021-12-03T10:33:31.000Z","dependencies_parsed_at":"2022-09-21T01:01:19.901Z","dependency_job_id":null,"html_url":"https://github.com/mwittig/pimatic-amazing-dash-button","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-amazing-dash-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-amazing-dash-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-amazing-dash-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fpimatic-amazing-dash-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwittig","download_url":"https://codeload.github.com/mwittig/pimatic-amazing-dash-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741200,"owners_count":21154253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-dash","amazon-dash-button","dash-button","dash-buttons","dashbutton","home-automation","pimatic","pimatic-plugin"],"created_at":"2024-11-15T16:55:40.390Z","updated_at":"2025-04-13T16:05:07.283Z","avatar_url":"https://github.com/mwittig.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Amazing Dash-Button](https://github.com/mwittig/pimatic-amazing-dash-button/raw/master/assets/images/dash-buttons.jpg)\n# pimatic-amazing-dash-button\n\n[![Npm Version](https://badge.fury.io/js/pimatic-amazing-dash-button.svg)](http://badge.fury.io/js/pimatic-amazing-dash-button)\n[![Build Status](https://travis-ci.org/mwittig/pimatic-amazing-dash-button.svg?branch=master)](https://travis-ci.org/mwittig/pimatic-amazing-dash-button)\n[![Dependency Status](https://david-dm.org/mwittig/pimatic-amazing-dash-button.svg)](https://david-dm.org/mwittig/pimatic-amazing-dash-button)\n\n\nA pimatic plugin for Amazon's dash-buttons. It is a pretty light-weight implementation which uses a `ContactSensor` or `ButtonsDevice` \ndevice abstraction for the dash-button. Auto-discovery of dash-buttons is supported.\n\nThe plugin sniffs for ARP probes which will be sent out by a dash-button when the \nbutton is pressed. The plugin is based on [cap](https://www.npmjs.com/package/cap), a\ncross-platform `libpcap` binding for performing packet capturing with node.js. It can be used \non *nix and Windows systems. \n\n### Contributions\n\nIf you like this plugin, please consider \u0026#x2605; starring \n[the project on github](https://github.com/mwittig/pimatic-amazing-dash-button). Contributions to the project are  welcome. You can simply fork the project and create a pull request with \nyour contribution to start with. \n\n### Stickers and Donations\n\nHappy with pimatic and using it everyday? If you like to obtain one of these amazing dash-button stickers, please \n[consider a donation](https://pimatic.org/pages/donate/) to support the pimatic development and \nthe operation of the website and user forum.\n\n## Installation\n\n**This plugin requires libpcap to capture ARP requests on the network. Moreover, it is required to have python v2.7 installed**. \n\nOn Raspberry PI and comparable systems \n`libpcap` must be installed, i.e. `sudo apt-get install libpcap-dev`. \nOn Windows, [WinPcap](http://www.winpcap.org/install/default.htm) must be installed. As the installation procedure uses `node-gyp` you will also need to have `python v2.7` installed. Note, `python v3` is not supported! See [`node-gyp` installation notes for details](https://github.com/nodejs/node-gyp#installation).\n\n### Dash-Button Installation\n\nFollow the instructions given in the Amazon Mobile App, to pair the dash-button with your WiFi network. However, **don't \nselect a product as requested in the last configuration step**. Now, when the dash-button is pressed, the indicator \nLED of the dash-button should blink white for about three seconds. Following this, the LED will turn to solid red for \na few seconds and might blink red (depending on the type of dash-button you have, apparently there are different \nmakes). This indicates the device is not setup as there is no product setup, but this does not matter. \n\nAs an additional line of defense you may consider restricting internet access for the device as part \nof your router configuration.  \n\n\n## Plugin Configuration\n\nThe \"interfaceAddress\" property may be omitted if your system only has a single network interface or the interface to \nchoose is the first one on the list returned by the `ifconfig` command on the host. If the device \ndiscovery or the interaction with dash-button does not work as expected, provide the IP address associated with the \nnetwork interface which shall be used to listen to ARP requests needs to be set.\n\n    {\n          \"plugin\": \"amazing-dash-button\",\n          \"interfaceAddress\": \"192.168.1.15\",\n    }\n\nThe plugin has the following configuration properties:\n\n| Property          | Default  | Type    | Description                                 |\n|:------------------|:---------|:--------|:--------------------------------------------|\n| interfaceAddress  | -        | String  | IP address associated with the network interface which shall be used to listen to ARP requests (optional) |\n| ignoreMacAddresses| -        | Array   | MAC addresses of candidate devices which shall be ignored. Typically, this is used to exclude other Amazon devices like Fire Tablet PCs. |\n\n\n## Device Configuration\n\nAs of pimatic v0.9, dash-button devices can be automatically discovered. Simply open the \"Devices\" view of \nthe pimatic web frontend and click on \"Discover Devices\". When the discovery has started, press the dash-button and \nthe device should show up as a discovered device in pimatic after a few seconds.\n\nYou can also add the device manually by adding it to the \"devices\" section of the configuration or by creating the \ndevice using the device editor.\n\n    {\n          \"id\": \"AmazingDashButton1\",\n          \"name\": \"AmazingDashButton1\",\n          \"class\": \"AmazingDashButton\",\n          \"macAddress\": \"ac:63:be:b3:be:78\"\n    }\n\nThe device has the following configuration properties:\n\n| Property          | Default  | Type    | Description                                 |\n|:------------------|:---------|:--------|:--------------------------------------------|\n| macAddress        | -        | String  | MAC address of the device                   |\n| invert            | false    | String  | If true, invert the contact state, i.e., contact is 'closed' if dash-button not pressed |\n| holdTime          | 1500     | Integer | The number of milliseconds the contact shall enter the state indicating button pressed (closed if not inverted) |\n\nYou can also use your dash-button device as `DashButtonDevice`. This device type will act like a ButtonsDevice with one button. \nThe configuration is \n\n     {\n           \"id\": \"DashButtonDevice1\",\n           \"name\": \"DashButtonDevice1\",\n           \"class\": \"DashButtonDevice\",\n           \"macAddress\": \"ac:63:be:b3:be:78\"\n     }\n\nThe `DashButtonDevice` only supports the `macAddress` property. \n\nWhen using the automatic discovery mode, just change the class to `DashButtonDevice` and copy the `macAddress` property.\n\n\n## Trigger Another Device\n\nThe `AmazingDashButton` is derived from `ContactSensor` and provides the following \npredicate: `{device} is opened|closed`. For example, if you wish to toggle a `PowerSwitch` device when the dash-button \nis pressed you can create a rule as follows: \n\n    when AmazingDashButton1 is closed then toggle {PowerSwitch Device}\n    \nFor the `DashButtonDevice` the predicate is `{device} is pressed`, so this would lead to this rule:\n\n    when DashButtonDevice1 is pressed then toggle {PowerSwitch Device}\n\n\n## Trigger Action\n\nIt is also possible to trigger an `AmazingDashButton` device using the pimatic REST or WebSocket API as shown \nin the example below for a given device with id `dash-1`. Calling the device action will \nclose the contact for the `holdTime` configured set as part of device configuration.\n\n```bash\ncurl --user \"username:password\" /api/device/dash-1/trigger\n```\n\nFor a `DashButtonDevice` this would be: \n\n```bash\ncurl --user \"username:password\" /api/device/dash-1/buttonPressed?buttonId=dash-1\n```\n\n## Trouble Shooting\n \n* \"TypeError: Buffer.alloc is not a function\" during installation\n\n  Make sure, you have node version 4.5 or greater installed. \n\n## History\n\nSee [Release History](https://github.com/mwittig/pimatic-amazing-dash-button/blob/master/HISTORY.md).\n\n## License \n\nCopyright (c) 2016-2019, Marcus Wittig and contributors. All rights reserved.\n\n[AGPL-3.0](https://github.com/mwittig/pimatic-amazing-dash-button/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fpimatic-amazing-dash-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwittig%2Fpimatic-amazing-dash-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fpimatic-amazing-dash-button/lists"}