Right, so I've finally gotten around to deciding what I want to do with the dash buttons, I'm going to use them to keep track of various aspects of my life:
- Having a coffee? Press the coffee button.
- Having a bath? Press the bath button.
- Doing some exercise? Press the exercise button.
All these presses will be sent to Initial State (or Airtable, or maybe just a google spreadsheet), for further collation/reporting later.
OK, so that's probably very silly, but it's a start, and I can see further info being included in the report as time goes on.
So, I set-up Raspberry Pi 1, installed Node 4 (which in itself was a ballache), and installed dasher. I used the
find_button script to discover the mac address of the button (which itself involves connecting to the button with your phone via Bluetooth, giving it your wifi password, but stopping before choosing the product to attach it to), then configured dasher on my pi it to send the relevant data to initial state.
So far so good, the button was working, the data was being sent to the server, and everyone was happy - apart from my phone, which popped up with a notification asking me to choose a product every time I pressed the button.
No worries, I thought, now the button was configured I could simply remove it from my account, which I did, but that stopped it from working. This was because the button was still talking with amazon's server on each press, which I guess must command the button to factory reset.
This is an issue for me. I don't want a notification on my phone each time I press the button, but that's the only way I can make it work using the dasher approach.
There is an alternative which might work better but is a lot more faff to set-up, that of One Second Dash. This is different in that you give the dash a fake network SSID to connect to, which the pi detects by placing the WiFi interface in monitor mode and listening for probe requests for that SSID (via tcpdump). This may be a better approach, because at no point does the button every actually speak with amazon, so there's no phone notifications or factory reset (at least in theory).
The other approach is to use other things as triggers:
- I could get an IoT button from amazon, but they're $20.
- I could use flic, but they're £32 each, and require the phone to be in bluetooth range.
- I could use IFTTT to register presses from my phone and/or watch, but that's boring.
Anyway, I'll try the one second dash thing, and will report back.