Can't get Amazon Dash button working - Hassio dasshio

Hey everyone. I’m running Hassio 51.2 on an rpi 2. I got dasshio installed using this repository https://github.com/danimtb/dasshio.

{
  "buttons": [
    {
      "name": "Lamp",
      "address": "40:b4:cd:82:06:8f",
      "url": "http://xxxx.duckdns.org:8123/api/services/switch/toggle",
      "headers": "{'x-ha-access': 'MYPASSWORD'}",
      "body": "{'entity_id': 'switch.lamp'}"
    }
  ]
}

Nothing is happening. I’m not sure what I’m doing wrong. Can anyone help me get this button up and running.

1 Like

Hi @looknsharp!

As headers and body parameters have to be strings, you have to escape the quote characters like this:

   "headers": "{\'x-ha-access\': \'MYPASSWORD\'}",
   "body": "{\'entity_id\': \'switch.lamp\'}"

This is a limitation of Hass.io options add-on, as double nested json arrays are not allowed.

Please check the example in the readme :slight_smile:

Hey @danimtb

I edited it to this but it is still not working and nothing is coming up in the logs.

{
  "buttons": [
    {
      "name": "Lamp",
      "address": "40:b4:cd:82:06:8f",
      "url": "http://XXXX.duckdns.org:8123/api/services/switch/toggle",
      "headers": "{\"x-ha-access\": \"MYPASSWORD\"}",
      "body": "{\"entity_id\": \"switch.lamp\"}"
    }
  ]
}

Check add-on version is the latest (v0.0.4) and maybe changing MAC to capital letters? I am not sure, but I think that was already solved.

Could you try it and let me know?

Thank you

Mine is all lowercase and works fine.

1 Like

Any particular reason you’re using an external IP to run an internal function or are you controlling another instance of HA on another device?

I have just tested that config with the data of my Dash and Home Assistant instance and dasshio is working fine.

Have you configured the button via Amazon mobile app and connected your Dash to your wifi network?

It was the way I learned how to get it working from my pebble watch. I just assumed I was supposed to set it up this way.

I changed to caps and no change. The button is connected to the internet. I’m receiving the Amazon notification that says my button is almost set up when I push it. I also updated to v0.0.4.

Maybe this is a networking problem. I run Home Assistant in a rpi3 connected to wifi. Is yours connected via ethernet?

I am on ethernet using an rpi2.

Fair enough, no need though as that way you’re sending a command out to the internet and back in again to the same device.

Try using your local IP as it’s possible your router is blocking the command, loopblocking is not uncommon.

Is the MAC definitely right, no misread Os and 0s?

Nah, I copy/pasted the address. I changed it to this with no luck :confused:

{
  "buttons": [
    {
      "name": "Lamp",
      "address": "40:b4:cd:82:06:8f",
      "url": "http://RPI_IP_ADDRESS:8123/api/services/switch/toggle",
      "headers": "{\"x-ha-access\": \"MYPASSWORD\"}",
      "body": "{\"entity_id\": \"switch.lamp\"}"
    }
  ]
}

My Log just shows

starting version 3.2.2
2017-08-20 16:52:37,582 | INFO | Reading config file: /data/options.json
2017-08-20 16:52:37,587 | INFO | Starting sniffing... 

The Dash fades white a few times then flashes red a few times.

My buttons do exactly the same.

The only relevant bit of the config as far as getting dasshio to pick up the button press is the MAC address so if that’s right I’m not sure what else to suggest.

Is it definitely connected to the same network/subnet? Do you have more than one button? What other adds-ons are you running?

Could it be an ARP vs udp issue? Does dashio support both?
Some (older) buttons use arp, whereas others (newer) use udp.

You read more here:

Search for “protocol”

@danimtb said it supports both when he originally posted this even though the github page only mentions ARP. Mine are all brand new UDP ones and work fine, haven’t got an old one to compare.

Maybe @looknsharp could give your Dasher based one a go and see what happens?

Ok. I looked at the GitHub readme and saw only arp so wondered if that could be it.
Also worth trying @danimbt s find_button script to see if the buttons are detected.
No harm to try dasher if all else fails…

If you look at the code it also only mentions ARP which had me confused too but it uses scapy so assume that is what picks up both protocols under one banner…no idea how these things really work so just guessing!

I’ve just got the one button. I’m pretty new to all of this, so I’ve got what I think is a pretty basic setup. The only add-ons I have are SSH server, Samba share, Check Home Assistant configuration, and dasshio. I can see them both in my router’s Client list, my RPI is connected by Ethernet. I’m sure its the right mac address as Its IP number doesn’t appear in the list until I push the button and I checked on https://macvendors.com/ and it is an Amazon mac number.

Seems there is an issue with network interface on rpi. I’ll have to give it a look.

It would be helpful if anyone could confirm this. I will try to connect my rpi3 over ethernet and see what happens