Coder Social home page Coder Social logo

pfink / openhab2-flicbutton Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 1.0 178 KB

openhab2 binding for flicbutton

Home Page: https://community.openhab.org/t/how-to-integrate-flic-buttons/4468/12

License: Eclipse Public License 2.0

Java 100.00%
eclipse-smarthome flic-buttons openhab openhab2-binding

openhab2-flicbutton's People

Contributors

dfrommi avatar pfink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

skuzniarz

openhab2-flicbutton's Issues

Button connection & verification process is currently not supported

It's possible to also add support to scan & verify buttons so that simpleclient is not needed anymore and users don't have to handle with a CLI tool anymore. Maybe even flicd could be somehow integrated to this binding.

As I'm personally not interested in this feature and it's a significant amount of effort to implement it, this is may a feature that could be added by others.

Bad reliability / often changes of ONLINE status

Quote by @dfrommi from PR #1

One more thing I've observed:
I see quite frequent changes of ONLINE / OFFLINE status in the logs. And whenever the button is OFFLINE, events are not processed. However, flicd receives the button presses and correctly forwards events.
The button is set to OFFLINE due to TimedOut connection state. Do you experience the same?
My buttons are of course not next to the Raspberry Pi, but some meters away. And I think that's the reason for the time-out.
I'm currently running a version that doesn't set the button to OFFLINE when the disconnection reason is TimedOut. And that is working really well.

openhab2-flicbutton broken on openhab2 2.5.0 M6

I am using the flic button with openhab2 installation running on Rapsberry PI.
It has been running fine on openhab2 M5, M4 and probably M3 (cant recall exactly when I installed the flic button).
Anyways upgraded the rpi couple of days ago and now the openhab2-flicbutton module does not initialize:

2019-12-04 22:37:45.007 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.flicbutton.handler.FlicDaemonBridgeHandler@257015': bundleContext java.lang.NoSuchFieldError: bundleContext at org.openhab.binding.flicbutton.handler.FlicDaemonBridgeHandler.initButtonDiscoveryService(FlicDaemonBridgeHandler.java:87) ~[?:?] at org.openhab.binding.flicbutton.handler.FlicDaemonBridgeHandler.initialize(FlicDaemonBridgeHandler.java:70) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?] at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] 2019-12-04 22:37:45.083 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'flicbutton:flicd-bridge:vinaminni': bundleContext java.lang.NoSuchFieldError: bundleContext at org.openhab.binding.flicbutton.handler.FlicDaemonBridgeHandler.initButtonDiscoveryService(FlicDaemonBridgeHandler.java:87) ~[?:?] at org.openhab.binding.flicbutton.handler.FlicDaemonBridgeHandler.initialize(FlicDaemonBridgeHandler.java:70) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?] at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

Initial button status is always ONLINE, even if button is disconnected

Necessary steps to "cleanly" resolve this:

  • EventListeners should be on button level and not on bridge level. They could be added within the initialize() method of FlicButtonHandler for each button seperately and then will directly get a response of the connection status via the onCreateConnectionChannelResponse method of the event listener
  • This would cause, that initially no EventListeners are subscribed and no buttons would be discovered anymore
  • Therefore the discovery service should subscribe a listener for each verified button once (within the scan method) to discover connected buttons. After scan is over, the listeners should be removed.

Add battery level channel

Since fliclib-linux-hci 0.5, obtaining battery status is possible. This could be offered as an additional channel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.