A Home Automation system in Node.js. Supports Philips Hue lights and Amazon Dash Buttons. Works in conjunction with Google Home and Tasker.
This program uses dash_button, a npm package by James Ide, to interact with the Amazon Dash Button.
It also uses Babel for ES2017, and request
for API calls. Use npm install
to install all packages:
npm install
If Babel is used, set the preset transformation as ES2017:
echo '{ "presets": ["es2017"] }' > .babelrc
The dash-button package includes a script that can easily retrieve the MAC Address of Amazon Dash Buttons sending DHCP requests or ARP probes.
To run it, add a scan script to the scripts
section of package.json:
"scripts": {
"scan": "dash-button scan"
}
And run it with sudo:
sudo npm run scan
If the server and Dash button is connected to a specific network interface that might require additional configurations, specificy the interface explicitly in the command line:
sudo npm run scan -- --interface en1
With Babel:
./node_modules/.bin/babel-node index.js
You can also configure npm start
to execute index.js
with Babel. This is already added in package.json:
"scripts": {
"start": "./node_modules/.bin/babel-node index.js"
}
If you see Error: pcap_findalldevs didn't find any devs
, add sudo
before ./node_modules/.bin/babel-node
and run again.
- dash-button by James Ide
- Babel ES2017 example Node server
- Recent changes to Amazon Dash Button's networking behaviors