Configurable button events
Some devices offer a button press to be recognized in the Gadgetbridge and allow assigning actions to these presses. Currently, this is available in MiBand 2, Amazfit Bip and Amazfit Bip Lite. (know about more? Please help with edits).
You can configure Gadgetbridge to trigger an action or send a broadcast message with a variable `button_id, which is a number indicating an id of the triggered event.
Device specific settingsgo to
Set Button actions to Enabled
Button press count - set to your desired number of consequent presses to form an
Event, for example 1
Maximum delay between presses - time (ms) within which button presses are joined together into an
Event, for example 500
If you set Button press count to 1, to trigger Event 1, you must pres 1x, to trigger Event2, you must press 2x quickly...
If you set Button press count to 2, to trigger Event 1, you must pres 2x quickly, to trigger Event2, you must press 4x quickly...
For each Event, you can choose an action. These include Media Play/Pause, Media Toggle Playback, Next/Previous Track, Volume Up/Down, Skup forward/back and Send broadcast.
This message can be customized and it also contains a variable called
button_id, with and ID of the Event.
To make use of these broadcast messages, you need to now catch the sent broadcast message and trigger an action. You need an app to do this, you can install Easer, or Tasker...
This example shows how to make play/pause toggle to the broadcast
nodomain.freeyourgadget.gadgetbridge.mibandButtonPressed without utilizing the
button_id /at this point, Easer actually does not allow utilizing of message parameters, like
Create configuration via Menu → Data
Profile → + → Title: Toggle → Select an Operation → Android → Media Control → Toggle Play/Pause
Event → + → Title: Broadcast → Choose an Event → Android → Receive Broadcast → Action:
Condition → Leave empty
Script → +
- Profile: select Toggle
- Event: select Broadcast
Note: "Toggle Play/Pause" via Easer will hang up a phone call.