Dasshio - Amazon Dash Buttons Hass.io add-on

No sure what you mean by:

I do not see the repo link to add to hassio addons

To install Dasshio you only need to place the repo url (GitHub - danimtb/dasshio: Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant) in your Add-On Repositories box.

Please consider opening an issue here Issues · danimtb/dasshio · GitHub explaining your problem, that way I can focus on it and it will keep this thread just for general information.

Thanks!

Told you… old and sometimes kinda dense! Did not scroll up, just linked the github and installed it.

BTW, works great!

2 Likes

Well, I wanted to improve the config of Dasshio and I have released version 0.2.0!!

Now we can use domain, service and service_data parameters in the config as done in the home assistant service tab. This uses internal Hass.io communication by default. Check the example here: https://github.com/danimtb/dasshio#options-example-domain-service-service_data

Note url, body and headers config is still available (but not recommended unless you want to call an external service): https://github.com/danimtb/dasshio#options-url-body-headers

Please update! Thanks :smiley:

3 Likes

How would one put 2 lights in the new config file?

If you mean two on the same button, same logic as before, just create a group of the two lights and set the config similar to this…

{
  "buttons": [
  {
    "name": "Gillette",
    "address": "AC:63:BE:77:C4:0D",
    "domain": "group",
    "service": "toggle",
    "service_data": "{\"entity_id\": \"group.room_lights\"}"
  }]
}
1 Like

You’re spoiling us now :slight_smile:

1 Like

Works great - thank you!!

1 Like

Thank you for creating this add-on for those of us stuck with Hassio! I got it working on HA 0.59.1 to play/pause Spotify using your detailed instructions.

1 Like

What is the cleanest way to create an “all off” config?

I’ve tried Bobby_Nobble’s code above,

{
  "buttons": [
    {
      "name": "finish",
      "address": "18:74:2E:7E:3C:8F",
      "domain": "group",
      "service": "turn_off",
      "service_data": "{\"entity_id\": \"group.power\"}"
    }
  ]
}

After putting all my lights and switches in a power.group group, I think I’m having trouble because my frontend has a password… do you have to define this anywhere? The logs I get after pressing the button is below, but nothing happens in HASS? Thanks

2018-01-05 23:09:03,639 | INFO | Starting sniffing...
2018-01-05 23:09:21,930 | INFO | finish button pressed!
2018-01-05 23:09:21,931 | INFO | Request: http://hassio/homeassistant/api/services/group/turn_off
2018-01-05 23:09:32,028 | INFO | Status Code: 200
2018-01-05 23:09:32,029 | INFO | Successful request
2018-01-05 23:09:32,073 | INFO | Packet captured, waiting 20s ...

No need for the password if using the latest version and the code version you’ve used as the while point of the latest version was direct communication with HA.

Your code looks fine at first glance, have you checked the group actually works directly from the front end

Yeah it works in services

I used to this button working with this code previously so I know the button works but it was just used to toggle my lights.

{
  "buttons": [
    {
      "name": "finish",
      "address": "18:74:2E:7E:3C:8F",
      "url": "http://192.168.1.77:8123/api/services/switch/toggle",
      "headers": "{}",
      "body": "{\"entity_id\": \"group.lights\"}"
    }

Have you tried just changing toggle to turn_off using that format?

After much experimenting, I found that this works!!

{
  "buttons": [
    {
      "name": "finish",
      "address": "18:74:2E:7E:3C:8F",
      "domain": "homeassistant",
      "service": "turn_off",
      "service_data": "{\"entity_id\": \"group.power\"}"
    }
  ]
}

Recently migrated from AIO to Hass.io

I can get one single dash to work but when I add more than one button I get an error “Parameter error for button 2: [address] is not valid” I’m guessing maybe its somewhere in my formatting? Here’s the example on the Github page showing two buttons:

  "buttons": [
  {
    "name": "Gillette",
    "address": "AC:63:BE:77:C4:0D",
    "url": "http://httpbin.org/post",
    "headers": "{}",
    "body": "{\"payload\": \"This is an HTTP Post request!\"}"
  },
  {
    "name": "Bounty",
    "address": "AC:63:BE:77:C4:0C",
    "url": "http://hassio/homeassistant/api/services/script/welcome_home",
    "headers": "{}",
    "body": "{}"
  }]
}

No way of guessing without you posting your own code.

I’ve been playing with it all night and removed the middle button and now I’ve got two buttons working, only thing I can figure is the middle button is faulty? Or maybe something to do with the MAC needing to be assigned to a specific IP inside my router? The reason I was trying to have two buttons for the garage door was one for inside the house and one for inside my garage near the big door where there isn’t a button available right now. Maybe having two buttons trying to perform the same task was the problem too? Here’s what I was trying before I removed the middle one:

  "buttons": [
  {
    "name": "Garage Door Dash-3",
    "address": "MAC ADDRESS HERE",
    "domain": "script",
    "service": "toggle",
    "service_data": "{\"entity_id\": \"script.signal_garage_door\"}"
  },
  {
    "name": "Garage Door Dash-1",
    "address": "MAC ADDRESS HERE",
    "domain": "script",
    "service": "toggle",
    "service_data": "{\"entity_id\": \"script.signal_garage_door\"}"
  },
  {
    "name": "Office Fan Dash-2",
    "address": "MAC ADDRESS HERE",
    "domain": "switch",
    "service": "toggle",
    "service_data": "{\"entity_id\": \"switch.office_fan\"}"
  }]
}

You can have as many buttons doing the same thing as you like, the press recognition and the action calling are separate things.

What does the dasshio log say? You should see it recognise the button and then call the action, if either is missing is a pointer to where the error lies. Can you see it connect on your router?

Does the ‘rogue’ button still work in the Amazon app?

This isn’t absolutely necessary but it makes the reaction to the button presses much quicker.

1 Like

Dasshio log says “Parameter error for button 2: [address] is not valid”

When that middle button is included none of the buttons work, when I press any of the other buttons the same error comes up either way. I should note I was trying this ‘rogue’ button when I first got Dasher setup on my AIO and it wouldn’t execute what I had assigned to it there either, but I had forgotten about that when I went to migrate to Hass.io this week. I didn’t associate the error in Dasshio with that specific button until I decided to try removing it late last night then the other two buttons worked fine, I thought I was having an error due to my config being formatted wrong or something with multiple buttons.

Truthfully I have more buttons coming soon, I’m just going to assume this one button was bad in some way and see how the new buttons work when they arrive. Thanks again for replying though, hopefully it was just bad luck with that one button.

1 Like

Ok, so the addon was stopping way to often, so I unistalled it after a rebuild and no improvement. I wanted to do a fresh install and now when I click the install button, it spins for about 2 seconds and turns red. The addon is not installed!

Hassio 0.62.1, Nothing logged on the console when it fails.

Supervisor logs do have errors:

18-02-11 04:19:50 INFO (SyncWorker_1) [hassio.docker.addon] Start build 03d23610/armhf-addon-dasshio:0.2.0
18-02-11 04:19:52 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 416, in start
    resp = yield from self._request_handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web.py", line 325, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 93, in impl
    return (yield from handler(request))
  File "/usr/lib/python3.6/site-packages/hassio/api/security.py", line 34, in security_layer
    return await handler(request)
  File "/usr/lib/python3.6/site-packages/hassio/api/utils.py", line 33, in wrap_api
    answer = await method(api, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/addons/addon.py", line 554, in install
    if not await self.instance.install(self.last_version):
  File "/usr/lib/python3.6/site-packages/hassio/docker/utils.py", line 18, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/docker/addon.py", line 259, in _install
    return self._build(tag)
  File "/usr/lib/python3.6/site-packages/hassio/docker/addon.py", line 274, in _build
    image.tag(self.image, tag='latest')
AttributeError: 'tuple' object has no attribute 'tag'

Ok, upgraded supervisor from .87 to .88 and it installed!