How to integrate flic buttons?

I’ve been lucky enough to be testing a linux/raspberry pi integration (finally!) for the flic buttons. Seems to work well, and means I don’t need to rely on a mobile device. Not open source yet but they’re releasing it together with java/python bindings hopefully in the next day or so. Then we can do a proper openHAB integration :slightly_smiling:

1 Like

This would be great! Does this works with a simple USB bluetooth adapter on the Raspberry Pi / linux box?

yep

For those of us with an iPhone, this wasn’t an option as there’s no Tasker. A really easy, reliable, and fast way to integrate the Flic buttons was through the Flic app on the phone and creating an “HTTP request” and then using the following:

http://:8080/CMD?=

HTTP type is type is POST, not GET.

So in my configuration,

http://192.168.1.10:8080/CMD?BedroomLight=ON

And another one for double clicking to make it off. Or just Toggle would be fine too.

Here is the official linux library for flic.

Can’t wait for somebody to create a binding with this. :slight_smile:

There’s a new library now, should be easier to set up: https://github.com/50ButtonsEach/fliclib-linux-hci
Anyone working on integrating this with openHAB?

I started today on working on a OpenHab 2 binding for this library, but I’m very new to the OpenHab development, so it could take some time. But I’ll publish a first draft on GitHub soon. Unfortunately, I doubt that this one could be integrated to the openhab2-addons repository at the moment, because there is a license conflict. The java clientlib by Shortcut Labs is not open source as it must be used only with Shortcut Labs products (see here: https://github.com/50ButtonsEach/fliclib-linux-hci/issues/35). Therefore, it’s not compatible with the required sign-off: https://github.com/openhab/openhab2-addons/blob/master/CONTRIBUTING.md#sign-your-work

Hopefully, they’ll publish the clientlib to a maven repo soon. This would erase the need of including the sources into the addon.

I’m making quite good progress. Currently, flic button clicks already trigger OpenHab debug outputs to the console.

https://github.com/pfink/openhab2-flicbutton (flic java clientlib is required but not included into this repo as the licensing is not 100% clear atm)

reviews, hints and any other help are welcomed. (Please consider that this is a very early state of development - of course there is much that’s not perfect right now)

3 Likes

Pre-Alpha release is now available: https://github.com/pfink/openhab2-flicbutton/releases

1 Like

Very nice. Will have a play this weekend.

Just need to figure out the install process for flicd

1 Like

Anyone have flic button directly working with OpenHab?

I want to build a Raspberry3 implementation so I can connect my flics to the Raspberry instead of my phone and get home automation. I plan to integrate with my current HA setup which is built on SmartThings but I plan to migrate away from the ST hub to a full OpenHab implementation. Flic will be my first OpenHab implementation if I can get it working.

Hi @pfink !

I will also start to play with my flic so I’m very interested in your work.
Did the 0.5 alpha always need the java clientlib to be installed separately ? so we need to install the Flic SDK for Linux before ?

Thnaks you.

The java clientlib is included into the release, but you have to install flicd seperately. All steps that are necessary to get started are described here: https://github.com/pfink/openhab2-flicbutton#full-example

3 Likes

thanks you so much !

Hi all,

I think the binding is on the brink of being released as stable. To all guys who already tested it in their setups: Would be great to get a short feedback about how it’s working for you and if you would describe it as stable, too :slight_smile:

1 Like

Hi, and thank you for working on this!
I have tested your binding and it does work, but I have one problem and it is that events seem to be delayed about 5-20s.
I have not experimented with the ‘latency_mode’ parameter in fliclib-linux-hci (is that relevant?).
Does anyone else experience these delays?
I am running on Ubuntu 16.04, Openhab 2.0 and an Asus BT400 USB dongle. My flic button worked without any delay on the official app.

Do these delays also occur if the buttons are directly located near to the BT adapter?

Actually it was only my log messages during tests that was delayed. Actual real life application (controlling Sonos from the Shower) works great with minimal delay.
I will test this some more and report back my findings here. Right now I have . no idea why logging gets delayed, maybe some kind of buffering?
Thanks again for a great work.
I would like to see this binding bundled with upcoming releases of OpenHAB2.

Further tests suggests that flicd (fliclib-linux-hci) needs to be already running when openhab2 starts, or the things (bridge and button) will be offline.

Yes, the issue with flicd is already solved but not included into the most recent release yet. As soon as the small amount of remaining tasks are completed, I aim to release the stable version of this binding on the IoT Marketplace.

Regarding the delayed logs: I’m not sure about it. All I can tell is that the binding itself does not have a logging buffer, so it probably depends on the OpenHab implementation / configuration.

1 Like