openHAB 2.2 binding

  • ok, it works after updating to snapshot 2.3
    btw: 2.3 requeres esh-io-transport-mqtt
    Intallation in karaf console:
    feature:install esh-io-transport-mqtt

  • Hero Member

    @seeers yes, I've located a bug in the expert mode an fixed it recently!

  • Hardware Contributor

    @TimO I saw that you fixed some other bugs too in the repo. Will you create a new version 2.3 of the binding soon? Or will there be more changes first?
    As most of the changes (at least also) concern RGBW lighting I would really like to use it but I can't seem to build the binding locally (I postet the error in the git pr).

  • @jocke4u, I really want my power node to work so I was going to try to make my own rule based on the "expert" strategy and the 999 node/child.

    But first I tried an even simpler approach, I added a var1-item from the power thing and now I have communication between node and gateway. Please give it a try yourself and see if it works for you.

    More specifically I defined the following item:
    Number PulseVar "Var1 [%d]" { channel="mysensors:power:gateway:pulseThing:var1" }

    Be sure to also persist the item. I store it in a mapdb dataset:
    PulseVar : strategy = everyChange, restoreOnStartup

    FYI, my thing is defined as follows:
    power pulseThing [ nodeId=50, childId=1 ]

    Please give it a try and come back with the outcome.

    EDIT: this feels like a too simple fix, I suspect that @TimO has made some changes in the 2.3 snapshot...

  • Hi there!

    Maybe someone would like to help me a bit?

    I'm on openHAB 2.2 with mysensors binding I'm using a serial gateway that I reflashed today using MySensors 2.2.0 library. I have turned off debugging in the sketch.

    The problem is that I encounter an exception each time OH starts up.

    2018-02-11 11:05:59.342 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection Underlying input stream returned zero bytes
            at sun.nio.cs.StreamDecoder.readBytes( [?:?]
            at sun.nio.cs.StreamDecoder.implRead( [?:?]
            at [?:?]
            at [?:?]
            at [?:?]
            at [?:?]
            at [?:?]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$ [255:org.openhab.binding.mysensors:]
            at java.util.concurrent.Executors$ [?:?]
            at [?:?]
            at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
            at java.util.concurrent.ThreadPoolExecutor$ [?:?]
            at [?:?]

    Thing config:

    Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/ttyUSBmys", baudRate=115200, sendDelay=200, startupCheckEnabled=false ]

    Everything seems to work otherwise. The problem is that the warning draws my attention every time and of course I need to check if it's something serious that I'd need to act upon. I'd rather see that I get no exceptions/warnings in case the "problem" can be ignored.

    My question to you guys is if there is anything that I can do about it? Thanks for your kind help.


  • Hardware Contributor

    @TimO I finally got around to testing my pureWhite RGBW code and at least for me its working like it should be. I saw you already merged this so I guess others can use it too very soon.
    What is still not working is the acknowledgment feature. I have one node that only gets about 90% of the messages without error, so I tried activating it there and on some other nodes too for testing. Result: success rate is down to ~50% for each node and I get messages about some acknowledgment on the console when no message has even been sent (nothing about a message from mysensors on the console and no rx/tx leds on the gateway). When I tested this some months ago I also saw no message at the client so I am pretty sure none gets send.
    So I guess this issue is still unresolved 😉 I have no clue why on a first glance but if I can help just send me a message.

  • Hello, I try to start using OpenHab as a controller and
    need some help, regarding mysensors binding 2.3.0. I get the bindings installed, but in bundle:list it's just installed and i don't get it Active.

    All other instruction for installation are done.
    Did feature:install openhab-transport-serial and feature:install esh-io-transport-mqtt and and "nrjavaserial" is Active.

    But mysensor binding just installed. How can I get it ACTIVE?

    Thank you for your help.

  • Hardware Contributor

    Do you still have an older version of Mysensors installed? Thats the only time I had such behaviour

  • Hello,

    I've been using the binding for a while now!
    must say that i still have some problems with auto discovery, but manually adding the sensors work fine!

    I encountered a bug in 1 for the components.

    The GAS meter should contain a variable for V_VOLUME but in the logs i'm getting errors that the variable does not exist.

    i searched in the code and found out the the class for SGAS is not containing the V_VOLUME variable.
    github link:

    as by: SGAS should also include a V_VOLUME variable as wel as a V_FLOW

    For now i adjusted my sensor to use one of the custom var fields. but it would be nice to use the V_VOLUME variable for this.

  • I have a general question that I can't seem to find an answer to either here, in the openhab docs, or anywhere googling between the two.

    On a Raspberry Pi 3 running openhabian 1.4 (stretch 9.4)
    running openhab 2.2
    Mosquitto 1.4.10
    mysgw 2.2.0 (MQTT)

    And an arduino pro mini 3.3v test sensor node running the door/button sketch at version 2.2.0 also.

    The sensor node can communicate over rf24 just fine and the broker receives and sends messages to it without issue.

    My question is this: Does this openhab 2.2 mysensors binding replace or work in concert with the original openhab 2.2 PaperUI-installed MQTT binding? And same for the MySensors MQTT Gateway that's part of the Mysensors binding and mysgw?

    I ask because when I follow the installation instructions from the github wiki and start everything up, I get a persistence in use error in And it appears that my original broker is running fine, which suggests I'm trying to run two brokers and they're uninterested in cooperating.

    The installation instructions I've seen (a couple places) say to use mqtt.cfg and org.eclipse.smarthome.mqtt.cfg with the same settings.

    Hoping the answer is a simple, "stop mysgw and just run the paperUI MQTT Gateway" or the like.


  • @fixjunk replying to myself...

    seems like installing esh-io-transport-mqtt in karaf causes the broker problem.
    without it installed the logs show:

    2018-04-16 16:28:35.914 [ERROR] [org.openhab.binding.mysensors       ] - FrameworkEvent ERROR - org.openhab.binding.mysensors
    org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [210]
      Unresolved requirement: Import-Package:
    	at org.eclipse.osgi.container.Module.start( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager$ [?:?]
    2018-04-16 16:28:36.870 [INFO ] [] - MQTT Service initialization completed.
    2018-04-16 16:28:36.885 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'habianbroker'

    But then after feature:install esh-io-transport-mqtt I get this:

    2018-04-16 16:30:13.506 [INFO ] [] - Stopping broker connection 'habianbroker'
    2018-04-16 16:30:14.135 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection 'habianbroker' to 'tcp://<MY.IP.GOES.HERE>:1883' with clientid mysensors and file store '/var/lib/openhab2/tmp/habianbroker'
    2018-04-16 16:30:14.208 [WARN ] [] - MqttBroker start failed: Persistence already in use Persistence already in use
    	at []
    	at []
    	at []
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:?]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
    	at java.lang.reflect.Method.invoke( ~[?:?]
    	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod.access$500( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod.invoke( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService( [42:org.apache.felix.scr:2.0.12]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$ [?:?]
    	at Method) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService( [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService( [?:?]
    	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService( [15:com.eclipsesource.jaxrs.publisher:]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding( [?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding( [?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding( [?:?]
    	at org.osgi.util.tracker.AbstractTracked.track( [?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged( [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register( [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService( [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService( [?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator.loadComponents( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator.access$200( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator$ScrExtension.start( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.createExtension( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle( [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.addingBundle( [42:org.apache.felix.scr:2.0.12]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding( [?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding( [?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding( [?:?]
    	at org.osgi.util.tracker.AbstractTracked.track( [?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged( [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous( [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged( [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent( [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent( [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent( [?:?]
    	at org.eclipse.osgi.container.Module.publishEvent( [?:?]
    	at org.eclipse.osgi.container.Module.start( [?:?]
    	at org.eclipse.osgi.framework.util.SecureAction.start( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.start( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.applyDelta( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.resolveAndApply( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.resolve( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.refresh( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent( [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent( [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager$ [?:?]
    Caused by: org.eclipse.paho.client.mqttv3.MqttPersistenceException: Persistence already in use
    	at ~[?:?]
    	at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>( ~[?:?]
    	at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>( ~[?:?]
    	at ~[?:?]
    	... 79 more
    2018-04-16 16:30:14.330 [INFO ] [] - MQTT Service initialization completed.
    2018-04-16 16:30:14.335 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'habianbroker'

    It looks like the openhab broker and the eclipse brokers are conflicting?

Log in to reply





Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.