[OBSOLETE] Amazon Dash Button

You could go down this path but I’m not sure if this library will work on Windows… it may need to be changed to use https://github.com/mscdex/cap. Give it a shot and let me know.

OK. So, do you mean to run the same command as your last post, but with the url changed?

Like this?..

npm install git+https://github.com/mscdex/cap

Sort of… either go down the python path (install python, etc with hopes that works), or change the plugin to use the mscdex/cap plugin instead of the other (at which point you would do an npm install for this library).

OK…so…if you’re willing to do any more β€˜hand-holding’…

How do I do this part?..

Is it possible to use with SmartThings/WebCore and have it blocked from going to Amazon? I tried to block it and it doesn’t trigger anything in SmartThings.

No - the issue is that the Dash Button will make a direct call to Amazon… the only way to block this effectively is at the router/gateway… has nothing to do with ST

Sure… how’s your JavaScript?? Send me a pm and we can work on it…

1 Like

I probably should have asked that better. I mean when blocking it from contacting Amazon, I’m finding that it doesn’t trigger SmartThings either.

I created a rule on my router as mentioned previously and I noticed that it doesn’t trigger the switch that I have tied to it.

Is your router rule only blocking the Dash Button from getting to the internet, or from accessing the LAN altogether?

One way to know…
Assuming you already know the Dash Button’s IP address,
press the Dash Button, and ping it from another computer on the network while its white light is flashing.

If you get a response from the Dash Button, then it’s NOT being blocked altogether; at least this gives you some info to go on in troubleshooting.

1 Like

Thanks for the suggestion. It was pinging but I just re-routed the buttons to my PiHole and blocked the Amazon dash address on it. Works like a champ now!

1 Like

INSTALL OS
Download Raspberry JESSIE
Link: https://dl.dropbox.com/s/jl12v5peqvhorbt/2016-05-27-raspbian-jessie.img.zip
UNZIP AND PLACE 2016-05-27-raspbian-jessie.img ON YOUR DESKTOP
diskutil list
diskutil unmountDisk /dev/disk2
sudo newfs_msdos -F 16 /dev/disk2
sudo dd if=~/Desktop/2016-05-27-raspbian-jessie.img of=/dev/rdisk2 bs=5m
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
Open Terminal
ssh pi@raspberrypi.local
Password : raspberry
Change password:
Type on terminal:
passwd
New password
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
β€’ ( ssh password: raspberry )
((((((((((((( On MacOsX Terminal ))))))))))))))
((((((((((((( Setting up Wifi with the Command Line ))))))))))))))
β€’ CONNECT YOUR RASPBERRY PI TO YOUR ROUTER USING β€œINTERNET CABLE”
β€’ OPEN TERMINIAL ON YOUR MacOsX
ssh pi@raspberrypi.local
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
β€’ copy and past at the end of file and edit with your information

network={
ssid="yourNetworkSSID"
psk=β€œyourNetworkPassword”
}
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
sudo reboot
β€”β€”β€”β€”β€”β€”β€”β€”β€”
((((((((((((( iP-Static ))))))))))))))
https://www.modmypi.com/blog/how-to-give-your-raspberry-pi-a-static-ip-address-update
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
ssh pi@raspberrypi.local
sudo nano /etc/dhcpcd.conf
Copy and past

A sample configuration for dhcpcd.

See dhcpcd.conf(5) for details.

Allow users of this group to interact with dhcpcd via the control socket.

#controlgroup wheel

Inform the DHCP server of our hostname for DDNS.

hostname

Use the hardware address of the interface for the Client ID.

clientid

or

Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.

#duid

Persist interface configuration when dhcpcd exits.

persistent

Rapid commit support.

Safe to enable by default because it requires the equivalent option set

on the server to actually work.

option rapid_commit

A list of options to request from the DHCP server.

option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes

Most distributions have NTP support.

option ntp_servers

Respect the network MTU.

Some interface drivers reset when changing the MTU so disabled by default.

#option interface_mtu

A ServerID is required by RFC2131.

require dhcp_server_identifier

Generate Stable Private IPv6 Addresses instead of hardware based ones

slaac private

A hook script is provided to lookup the hostname if not set by the DHCP

server, but it should not be run by default.

nohook lookup-hostname

interface eth0

static ip_address=YOUR.PI.IP/24
static routers=YOU.ROUTER.IP
static domain_name_servers=ROUTER.DNS.1 ROUTER.DNS.2

interface wlan0

static ip_address=YOUR.PI.IP/24
static routers=YOU.ROUTER.IP
static domain_name_servers=ROUTER.DNS.1 ROUTER.DNS.2

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
sudo reboot

ssh pi@raspberrypi.local
wget --no-check-certificate -P /home/pi/Downloads https://github.com/redloro/smartthings/archive/master.zip
sudo apt-get remove nodered -y
sudo apt-get remove nodejs nodes-legacy -y
sudo apt-get remove npm -y
wget --no-check-certificate -P /home/pi/Downloads https://nodejs.org/dist/v9.3.0/node-v9.3.0-linux-armv6l.tar.xz
cd Downloads/
tar -xvf node-v9.3.0-linux-armv6l.tar.xz
cd node-v9.3.0-linux-armv6l
sudo cp -R * /usr/local/
sudo reboot
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
ssh pi@raspberrypi.local
node -v
cd Downloads/
unzip master.zip
cd smartthings-master
sudo mv smartthings-nodeproxy /home/
cd /home
cd smartthings-nodeproxy
mkdir plugins
mv avail_plugins/dash.js plugins/
nano config.json
Copy and past

{
β€œport”: 8080,
β€œauthCode”: β€œsecret-key”,
β€œdash”: {
β€œbuttons”: [
β€œ78:e1:03:67:13:92”,
β€œb4:7c:9c:88:4a:c1”,
β€œ78:e1:03:d8:f9:ac”,
β€œb4:7c:9c:b1:a4:11”
]
},
β€œnotify”: {
β€œaddress”: β€œ10.0.0.130”,
β€œport”: β€œ39500”
}
}

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
ssh pi@raspberrypi.local
cd /home
cd smartthings-nodeproxy
npm install
sudo apt-get install libpcap-dev
npm run install:dash
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
sudo nano /home/pi/.bashrc
Go to the last line of the script and add:
echo Running at boot
cd /home
cd smartthings-nodeproxy
sudo node server.js
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
Add buttons
cd /home
cd smartthings-nodeproxy
nano config.json
Note add X in front dash : dashX to enter in discovery mode after finish remove the X
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
cd /home
cd smartthings-nodeproxy
sudo pkill node
sudo node server.js
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

I’ve successfully setup a Dash button (with multiple complications getting all the dependencies installed for the node proxy), but it finally works!

I’ve run into an issue. I have this successfully turning on and off GE switches, but if I tell the SmartAppp - Dash Button to control my cabinet lights (Osram - Lightify), it only turns them on. Thoughts on how to modify this so that it will turn on and off the cabinet lights?

Thanks

If you can get it to turn β€˜real’ switches on AND off, then you could…

  1. create virtual (simulated) switches to represent the Osram lights

  2. create rules in webCoRE that monitor those virtual switches, and turn the Osram lights on and off when they get turned on and off

1 Like

Any update on this? I am in the same boat.

**that boat being attempting to install the liabpcap-dev on windows.

I had to run this command prior to attempting to install liabpcap-dev but I was on a Pi.

sudo apt-get install build-essential

I’m trying to run this on a Windows 10 x64 machine and can’t get past installing pcap. I’ve installed the windows equivalents but can’t figure out how to get your setup to look for/past anything except pcap. Is there hope for me? I am trying to avoid creating a Linux VM just for this little old task.

Did you get your Win10 issue resolved? Would you share?

Oh I have similar issue as I was investigating why my dash buttons no longer works after my Pi rebuild and found that seems the MQTT bridge seems intercepting the message by the STNP(I can see the STNP can get the MAC of dash(es) but the SmartApp seems has never been triggered), sounds like there is no way around it @redloro if I would like to run the STNP and MQTT on the same Pi

I ended up moving away from this type of implementation. I use Dasher and Homeassistant. Much cleaner.

I have homeassistant as well may be I should do the same, will take a look at dasher