Skip to content

Commit

Permalink
Markdown style in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danimtb committed Dec 10, 2017
1 parent 4bc8248 commit 79168e7
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
[Hass.io add-on](https://home-assistant.io/addons/) to use [Amazon Dash Buttons](https://en.wikipedia.org/wiki/Amazon_Dash) in [Home Assistant](https://home-assistant.io).

## Description: How dasshio works

This is a python script used to scan wifi devices connected to your network (using ARP and UDP). If a device matches any MAC address of the options, it will perform a HTTP POST request to the Home Assistant API.

## Usage

The purpose of Dasshio is to "integrate" [Amazon's Dash buttons](https://en.wikipedia.org/wiki/Amazon_Dash) in Home Assistant in an easy way with [Hass.io](https://home-assistant.io/hassio/).

See [RESTful API Post Services](https://home-assistant.io/developers/rest_api/#post-apiservicesltdomainltservice) documentation to see what you can do.
Expand All @@ -20,24 +22,26 @@ Examples:
- domain: *script*
- service: *welcome_home*
- service_data: *{}*

Have a look at [Service calls](https://home-assistant.io/docs/scripts/service-calls/) to know what services you can use and what you can do with them.

Have a look at [Service calls](https://home-assistant.io/docs/scripts/service-calls/) to know what services you can use and what you can do with them.

## How to install this Hass.io add-on

To install this add-on, please, follow Home Assistant documentation on how to [Install Third-party Add-ons](https://home-assistant.io/hassio/installing_third_party_addons/)

## Options example: domain, service, service_data

Here it is an example of a Dash Gillette button used to toggle a light and a Dash Bounty to call a script. Note you can add as many buttons as you like inside the "buttons" array.

- name: name of your device
- address: MAC of your device
- domain: Home Assisntant domain (`light`, `switch`, `script`, `automation`...). Check [Home Assistant RESTful API](https://home-assistant.io/developers/rest_api/).
- service: Home Assistant service.
- service_data: Home Assistant service data to call the service (Optional).
- name: name of your device
- address: MAC of your device
- domain: Home Assisntant domain (`light`, `switch`, `script`, `automation`...). Check [Home Assistant RESTful API](https://home-assistant.io/developers/rest_api/).
- service: Home Assistant service.
- service_data: Home Assistant service data to call the service (Optional).

[*/data/options.json*](https://home-assistant.io/developers/hassio/addon_config/#options--schema)
```

```json
{
"buttons": [
{
Expand All @@ -62,16 +66,18 @@ Here it is an example of a Dash Gillette button used to toggle a light and a Das
**WARNING**: As headers and body sections have to be strings, it is necessary to use backslashes ( *\\* ) before double quotes ( *"* ) to escape them. Like this: *\\"*

## Options: url, body, headers

Another possiblity would be to use Dasshio to perform a HTTP Post request to an URL outside Home Assistant. To do so you can use the configuration below.

- name: name of your device
- address: MAC of your device
- url: Url to perform the HTPP Post request (http or https). Check [Home Assistant RESTful API](https://home-assistant.io/developers/rest_api/).
- headers: HTTP Post headers (Useful for Home Assistant API password -see example-).
- body: HTTP Post Body (Normally the *entity_id* in Home Assistant)
- name: name of your device
- address: MAC of your device
- url: Url to perform the HTPP Post request (http or https). Check [Home Assistant RESTful API](https://home-assistant.io/developers/rest_api/).
- headers: HTTP Post headers (Useful for Home Assistant API password -see example-).
- body: HTTP Post Body (Normally the *entity_id* in Home Assistant)

[*/data/options.json*](https://home-assistant.io/developers/hassio/addon_config/#options--schema)
```

```json
{
"buttons": [
{
Expand All @@ -93,18 +99,20 @@ Another possiblity would be to use Dasshio to perform a HTTP Post request to an

**Note**: As described above, you can still use `http://hassio/homeassistant/api` to route requests over the Hassio local network and perform API calls to Home Assistant. You can see [Hass.io Addon Communication](https://home-assistant.io/developers/hassio/addon_communication/#home-assistant) for more information.


## How to find the MAC address of your Dash
At the moment, the best way to do this is to hold down the button for 6 seconds, disconnect from the current WIFI and connect to the *Amazon ConfigureMe* SSID. If prompted, "stay connected" and open web page **192.168.0.1**. You will see your button’s ‘about’ page with the MAC and the additional information.

At the moment, the best way to do this is to hold down the button for 6 seconds, disconnect from the current WIFI and connect to the *Amazon ConfigureMe* SSID. If prompted, "stay connected" and open web page **192.168.0.1**. You will see your button’s ‘about’ page with the MAC and the additional information.

Alternatively, you can access your Wifi Router and check the MAC addresses in the history of connected devices. Then, copy and paste the MAC in a service like [MA:CV:en:do:rs](https://macvendors.com/) to find the Vendor of that device. The Amazon Dash button vendor should be: *Amazon Technologies Inc.*

---------------------

### Credit

- [amazon-dashbutton](https://github.com/JulianKahnert/amazon-dashbutton) (Thanks to [JulianKahnert](https://github.com/JulianKahnert) in [Issue#1](https://github.com/danimtb/dasshio/issues/1))

### Sources & Inspiration:

- [Raspberry Pi script](https://github.com/vancetran/amazon-dash-rpi)
- [Maddox Dashbutton Repo](https://github.com/maddox/dasher)
- [General Amazon Dash Hack](https://medium.com/@edwardbenson/how-i-hacked-amazon-s-5-wifi-button-to-track-baby-data-794214b0bdd8#.n6fhd3z40)

0 comments on commit 79168e7

Please sign in to comment.