GithubHelp home page GithubHelp logo

zahedbri / amazon-dash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nekmo/amazon-dash

1.0 1.0 0.0 4.82 MB

Hack your Amazon Dash to run what you want.

License: MIT License

Dockerfile 0.71% Makefile 2.32% Python 96.97%

amazon-dash's Introduction

image

Latest Travis CI build status

Latest PyPI version

Python versions

Code Climate

Test coverage

Requirements Status

DEVELOPMENT BRANCH: The current branch is a development version. Go to the stable release by clicking on the master branch.

Python Amazon Dash

Hack your Amazon Dash to run what you want. Without welders. For the entire family.

This program written in Python runs in daemon mode waiting for someone in the same network to press a configured Amazon Dash button. It is not necessary to know programming to use this program. Amazon-Dash executes commands by command line, calls a url and more. This program works well on a Raspberry PI or on computers with few resources.

  1. Install Amazon Dash:
$ sudo pip3 install amazon-dash  # and after:
$ sudo python3 -m amazon_dash.install

Also available on AUR and FreeNAS. You can also use pip2 and python2 if your system only has Python2, but Python 3 is the recommended version. See other installation methods in the documentation.

  1. Use discovery mode to know the mac of your Dash (Run the program, and then press any button):
$ sudo amazon-dash discovery
  1. Edit config file (/etc/amazon-dash.yml):
# amazon-dash.yml
# ---------------
settings:
  delay: 10
devices:
  0C:47:C9:98:4A:12: # Command example
    name: Hero
    user: nekmo
    cmd: spotify
  AC:63:BE:75:1B:6F: # SSH example
    name: Tassimo
    cmd: door --open
    ssh: 192.168.1.23:2222
  AC:63:BE:67:B2:F1: # Url Webhook example
    name: Kit Kat
    url: 'http://domain.com/path/to/webhook'
    method: post
    content-type: json
    body: '{"mac": "AC:63:BE:67:B2:F1", "action": "toggleLight"}'
    confirmation: send-tg
  40:B4:CD:67:A2:E1: # Home Assistant example
    name: Fairy
    homeassistant: hassio.local
    event: toggle_kitchen_light
  18:74:2E:87:01:F2: # OpenHAB example
    name: Doritos
    openhab: 192.168.1.140
    item: open_door
    state: "ON"
    confirmation: send-pb
  44:65:0D:75:A7:B2: # IFTTT example
    name: Pompadour
    ifttt: cdxxx-_gEJ3wdU04yyyzzz
    event: pompadour_button
    data: {"value1": "Pompadour button"}
confirmations:
  send-tg:
    service: telegram
    token: '402642618:QwGDgiKE3LqdkNAtBkq0UEeBoDdpZYw8b4h'
    to: 24291592
    is_default: false
  send-pb:
    service: pushbullet
    token: 'o.BbbPYjJizbPr2gSWgXGmqNTt6T9Rew51'
    is_default: false

UPGRADE from previous versions

The following execution methods are supported with your Amazon Dash button with this program:

image

image

image

System command .. image:: https://goo.gl/Cq4bYC OpenHAB

Call url .. image:: https://goo.gl/L7ng8k IFTTT

Homeassistant

Amazon-dash also allows you to send a confirmation after pressing a button. You will also receive a message in case of failure. Telegram and Pushbullet are supported.

For more information see the documentation of the configuration file.

  1. Run the daemon:

If you use a Systemd system (Debian 8+, Fedora 15+, Ubuntu 15.04+, Arch Linux 2012+, OpenSUSE 12.1+, and more) execute:

$ sudo systemctl start amazon-dash

To run Amazon-dash at startup:

$ sudo systemctl enable amazon-dash

To run Amazon-dash manually look at the documentation.

  1. Avoid making a purchase by pressing the button

This program detects when your button connects to the network to execute actions, but does not prevent the ordering. The easiest way to avoid making a purchase is to reconfigure the button using the Amazon instructions (by pressing the button for 5 seconds) but skipping the last configuration step (do not choose which product you want to associate with the button). If Amazon does not know what product you want, they can not charge anything on your credit card.

There are two more methods in the documentation.

Docker

Using Amazon Dash within docker is easy! First, pull the Docker image:

$ docker pull nekmo/amazon-dash:latest

Then, create a container and run Amazon Dash itself:

$ docker run -it --network=host \
             -v </full/path/path/to/amazon-dash.yml>:/config/amazon-dash.yml \
             nekmo/amazon-dash:latest \
             amazon-dash run --ignore-perms --root-allowed \
                             --config /config/amazon-dash.yml

Join the community

Do you need ideas on how to use Amazon Dash? See what the community does with this project. Some examples:

See all the examples in the community.

amazon-dash's People

Contributors

bachya avatar gpotter2 avatar luiseok avatar nekmo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.