Send a MQTT message when someone presses your configured dash buttons.
- libpcap
sudo apt install libpcap
- NodeJS (>= 8.0.0)
git clone https://github.com/vergissberlin/amazon-dash-mqtt.git
cd amazon-dash-mqtt
npm install
- Copy the dist file
cp config.dist.json config.json
- Add your MQTT credentials in the config.json.
- Add the buttons, the message and the feed where to publish the MQTT message in the config.json.
- If you're using a broker without need for a token just leave it empty
{
"settings": {
"broker": "mqtt://<YOUR_BROKER>",
"username": "<YOUR_USERNAME>",
"token": "<YOUR_TOKEN>"
},
"devices": [
{
"mac": "<MAC_ADRESS>",
"feed": "<FEED>",
"message": "<MESSAGE>"
}
]
}
NOTE: If you're using Adafruit IO, then use
"mqtt://io.adafruit.com" as "broker", and in "feed" use "<USERNAME>/feeds/<FEED>".
sudo nano app.js