'Flic' Bluetooth Button - How to use it as a trigger?

Post your questions and help other users.

Moderator: Martin

Post Reply
nirurin
Posts: 1
Joined: 07 Oct 2016 03:15

'Flic' Bluetooth Button - How to use it as a trigger?

Post by nirurin » 21 Dec 2019 00:22

So the Flic button doesn't seem to have any standard setup with Automagic, but it does with Tasker and a couple other options, however I prefer Automagic (not only because it's free).

I have seen a single online example of Flic being used, so I know it's possible - https://joshuatz.com/posts/2018/flic-au ... pi-button/

However I can't figure out how he's managed to get the ID for the button press... he seems to be using General Broadcast, and has a 'globalFlicintent' ID name in there, but when I go into the general broadcast trigger there isn't an option for that one... and I assume he's found or set up that specific ID somehow?

Flic has 3 different button 'inputs' - single click, double click, long press - which I assume transmits three separate ID's.

I have a vague memory of an automagic guide a while ago where it was possible to set up a ... scan, of some kind, that logs bluetooth action ids, so that you can then input these IDs for use in triggers. Pretty sure it was a guide for smart buttons in general, but I can't find it now...

Hopefully someone on here can help out :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: 'Flic' Bluetooth Button - How to use it as a trigger?

Post by Desmanto » 21 Dec 2019 16:51

From what I see, the button event from the flic hardware is not standard event. So only flic app can catch the button pressed event (you can't use automagic directly, tasker seems need flic app too). This mean you have to keep flic app installed. After flic app get the button event, it will then send the broadcast event 'globalFlicintent', which you can catch from Autoamagic using trigger General Broadcast. Automagic won't have the option, because there is no way it can know the intent. You must fill the intent by yourself. In case you don't know what is the intent broadcast, you can start a logcat (either at PC using adb shell or directly using root command), then filter out the intent

Code: Select all

logcat | fgrep -i intent
I ever try to use something similar, mi key, which you plug into the headset jack. Because it require the mi key to be installed, I just never use it anymore. Since I have ticwatch, I just design everything need to be controlled, to be directly from the wear widget. I can turn on/off my lamp/fan just from my watch. See here : https://forum.xda-developers.com/wear-o ... c-t3956264
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply