All Projects β†’ maddox β†’ Dasher

maddox / Dasher

Licence: mit
πŸ”˜ A simple way to bridge your Amazon Dash buttons to HTTP services

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dasher

Harmony Api
πŸ—Ό A simple server allowing you to query/control multiple local Harmony Home Hubs over HTTP or MQTT
Stars: ✭ 345 (-51.06%)
Mutual labels:  home-assistant, home-automation
Button Card
❇️ Lovelace button-card for home assistant
Stars: ✭ 680 (-3.55%)
Mutual labels:  home-assistant, home-automation
Bruh3 Home Assistant Configuration
(OBSOLETE) BRUH3 Home Assistant Configuration
Stars: ✭ 347 (-50.78%)
Mutual labels:  home-assistant, home-automation
Hassio Zigbee2mqtt
Hass.io add-on for zigbee2mqtt
Stars: ✭ 547 (-22.41%)
Mutual labels:  home-assistant, home-automation
Smarthome
@skalavala πŸ‘ Nothing But Smarthome Stuff! - By Mahasri Kalavala
Stars: ✭ 437 (-38.01%)
Mutual labels:  home-assistant, home-automation
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+422.98%)
Mutual labels:  home-assistant, home-automation
Zigbee2mqttassistant
GUI for Zigbee2Mqtt running in docker and HASS.IO
Stars: ✭ 371 (-47.38%)
Mutual labels:  home-assistant, home-automation
Kmansonoff
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant / mqtt
Stars: ✭ 282 (-60%)
Mutual labels:  home-assistant, home-automation
Miflora Mqtt Daemon
Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
Stars: ✭ 409 (-41.99%)
Mutual labels:  home-assistant, home-automation
Homeassistant
Home Assistant Configuration Files and Documentation
Stars: ✭ 395 (-43.97%)
Mutual labels:  home-assistant, home-automation
Homebridge Homeassistant
DEPRECATED in favor of native HomeKit support. - ο£Ώ Homebridge plugin for Home Assistant
Stars: ✭ 666 (-5.53%)
Mutual labels:  home-assistant, home-automation
Amazon Dash
Hack your Amazon Dash to run what you want.
Stars: ✭ 703 (-0.28%)
Mutual labels:  home-assistant, home-automation
Esphome
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Stars: ✭ 4,324 (+513.33%)
Mutual labels:  home-assistant, home-automation
Esphome Core
🚨 No longer used 🚨 - The C++ framework behind ESPHome
Stars: ✭ 545 (-22.7%)
Mutual labels:  home-assistant, home-automation
Awesome Home Assistant
A curated list of amazingly awesome Home Assistant resources.
Stars: ✭ 3,487 (+394.61%)
Mutual labels:  home-assistant, home-automation
Haaska
Home Assistant Alexa Skill Adapter that supports v3 of the Alexa Smart Home Skill API
Stars: ✭ 369 (-47.66%)
Mutual labels:  home-assistant, home-automation
Home Assistant Config
🏠 Fully documented Home Assistant configuration for a smart-looking place. 😎 Be sure to ⭐️ my repo and copy ideas!
Stars: ✭ 258 (-63.4%)
Mutual labels:  home-assistant, home-automation
Home assistant
My personal Home Assistant setup - Running on a HassOS VM.
Stars: ✭ 270 (-61.7%)
Mutual labels:  home-assistant, home-automation
Magic Cards
🎩 Queue music, play movies, or trigger events with RFID cards.
Stars: ✭ 372 (-47.23%)
Mutual labels:  home-assistant, home-automation
Home Assistant Configuration
🏑 My Home Assistant Configuration Files. Be sure to ⭐️ my repo!
Stars: ✭ 472 (-33.05%)
Mutual labels:  home-assistant, home-automation

Dasher!!

⚠️ Dasher is sunsetted ⚠️

This project is no longer under active development. I neither use it, nor do I use Amazon Dash buttons in my home automation. I found their latency and general way of working to not be a great solution as a smart button for my household.

Nekmo/amazon-dash is a great alternative. It has support for all kinds of actions and is actively developed. It's way better than mine!

What it is

Dasher is a simple way to bridge your Amazon Dash buttons to HTTP services.

Do you have a Home Automation service set up like Home Assistant, openHab, or maybe a SmartThings hub? Using Dasher, you can easily command them to do something whenever your Dash button is pressed.

This of course goes for anything you can reach via HTTP. That includes IFTTT by way of the Maker channel 🀘

How it works

It's pretty simple. Press a button and an HTTP request is made or local command is ran. That's it.

You configure your Dash button(s) via config/config.json. You add its network address and either a url, an http method, and optionally a content body and headers or a local command to execute.

When Dasher starts, it will listen for your button being pressed. Once it sees it, it will then make the HTTP request or run the command that you defined for it in your config.

Configuration

You define your buttons via the config/config.json file. It's a simple JSON file that holds an array of buttons.

Here's an example.

{"buttons":[
  {
    "name": "Notify",
    "address": "43:02:dc:b2:ab:23",
    "interface": "en0",
    "timeout": "60000",
    "protocol": "udp",
    "url": "https://maker.ifttt.com/trigger/Notify/with/key/5212ssx2k23k2k",
    "method": "POST",
    "json": true,
    "body": {"value1": "any value", "value2": "another value", "value3": "wow, even more value"}
  },
  {
    "name": "Party Time",
    "address": "d8:02:dc:98:63:49",
    "url": "http://192.168.1.55:8123/api/services/scene/turn_on",
    "method": "POST",
    "headers": {"authorization": "your_password"},
    "json": true,
    "body": {"entity_id": "scene.party_time"},
    "formData": {
      "var1":"val1",
      "var2":" val2"
    }
  },
  {
    "name": "Start Cooking Playlist",
    "address": "66:a0:dc:98:d2:63",
    "url": "http://192.168.1.55:8181/playlists/cooking/play",
    "method": "PUT"
  },
  {
    "name": "Debug Dash Button",
    "address": "41:02:dc:b2:ab:23",
    "debug": true
  },
  {
    "name": "Command Exec Button",
    "address": "41:02:dc:b2:10:12",
    "cmd": "/home/user/dash_button.sh"
  }  
]}

Buttons take up to 8 options.

  • name - Optionally give the button action a name.
  • address - The MAC address of the button.
  • interface - Optionally listen for the button on a specific network interface. (enX on OS X and ethX on Linux)
  • timeout - Optionally set the time required between button press detections (if multiple pressese are detected) in milliseconds. Default is 5000.
  • protocol - Optionally set the protocol for your Dash button. Options are udp, arp, and all. Default listens to arp. The "newer" JK29LP button from ~Q2 2016+ tends to use udp.
  • url - The URL that will be requested.
  • method - The HTTP method of the request.
  • headers - Optional headers to use in the request.
  • json - Optionally declare the content body as being JSON in the request.
  • body - Optionally provide a content-body that will be sent with the request.
  • formData - Optionally add formData that will be sent with the request.
  • debug - Used for testing button presses and will -not- perform a request.
  • cmd - Used to run a local command rather than an HTTP request. Setting this will override the url parameter.

Setting and using these values should be enough to cover almost every kind of request you need to make.

You can find more examples in the example config.

Protips

Here are few protips about Dash buttons that will help you plan how to use them.

  • Dash buttons take ~5 seconds to trigger your action.
  • Use DHCP Reservation on your Dash button to lower the latency from ~5s to ~1s.
  • Dash buttons are discrete buttons. There is no on or off. They just do a single command.
  • Dash buttons can not be used for another ~10 seconds after they've been pressed.
  • If your Dash button is using udp, specify it in the button config.
  • Listening over wifi is unreliable. I highly recommend using ethernet, especially on Raspberry Pi

Dash buttons should be used to trigger specific things. I.E. a scene in your home automation, as a way to turn everything off in your house, or as a simple counter.

Setup

You'll want to set up your Dash buttons as well as Dasher.

Dash button

Setting up your Dash button is as simple as following the instructions provided by Amazon EXCEPT FOR THE LAST STEP. Just follow the instructions to set it up in their mobile app. When you get to the step where it asks you to pick which product you want to map it to, just quit the setup process.

The button will be set up and available on your network.

Find Dash Button

Once your Dash button is set up and on your network, you need to determine its MAC address. Run this:

script/find_button

Click your Dash button and the script will listen for your device. Dash buttons should appear as manufactured by 'Amazon Technologies Inc.'. Once you have its MAC address you will be able to configure it in Dasher by modifying config/config.json after installing Dasher.

Dasher app

Simply install the dependencies and clone the repository.

note: You might need to install libpcap-dev or npm on Linux first.

sudo apt-get install libpcap-dev
sudo apt-get install npm

note Raspberry Pi users may need to update node arm which will automatically remove nodejs-legacy. Credit @legotheboss

sudo apt-get install node

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb

Clone and Set up Dasher

git clone https://github.com/maddox/dasher.git
cd dasher
npm install

Then create a config.json in /config to set up your Dash buttons. Use the example to help you. If you just want to test the button press, use the debug button example with the MAC address you found running script/find_button.

Running It

Listening for Dash buttons requires root. So you need to launch Dasher with sudo.

sudo npm run start

Auto Start on OS X

After setting it up with script/bootstrap just run script/install to load Dasher with launchd. Dasher will now start on boot.

You can uninstall it with script/uninstall and restart it with script/restart.

Raspberry Pi

Having problems running npm install?

Raspberry Pi users may need to update node arm which will automatically remove nodejs-legacy. One you are on node mainline, force the update to the latest version of node for arm. This may not be needed if you are running a first generation pi. If you are on a Pi and run into problems with npm install, try this. Credit @legotheboss

Replace nodejs-legacy with node and manually update to the latest version of node arm.

sudo apt-get install node
wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb

Quick Start Works as of (1/27/17)

Starting from a fresh Raspberry Pi Build?

sudo apt-get install libpcap-dev
sudo apt-get install npm

sudo apt-get install node
wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb

git clone https://github.com/maddox/dasher.git
cd dasher
sudo npm install

sudo ./script/find_button
# update /config/config.json with mac address of your button 
sudo npm run start

Auto Starting

Advanced information on autostarting Dasher on your Raspberry Pi can be found here.

Contributions

  • fork
  • create a feature branch
  • open a Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].