How to integrate flic buttons?

I just received my http://flic.io buttons and want to integrate them via Tasker (Android) into openHAB.

My approach is to define a push button for each flic action (click, double click, hold) and trigger these via a http request from Tasker on my tablet.

items:

Switch		Flic01click		"Flic01 Click"			<flic>		(gFlic01)	{ autoupdate="false"}
Switch		Flic01double	"Flic01 Double Click"	<flic>		(gFlic01)	{ autoupdate="false"}
Switch		Flic01hold		"Flic01 Hold"			<flic>		(gFlic01)	{ autoupdate="false"}

rules:

rule "Flic01 Click"
	when 
		Item Flic01click received update
	then
		logInfo("Flic", "Flick01 Click")
end

I also tried “changed to ON

sitemap:

sitemap flic label="Flic"
{	
	Frame label="Flic01" {
		Switch		item=Flic01click
	}
}

evets.log
> 2015-11-23 23:46:05 - Flic01click received command ON

Unfortunatelly the rule does not get executed when I set “autoupdate=false”.
I think it’s too late for me to think straight.
What am I missing?
Is there a better way to integrate the devices?

btw: There might be a linux library in the works. +1:

1 Like

Try changing your rule trigger to received command. Setting autoupdate=false means the openHAB item will never receive an update, only command events.

Thanks.

It works great! :slight_smile:

Can’t wait for the full API from shortcut labs or someone to reverse engineer a binding, mine are in the post and would be good if they worked without a phone

1 Like

I just created a quick guide for connecting Flic via Tasker.

2 Likes

Thought you might be interested - there’s now a Flic user group on Facebook, with several Flic employees in attendance
https://www.facebook.com/groups/FlicUserGroup/910210239034313/

1 Like

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 !