dasher-hue is a simple way to bridge your Amazon Dash buttons to Philips Hue lights. This small project is just a combination of two existing projects:
See it in action:
Configure dasher-hue via config/config.json
.
You have to setup your Philips Hue (IP and username) and all the Amazon Dash Buttons you have.
You define your buttons via the config/config.json
file.
You attach each button to a specific group or a specific light, what you prefer.
Here's an example.
{
"philips_hue": {
"ipaddress": "192.168.0.10",
"username": "your-philips-hue-username-key"
},
"buttons":[
{
"name": "Amazon Dash Fiesta Living Room",
"address": "50:50:50:50:50:51",
"group": "1"
},
{
"name": "Amazon Dash Rodial Bedroom",
"address": "50:50:50:50:50:52",
"group": "2"
},
{
"name": "Amazon Dash ON Corridor",
"address": "50:50:50:50:50:53",
"light": "6"
}
]}
Buttons take 4 options.
name
- Give the button action a name, just for informative purposes.address
- The MAC address of the button.group
- The number or the group you want to toggle. When using this, you don't use light
.light
- The number or the light you want to toggle. When using this, you don't use group
.In order to get your Amazon Dash Button mac address, get instructions and scripts from here
Check Setup section here
Set up dasher-hue.
git clone https://github.com/Ricardo1980/dasher-hue
cd dasher-hue
npm install
Then create a config.json
in /config
to set up your Dash buttons. Or use the the sample file, renaming it and modifying according to your needs.
Listening for Amazon Dash Buttons requires root. So you need to start dasher-hue with sudo.
sudo npm run start
For creating and setting up a service, check this.
An example could be:
[Unit]
Description=dasher-hue
[Service]
ExecStart=/usr/local/bin/node /home/pi/dasher-hue/app.js
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=dasher-hue
Environment=NODE_ENV=production PORT=1337
[Install]
WantedBy=multi-user.target
In /etc/systemd/system/dasher-hue.service And then use
sudo systemctl enable dasher-hue.service
sudo systemctl start dasher-hue.service
Locate Philips Hue Bridge automatically, rather than using an IP. Check: nupnpSearch(), locateBridges(), upnpSearch or searchForBridges()