Coder Social home page Coder Social logo

docker-node-dash-button's Introduction

Github, DockerHub

Please use hisashin/rpi-node-dash-button if it's Raspberry Pi.

Based on node-dash-button. Great work! The MIT License (MIT) Copyright (c) 2016 Alex Hortin

  • First time Dash Setup
  • Run This Image
  • Get MAC address of your Dash
  • Customize script
  • Restart

First time Dash Setup

As described here

"Follow Amazon's instructions to configure your button to send messages when you push them but not actually order anything. When you get a Dash button, Amazon gives you a list of setup instructions to get going. Just follow this list of instructions, but don’t complete the final step. Do not select a product, just exit the app."

Run This Image

docker run -it --net host --name node-dash-button hisashin/node-dash-button

Get MAC address of your Dash

# /node_modules/node-dash-button/bin/findbutton
Watching for arp & udp requests on your local network, please try to press your dash now
Dash buttons should appear as manufactured by 'Amazon Technologies Inc.' 

Then press Dash. Messages will be added like this.

Possible dash hardware address detected: 11:22:33:44:55:66 Manufacturer: unknown Protocol: udp
Possible dash hardware address detected: 11:22:33:44:55:66 Manufacturer: unknown Protocol: arp

In this case, 11:22:33:44:55:66 is MAC address of your Dash.

Customize script

vi /dash.js

dash_button('aa:bb:cc:dd:ee:ff', null, null, 'all').on('detected', function() {
//  https_get('www.google.com', '/foo/bar');	// for example to GET https://www.google.com/foo/bar
//  http_get('www.google.com', '/foo/bar');	// for example to GET http://www.google.com/foo/bar
});

Edit around this section as you want with the MAC address you got.

dash_button('11:22:33:44:55:66', null, null, 'all').on('detected', function() {
  https_get('maker.ifttt.com', '/trigger/{your IFTTT event}/with/key/{your IFTTT secret key}');
});

If you want to call IFTTT webhook, it will be like this.

Restart

forever stop /dash.js
/start.sh

Ctrl+P, Ctrl+Q to escape. To autostart, add following line to /etc/rc.local

docker start node-dash-button

docker-node-dash-button's People

Contributors

hisashin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dyna-dot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.