Amazon Dash Button as openHAB Trigger

I ended up not using the Workflow app very much, so I haven’t updated it for OH2. I suspect it can still be done but with a GET call to /rest/items?[item_name]=[value] instead of the deprecated CMD endpoint.

@oliver,

As reference, Thing declaration

Thing <binding_id>:<type_id>:<thing_id> "Label" @ "Location" [ <parameters> ]

In the Dash Button binding documentation, the <thing_id> is shown as the button’s MAC address (using dashes). Then, the Rule uses the <thing_id> in the trigger statement.

This note regarding the Thing declaration example

(Pay attention: The mac address has to be given in two different formats)

Makes it seem like one must use the MAC address (although a strict syntax difference of using dashes must be adhered to) as the <thing_id>.

Since it is possible to use a <thing_id> of one’s own choosing rather than using the MAC address, would it make sense to change the documentation to make this possibility clearer?

I’d rather only hard code the MAC address only once. Thus I’ve chosen <thing_id> which is descriptive of the button’s automation function.

Regards.

Mike

P.S. I’m happy to make this change to the documentation myself… but cannot find where and how this is done.

P.P.S. I did make several edits to the document once someone helped me with the process. I added information about the Thing definition and also information on changing the battery with the differences of the Gen 1 and Gen 2 Dash buttons all linked to the teardowns available from Matthew Petroff. Unfortunately the changes do not appear to have been accepted as the documentation has not changed online. I believe my edits were helpful, accurate, and fully detailed. I’m not sure why they were not accepted. Perhaps I did not perform the edits correctly - although once I followed the edit link, the process seemed pretty straightforward.

Hi Rob,

Did you get an answer to your question?
I can’t see anyone addressed it in this thread, and I’ve searched all over & found nothing.
I have the same issue - log entry as expected, showing the button got pressed, but the rule just doesn’t fire - not even the example given in the manual pages.
I’ve found 2 other ways of achieving it, but both outside of OH, so it’d be a real kludge, and not the right answer. Sadly if I don’t get an answer soon, then that will have to do. Not what I’d hoped.

Good luck

Lee & @RobWest,

I’d made these notes a few weeks ago when I was learning to set these up:

I’m not sure if the Thing declaration MAC syntax is case sensitive. I had the MAC in all upper case and did not appear to be working. I made some changes including changing the MAC to lower case and the button worked.

The MAC address has to be hard coded in the Thing declaration (the <thing_id> can be any string - it doesn’t have to be the MAC address). If a button has to be swapped out for a new one (e.g., when the battery dies in the old one), ONLY the Thing declaration where it is hard coded will have a new MAC address which will have to be replaced. If you use a <thing_id> of your own choosing, the trigger in your rules will not have to change.

Hope this helps in some way.

Mike

1 Like

Hi Rob,

Ahh, that’s very interesting & extremely plausible! Thanks very much.

I really wasn’t making any progress, and just getting bogged down, so I have scratched the whole thing & started again from a fresh OH install, having saved the bits which seemed to work.
While I work on that, I’m using a docker called “DashBtn” which is quick & dirty but works very reliably! It only listens for dash buttons & then executes a script when it hears one. Not very expandable but reliable & easy for everyone to use rather than finding the MQTT client & sending exactly the right string etc…

Thanks I will keep your notes in mind.
TTFN