How to integrate flic buttons?

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

I just released version 0.9.0 Beta on GitHub which I also submitted for the IoT marketplace. This will make it possible to install the binding directly from Paper UI as of OpenHab 2.1 (IoT marketplace is not supported in OpenHab 2.0).

Basically, there is still one minor issue with displaying the online status why this release is not stable already. I’m not sure if I’m able to fix this within the next months as it’s a little bit more complex than I expected, but in terms of functionality the binding is working very reliable and stable.

So thanks to all testers and have fun using the binding.

Cheers,
Patrick

3 Likes

Hi Patrick, thanks for your work!

I’d really like to get the flic buttons working - should help with the wife acceptance factor immensely.

I have flicd up and recognizing the button, the thing online in openhab2. Perhaps this is a newbie question, but how to I create an item bound to the thing?.

Thanks again,
Jeff

Hello, Patrick,

thanks for your addon.
Unfortunately, I can’t get it to work.
I am using the current snapshot build (openHAB 2.2.0 Build #1082)
and get the following exception when starting the addon:

2017-11-19 11:06:18.313 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share openhab2/addons/org.openhab.binding.flicbutton-0.9.0.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.flicbutton [10]
  Unresolved requirement: Import-Package: com.google.common.collect

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312) [8:org.apache.felix.fileinstall:3.6.0]
2017-11-19 11:06:21.365 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.flicbutton-0.9.0.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.flicbutton [10]
  Unresolved requirement: Import-Package: com.google.common.collect

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361) [8:org.apache.felix.fileinstall:3.6.0]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312) [8:org.apache.felix.fileinstall:3.6.0]

Can you give me a tip on what I’m doing wrong?

(The version from the iot marketplace cannot be installed too)

thank you

Hi Andy,
sorry for the late response. I could reproduce your exception after updating to 2.2.0, but it also occured on two other manually installed bindings (heos, connectsdk). After restarting openHAB the exception did not occur anymore and the binding is working fine. Anyway, what did not work at all is the marketplace installation. The event.log shows:

market:binding-3399284: Binding cannot be installed: Error reading bundle content.

@Kai: Do you have an idea how to fix this? Regarding the exception from Andy: Probably Karaf is not installing all artifacts in the correct order, but how to fix it? Secondly, how can I have a more detailed error message from the failing Eclipse Marketplace installation?

This might actually be addressed in the 2.2.0 release. Would be worth a try to re-test it on the release version.

Yes, I tested it on the release version and also got this exception even though it disappeared after restart of openHAB. For me the more severe issue is that the marketplace installation does not work :frowning:

OK, the exceptions are reproducible by deleting the cache and restarting openHAB.

Yes, very simple. Your marketplace entry points to

    https://github.com/pfink/openhab2-flicbutton/releases/download/0.9/org.openhab.binding.flicbutton-0.9.0.jar

for the binary. If you try that yourself, you will notice that it results in a 404.

If you’d change it to

    https://github.com/pfink/openhab2-flicbutton/releases/download/0.9.0/org.openhab.binding.flicbutton-0.9.0.jar

instead, it should all work nicely :sunglasses:.
I have added some debug logging to more easily analyse such problems in future.

1 Like

Aahh, thank you!! Probably because I corrected the tag name and forgot to adjust this URL as well :sweat_smile: Fixed!

Hi! I need some help with the binding please.

I’m using 2.2.0 release and installed Flic binding from the market.
I got Flic button connected and working fine with the ‘pressed-switch’ channel.

Unfortunately I cannot get two other channels to work ‘rawbutton’ and ‘button’.

I have also noticed two strange things:

  1. The ‘button’ channel is grey-colored.
  2. When I enable ‘rawbutton’ channel in PaperUI, OH asks to select item to Link. What item should I link it with?


Could you please advise what am I doing wrong?

This is my .rules file:

rule 'Button rule using an item bound to the pressed-switch channel'
when
	Item flicbutton_button_70f06b05_80_e4_da_70_0b_2b_pressed_switch changed from ON to OFF
then
	if (isy_scene_44c96b77_899_onoff.state != ON)
        isy_scene_44c96b77_899_onoff.sendCommand(ON)
    else
        isy_scene_44c96b77_899_onoff.sendCommand(OFF)		
end

rule "Button rule using the button channel"
when
    Channel flicbutton_button_70f06b05_80_e4_da_70_0b_2b_button triggered SHORT_PRESSED
then
    if (isy_scene_44c96b77_13024_onoff.state != ON)
        isy_scene_44c96b77_13024_onoff.sendCommand(ON)
    else
        isy_scene_44c96b77_13024_onoff.sendCommand(OFF)
end

rule "Button rule directly using the rawbutton channel"
when
    Channel flicbutton_button_70f06b05_80_e4_da_70_0b_2b_rawbutton triggered
then
    logInfo("Flic", "Flic pressed: " + receivedEvent.event)
end

Thanks!

Just got the ‘button’ channel to work by replacing in my .rules file:

old:
Channel flicbutton_button_70f06b05_80_e4_da_70_0b_2b_button triggered SHORT_PRESSED

new:
Channel “flicbutton:button:70f06b05:80-e4-da-70-0b-2b:button” triggered SHORT_PRESSED

Thanks!

1 Like

I’m a Little confused by all the different versions of these buttons

I need a button that you press and it tells OH to run a rule simple RIGHT, so what version of the button would I need or would any work, I’m also a little confused with the needing a mobile phone can you just connect them to openhab directly now using the Bluetooth binding

What do you mean with “all the different versions of these buttons”? There is just one version.

The binding introduced within this thread does not involve a mobile phone, you connect the buttons to a Linux computer that runs fliclib-linux-hci.

When searching for the buttons at a store it listed many options lights, music ect

http://www.argos.co.uk/search/flic/