Making Amazon Dash buttons do different things using dnsmasq
- go get github.com/mannkind/dashbtn
- go intall github.com/mannkind/dashbtn
- dashbtn -c /the/path/to/config.yaml
Configuration happens in the config.yaml file. A full example might look this:
'74:75:48:C3:B1:D0':
'add+old': [ '/usr/local/bin/mosquitto_pub', '-h', 'mosquitto', '-t', 'home/dash_btn', '-m', 'ON' ]
'del': [ '/usr/local/bin/mosquitto_pub', '-h', 'mosquitto', '-t', 'home/dash_btn', '-m', 'ON' ]
'74:75:48:C3:B1:D1+74:75:48:C3:B1:D2':
'add+old': [ 'say', 'Someone is at the door. Please go see who it is' ]
#!/bin/sh
mode="$1" # "add", "del", or "old"
mac="$2"
ip="$3"
host="$4"
wget -O - "http://HOST_RUNNING_DASHBTN:PORT/dash?mode=$mode&mac=$mac&ip=$ip&host=$host" >/dev/null 2>&1 &
Unmaintained. I didn't buy any more Dash buttons after my last one died. I also don't have a Tomato/OpenWRT router anymore (switched to UniFi). The repository will remain available for reference, but the code is unmaintained.