Amazon Dash Button as openHAB Trigger

@rlkoshak,

You may have figured out a good solution already, but I wanted to share mine for anyone looking for a quick way to send OpenHAB commands from iOS.

Instead of using the DO button (with iOS notification panel integration), I found a very flexible iOS app called Workflow that allows you to make custom “workflows” (like graphical scripts) that can be tied to buttons on the notification panel.
Workflows are designed by dragging and dropping pre-defined blocks into a sequence, where the output of one block feeds the input of the next block.

I built a workflow that calls the my.openhab.org REST API directly, which circumvents the IFTTT routing. All-in-all, this is much faster than the DO button because the Workflow buttons are immediately available in the panel (whereas I find the DO buttons take 2-3 seconds to load), and the web call is more direct.

The Workflow app costs like $5, but IMO it’s worthwhile. I did run across a couple gotcha’s though.

First, I had to make 2 separate web calls to my.openhab in order to authenticate, then send the command. Someone more savvy with HTTP may be able to find a way to do this in one call. Second, you need to encode your username/password in the URL, which means converting illegal characters such as “.” and “@” to “%2E” and “%40” respectively.

My Workflow looks like this, where the items in brackets need to be replaced with your information and be URL encoded:

Text block - https://[username]:[password]@my.openhab.org
Get Contents of URL block
Text block - https://[username]:[password]@my.openhab.org/CMD?[item_name]=[value]
Get Contents of URL block

What you end up with is a list of Workflow’s in the iOS notification panel, each of which can represent a command or sequence of commands to your my.openhab account. These can also be added as home screen icons.

1 Like