Dasshio - Amazon Dash Buttons Hass.io add-on

But then how/where will we specify that the URL method to be used is “POST”. As shown in the examples in old syntax for Dasher, there is a tag specifically for the method about consuming the URL.

``“method”: "POST" _(it could be amongst POST, GET, PUT, PATCH, and DELETE._)

Should I assume that it is not needed anymore the in Dasshio configuration, and by default every URL mentioned would be POST.

According to the documentation, yes, when you use the URL field, the request is always a POST request. You can see in the second URL example that they use both an empty header and body field.

1 Like

Thanks guys, this solve all my problems.

1 Like

So i presume

"body": "{\"payload\": \"This is an HTTP Post request!\"}"

would only be used when the URL is anything else than a “POST” request , I presume. Right.

Dasshio always does a POST request as stated in the description of the addon: https://github.com/danimtb/dasshio#description-how-dasshio-works

Please read the readme carefully and follow the examples

2 Likes

Got it, you are right, it always only will do a POST request.

Thanks.

Hi!

Amazing thing, i have not installed it yet because my button did not arrive yet

But i have a question.
Is it possible to somehow detect double presses or long presses to active different scripts?

I bet long presses are not possible because the button just sends a signal after the lifting the finger, but maybe I am wrong.

But i read that there is a timeout feature to avoid involuntary double activations, so the signal would be there.

It would be amazing if i could just use one button for different scenes in my living room!

Thanks!
Greetings

Dasshio just checks to see if the Dash button is sending out an ARP while connecting to wifi, and if it is, it toggles the script. When you press the button, it wakes up and connects to wifi. Pressing the button again doesn’t do anything further. The timeout to prevent double activations just means that Dasshio won’t check again within that timeout to see if those ARPs are happening.

Unfortunately there is no signal that gets sent out explicitly when the button is pressed.

TL;DR: No, not with the current detection method

I forgot to mention it, but some months ago Dasshio was featured in one of the great videos of the @TheHookUp. It is interesting to learn different ways of using this little buttons :smile:

Great to see that other people find it useful and I would say quite easy to setup!

Link to his blog: Add an Amazon Dash Button to Home Assistant (Hass.io) for FREE – The Hook Up

Bah! I had this working and wiped my system and restored a snapshot and now it’s not working anymore. How do I troubleshoot it?

I think the sniffer isn’t seeing any of the button presses, the dasshio log stays like this when I’ve pressed the button several times:

2019-02-09 15:42:20,614 | INFO | Reading config file: /data/options.json
2019-02-09 15:42:20,625 | INFO | Starting sniffing...

I had set up a boolean toggle so I could see my presses, this used to work (before the wipe) and now I’m guessing since the sniffer isn’t detecting button presses it never gets toggled:

{
  "timeout": 20,
  "buttons": [
    {
      "name": "neat",
      "address": "68:XX:e9:fa:5e:XX",
      "domain": "input_boolean",
      "service": "toggle",
      "service_data": "{\"entity_id\": \"input_boolean.dash_toggle\"}"
    }
  ]
}

I know that the MAC address is correct, I’ve lined it up with my wireless router and my firewall appliance. I use the firewall appliance to block all traffic from the dash button to the internet and with that in place it worked fine before the wipe. I tried, just for grins, allowing the button to see the internet and I got many notifications from Amazon about the un-configured button but the presses were still not detected by home assistant/hass.io.

I’m not sure how to troubleshoot this problem further, anyone have ideas on where I should go next?

Thanks,
-Greg

Hi Everyone,

I had this add-on working in Hass.io a few months ago but had to nuke and rebuild my install. I am attempting to add back the dash button functionality but am unable to load the repository.

Looking in the system log, I’m seeing this error:

WARNING (MainThread) [hassio.addons.data] Can't read /data/addons/git/03d23610/dasshio/config.json: required key not provided @ data['arch']. Got None

I’m hoping that it is just simple simple that needs to be updated in the repository. Does anyone have any ideas if this error can be bypassed?

Thanks

This is my complete config, if that helps. I know the format has changed sometime in the past.

{
  "timeout": 20,
  "buttons": [
    {
      "name": "Medicine",
      "address": "AA:AA:AA:AA:AA:AA",
      "domain": "input_boolean",
      "service": "turn_on",
      "service_data": "{\"entity_id\": \"input_boolean.medicine\"}"
    }
  ]
}

It’s not you. :slight_smile:
I ran into the exact same issue and after pounding around I was notified that the hassio dashio is not currently available, a discussion is happening in gethub https://github.com/danimtb/dasshio/issues/69 about it and right now… nobody knows.

Just noticed an update is available to the plugin and this now works again for me for the first time in a long while. However, I now seem to have an issue where it registers two button presses each time I press the dash button (ie within 1 second) so this has the effect of toggling a switch on and then straight off again.

Any thoughts on how I can get it to stop sniffing for a few seconds after registering a button push?

See Here

1 Like

Just migrating from nekmos amazon-dash to dasher addon
Someone an Idea how I can fire an event?

Hello,

So i was able to setup the Dasshio using guidance provided on its GitHub page.

I was now trying to trigger multiple action on a single button press, which are

1 . Multiple HA service calls. (with domain, service, service_data)
2. Combination of a HA service and URL ( url, body, headers)

I tried to write the code the following way for 2 services call

{
  "timeout": 20,
  "buttons": [
    {
      "name": "AmazonBasic",
      "address": "B4:7C:9C:00:9C:D2",
      "domain": "light",
      "service": "toggle",
      "service_data": "{\"entity_id\": \"light.computer_desk\"}"
    },
   {
      "name": "AmazonBasic",
      "address": "B4:7C:9C:00:9C:D2",
      "domain": "light",
      "service": "toggle",
      "service_data": "{\"entity_id\": \"light.smart_bulb\"}"
    }
  ]
}

EDIT

Ok Found the solution for above scenario, simply add a comma “,” and enter all entities ID within the same block of quote to have action performed on multiple entities, so the correct way should be:

{
  "timeout": 20,
  "buttons": [
    {
      "name": "AmazonBasic",
      "address": "B4:7C:9C:00:9C:D2",
      "domain": "light",
      "service": "toggle",
      "service_data": "{\"entity_id\": \"light.computer_desk,light.smart_bulb\"}"
    }
  ]
}

Similarly I tried to add an action, to trigger a HA service call by toggling the light bulb on/off and triggering a URL on IFTTT webhooks to send a mobile notification on the IFTTT mobile app. Something like below

{
      "timeout": 20,
      "buttons": [
        {
          "name": "AmazonBasic",
           "address": "B4:7C:9C:00:9C:D2",
           "domain": "light",
           "service": "toggle",
          "service_data": "{\"entity_id\": \"light.computer_desk\"}"
        },
       {
          "name": "AmazonBasic",
          "address": "B4:7C:9C:00:9C:D2",
          "url": "https://maker.ifttt.com/trigger/Light_Desk/with/key/XXXXXXXXXXXX",
          "headers": "{}",
          "body": "{}"
        }
      ]
    } 

Even in that case only the HA service is executed , that is light bulb is toggled, however the URL is never triggered, hence no notification on the mobile. If I try to run URL action separately then it is correctly fired and I receive the webhook triggered notification.

Can anyone please guide an/or correct the code above, to be able to combine multiple entities/actions/action types with a single button press.

Thanks for your help

Hi All! So I started setting up Dasshio last night. I decided to use the HTTP code to cycle my Tasmotized Sonoff on and off, since I couldn’t find an option to send Toggle via MQTT, but I had no luck getting it to recognize button pushes.

… or so I thought. Check out this weirdness:

2019-06-07 20:50:29,975 | INFO | Reading config file: /data/options.json
2019-06-07 20:50:29,976 | INFO | Starting...
2019-06-07 20:50:29,977 | INFO | Starting sniffing...
2019-06-08 01:50:14,487 | INFO | Office button pressed!
2019-06-08 01:50:14,565 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:14,565 | INFO | Status Code: 200
2019-06-08 01:50:14,566 | INFO | Successful request
2019-06-08 01:50:14,581 | INFO | Finishing sniffing
2019-06-08 01:50:14,582 | INFO | Starting sniffing...
2019-06-08 01:50:15,491 | INFO | Office button pressed!
2019-06-08 01:50:15,567 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:15,567 | INFO | Status Code: 200
2019-06-08 01:50:15,568 | INFO | Successful request
2019-06-08 01:50:15,590 | INFO | Finishing sniffing
2019-06-08 01:50:15,590 | INFO | Starting sniffing...
2019-06-08 01:50:16,483 | INFO | Office button pressed!
2019-06-08 01:50:16,568 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:16,569 | INFO | Status Code: 200
2019-06-08 01:50:16,570 | INFO | Successful request
2019-06-08 01:50:16,590 | INFO | Finishing sniffing
2019-06-08 01:50:16,590 | INFO | Starting sniffing...
2019-06-08 01:50:17,489 | INFO | Office button pressed!
2019-06-08 01:50:17,558 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:17,558 | INFO | Status Code: 200
2019-06-08 01:50:17,559 | INFO | Successful request
2019-06-08 01:50:17,570 | INFO | Finishing sniffing
2019-06-08 01:50:17,570 | INFO | Starting sniffing...
2019-06-08 01:50:18,490 | INFO | Office button pressed!
2019-06-08 01:50:18,590 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:18,590 | INFO | Status Code: 200
2019-06-08 01:50:18,591 | INFO | Successful request
2019-06-08 01:50:18,606 | INFO | Finishing sniffing
2019-06-08 01:50:18,606 | INFO | Starting sniffing...
2019-06-08 01:50:19,480 | INFO | Office button pressed!
2019-06-08 01:50:19,530 | INFO | Request: http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE - body: {}
2019-06-08 01:50:19,530 | INFO | Status Code: 200
2019-06-08 01:50:19,531 | INFO | Successful request
2019-06-08 01:50:19,545 | INFO | Finishing sniffing
2019-06-08 01:50:19,546 | INFO | Starting sniffing...

Four hours after I was testing this, all of the button pushes come through, a second apart from each other. I wasn’t awake at the time to tell whether the lights came on or off, and to be frank I’m rather glad I wasn’t because I’d have likely called an exorcist…

Has anyone else seen this type of delayed response? My code block follows:

{
  "timeout": 20,
  "buttons": [
    {
      "name": "Office",
      "address": "AC:63:BE:xx:xx:xx",
      "url": "http://192.168.1.214/cm?user=admin&password=password&cmnd=Power%20TOGGLE",
      "headers": "{}",
      "body": "{}"
    }
  ]
}

I just saw that Amazon is going to officially stop supporting Dash buttons and obviously wanted to see how this would affect using them as repurposed IOT devices in HA. I’m assuming already set up dash buttons should keep working as they already are on a network but you won’t be able to change that network or add new dash buttons after the setup service is removed. I have probably a dozen of these devices waiting for a purpose and I’ve modified other ones with new cases so the battery can be changed. Hoping this isnt the end of them as an option for a wireless button

So what’s the deal? Is it still possible to repurpose them? I have two Dash Buttons that are of no use now that Amazon discontinued them and I would like to use them for light control