openHAB 2.2 binding


  • Hero Member

    Hey @Feji !

    When did that message appear. Could you please post the log before and after the warn message ocurres?



  • Hi,

    this is the entire log.

    16:34:26.529 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244336630 TSF:MSG:READ,102-102-0,s=1,c=3,t=16,pt=0,l=0,sg=1:
    16:34:26.532 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244336655 TSF:MSG:SEND,0-0-102-102,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:C847F69309390B8321591E8A0177300C610B45574986153FB7
    16:34:26.535 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244336736 TSF:MSG:READ,102-102-0,s=1,c=1,t=18,pt=7,l=5,sg=1:54312.0080
    16:34:26.559 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 102;1;1;0;18;54312.0080
    16:34:26.569 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 102 found in gateway
    16:34:26.577 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 1 found in node 102
    16:34:26.591 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_KWH not present
    16:34:46.457 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244356571 TSF:MSG:READ,102-102-0,s=1,c=3,t=16,pt=0,l=0,sg=1:
    16:34:46.484 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244356594 TSF:MSG:SEND,0-0-102-102,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:894CE25CF528B67D1DEE9B37F9CFC352C330BE7EB1E10F5E74
    16:34:46.558 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;244356675 TSF:MSG:READ,102-102-0,s=1,c=1,t=17,pt=5,l=4,sg=1:195
    16:34:46.641 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 102;1;1;0;17;195
    16:34:46.646 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 102 found in gateway
    16:34:46.651 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 1 found in node 102
    16:34:46.655 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_WATT not present
    


  • @Feji
    I found it, the "Revert State" option was activated for this node. Now it's working as expected.
    The log message might be more "explicit".


  • Admin

    @TimO

    Trying openhab2 out.. Fresh install, with both serial and mysensors binding installed.

    I'm using socat to make a virtual comport to node-red

    In the openhab logs I see a lot of errors like

    15:04:07.252 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2;
    15:04:07.379 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    15:04:07.680 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    

    I can see that the gateway indeed does answer to the 0;0;3;0;2 request, and the reply is also send on to openhab2.

    I have tried to disable startup checks, but I get ERROR 409: conflict as a toast message in the lower right corner of paperui when I try to save settings.

    Anything I have missed somewhere?



  • @TimO
    I'm new to MySensors and openHAB and this might be vary basic questions.
    As I only have start with a small system with openHAB on an RPi3, a serial gateway and 2 nodes so the update to openHAB 2.2 binding will probably not be a big deal.
    In the explanation of the changes, you write "The current release is not backwards compatible" and "I hope this won't happen again in further versions!". Does this mean that a new version is backward compatible with e.g. V2.1.0 or that I in anyway must do the reconfigurations now but don't have to do it again?
    I have configured my things in Paper UI and have to delete them but do I have to clean the *.items file and *.sitemap file? Further down in the "topic" you have a link to "https://github.com/tobof/openhab2-addons/issues/86" with a link to a new version of the binding and I wonder if this is the one I'm going to use?



  • @MagnusF
    This version of the binding is for thus want to use two or more serial connection with openhab.
    Before delete all your things configured in PaperUI, you should consider to dedit the org.eclipse.smarthome.core.thing.Thing.json database in /userdata/jsondb/ and delete the " " around the nodeId and childId. Before editing this file, you must stop your openhab.



  • @Feji
    Thanks for your replay! But unfortunately, that was not an answer to my thoughts.

    1. You say "This version..." Do you mean to use two "MySensors Serial Gateways" connected to one controller with OpenHAB?
      Does this mean that if I connect one more "MySensor Serial Gateway" to my controller that I will have one more "MySensor Serial Gateway" thing but with another bridge definition?
    2. In the file "org.eclipse.smarthome.core.thing.Thing.json" there are no things defined with i.e. nodeid="1" and childid="2" it looks like this
      "mysensors:temperature:709db93f:temperature_2_1" i.e. nodeid 2 childid 1. Do I look in the wrong file?

  • Hardware Contributor

    After I fixed the initial errors with the help from this thread I am now trying to use my RGBW nodes with openhab. I have had several issues with that though:

    • If I add the item via the paperUI:
      • On/Off (status) works just fine
      • Setting a color at full saturation/brightness works well too
      • I am not sure if that is intended but I want to use only the white leds on the RGBW strip sometimes. Mixed white values just look very bad. I can't seem to be able to do this with openhab. Settings the saturation slider to 0 sends ffffffff and sometimes just 00000000. Is there any way to just send 000000ff? Domoticz does this automatically when setting the color to white and home assistant has a seperate white slider that should allow the same thing
      • When trying to change the brightness the node only receives a new color value of length null (no dimmer message) and I get the following error message in the openhab log:
    
    21:51:17.801 [ERROR] [nternal.event.MySensorsEventRegister] - Event broadcasting throw an exception
    java.lang.StringIndexOutOfBoundsException: String index out of range: 2
            at java.lang.String.substring(String.java:1963)[:1.8.0_131]
            at org.openhab.binding.mysensors.converter.MySensorsRGBWTypeConverter.fromString(MySensorsRGBWTypeConverter.java:27)
            at org.openhab.binding.mysensors.converter.MySensorsTypeConverter.stateFromChannel(MySensorsTypeConverter.java:33)
            at org.openhab.binding.mysensors.handler.MySensorsThingHandler.handleChildUpdateEvent(MySensorsThingHandler.java:275)
            at org.openhab.binding.mysensors.handler.MySensorsThingHandler.sensorUpdateEvent(MySensorsThingHandler.java:198)
            at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.lambda$4(MySensorsEventRegister.java:129)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.lang.Iterable.forEach(Iterable.java:75)[:1.8.0_131]
            at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.notifyNodeUpdateEvent(MySensorsEventRegister.java:125)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.handleSetReqMessage(MySensorsGateway.java:566)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.handleIncomingMessage(MySensorsGateway.java:461)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.messageReceived(MySensorsGateway.java:372)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.lambda$1(MySensorsEventRegister.java:85)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.lang.Iterable.forEach(Iterable.java:75)[:1.8.0_131]
            at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.notifyMessageReceived(MySensorsEventRegister.java:81)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:365)[190:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
            at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
    

    I had no success at all trying to define the things via the things file. I described my setup and the problem here. (Short version: definition via node id doesn't seem to work for me and I have no idea what items/sitemaps to use to control the rgbw nodes).
    Any help would be great (@TimO )


  • Hero Member

    @tbowmo

    1. How are socat and node-red linked? Please post the full socat command. I'm using socat -d -d pty,raw,echo=0 pty,raw,echo=0 to fake a serial port to test the binding.

    2. Does the binding recover after the exception is thrown. If message is received that is not expected (0 size length, wrong format etc) an exception is thrown, but the next message that is received should work just fine. The binding should recover from "wrong" message.

    3. Is DEBUG enabled? --> log:set DEBUG org.openhab.binding.mysensors

    4. I've not yet seen the ERROR 409: conflict toast message. Are there any hints in the log what is going on there? Maybe there are exceptions at startup of openhab2?


  • Hero Member

    @MagnusF said in openHAB 2.2 binding:

    You say "This version..." Do you mean to use two "MySensors Serial Gateways" connected to one controller with OpenHAB?
    Does this mean that if I connect one more "MySensor Serial Gateway" to my controller that I will have one more "MySensor Serial Gateway" thing but with another bridge definition?

    This special version is only needed, if you're using another binding that also uses a serial device (RFXCOM, zwave, ebus ...). Two serial gateways with the MySensors binding work just fine. And yes, you are able to use more than one bridge/gateway. (I'm using: 1x RF24 Ethernet, 1x RFM69 Ethernet, 1x Serial gateway)

    In the file "org.eclipse.smarthome.core.thing.Thing.json" there are no things defined with i.e. nodeid="1" and childid="2" it looks like this
    "mysensors:temperature:709db93f:temperature_2_1" i.e. nodeid 2 childid 1. Do I look in the wrong file?

    If you have used an older version of the MySensors binding and have configured the things via PaperUI the old configuration won't work with the new releases of the binding. The old configuration still works with the old binding (2.1). The safest way to switch to the new binding / configuration is to delete the old items and discover them again. It should be possible to migrate the jsondb file, but I've not done this before, so I can't help you there.


  • Admin

    @TimO

    The ERROR 409 was because I had defined the binding in a things file, and then tried to use paper ui to add sensors, apparently that is not allowed..

    I use

    socat PTY,link=/dev/ttyS81,mode=666,group=dialout,raw PTY,link=/dev/ttyUSB21,mode=666,group=dialout,raw
    

    To start socat up, nodered is listening on ttyS81, and openhab is on ttyUSB21.

    I have now deleted the things file, and configured the gateway through paperui, I have disabled startup check so the gateway seems to be online.

    If I do a cat /dev/ttyUSB21 I get the data from the gateway, so node-red is passing on the data without problems.

    But openhab still spews out errors in the log every other second or so:

    21:13:46.531 [DEBUG] [col.serial.MySensorsSerialConnection] - Request disconnection flag setted to: true
    21:13:48.097 [INFO ] [col.serial.MySensorsSerialConnection] - Connection request disconnection...
    21:13:48.097 [DEBUG] [col.serial.MySensorsSerialConnection] - Request disconnection flag setted to: false
    21:13:48.098 [DEBUG] [col.serial.MySensorsSerialConnection] - Shutting down serial connection!
    21:13:48.098 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Stopping Writer thread
    21:13:48.099 [WARN ] [rsAbstractConnection$MySensorsWriter] - Interrupted MySensorsWriter
    21:13:48.099 [DEBUG] [rsAbstractConnection$MySensorsReader] - Stopping Reader thread
    21:13:48.099 [WARN ] [rsAbstractConnection$MySensorsReader] - Interrupted MySensorsReader
    21:13:48.143 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to OFFLINE for device: mysensors:humidity:9f16ca21
    21:13:48.145 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to OFFLINE for device: mysensors:humidity:8124dc86
    21:13:48.146 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [9,10]
    21:13:48.146 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to OFFLINE for device: mysensors:temperature:6b7baead
    21:13:48.146 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:9f16ca21' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)
    21:13:48.151 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:temperature:6b7baead' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)
    21:13:48.152 [DEBUG] [col.serial.MySensorsSerialConnection] - Connecting to /dev/ttyUSB21 [baudRate:115200]
    21:13:48.157 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:8124dc86' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)
    21:13:48.157 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:temperature:6b7baead' changed from OFFLINE (BRIDGE_OFFLINE) to OFFLINE
    21:13:48.160 [DEBUG] [col.serial.MySensorsSerialConnection] - Successfully connected to serial port.
    21:13:48.163 [DEBUG] [col.serial.MySensorsSerialConnection] - Waiting 3 seconds to allow correct reset trigger on serial connection opening
    21:13:48.166 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:8124dc86' changed from OFFLINE (BRIDGE_OFFLINE) to OFFLINE
    21:13:48.167 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:bridge-ser:53441a70' changed from ONLINE to OFFLINE
    21:13:48.173 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:temperature:6b7baead' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (BRIDGE_OFFLINE)
    21:13:48.174 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:9f16ca21' changed from OFFLINE (BRIDGE_OFFLINE) to OFFLINE
    21:13:48.178 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:8124dc86' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (BRIDGE_OFFLINE)
    21:13:48.182 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:9f16ca21' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (BRIDGE_OFFLINE)
    21:13:51.166 [WARN ] [col.serial.MySensorsSerialConnection] - Skipping I_VERSION connection test, not recommended...
    21:13:51.169 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to ONLINE for device: mysensors:humidity:9f16ca21
    21:13:51.174 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [9,10]
    21:13:51.174 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to ONLINE for device: mysensors:humidity:8124dc86
    21:13:51.175 [DEBUG] [ensors.handler.MySensorsThingHandler] - MySensors Bridge Status updated to ONLINE for device: mysensors:temperature:6b7baead
    21:13:51.186 [DEBUG] [ensors.handler.MySensorsThingHandler] - Event listener for node 10-0 not registered yet, registering...
    21:13:51.190 [DEBUG] [ensors.handler.MySensorsThingHandler] - Event listener for node 9-1 not registered yet, registering...
    21:13:51.185 [DEBUG] [ensors.handler.MySensorsThingHandler] - Event listener for node 10-1 not registered yet, registering...
    21:13:51.175 [INFO ] [col.serial.MySensorsSerialConnection] - Successfully connected to MySensors Bridge.
    21:13:51.195 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:bridge-ser:53441a70' changed from OFFLINE to ONLINE
    21:13:51.199 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:9f16ca21' changed from OFFLINE to ONLINE
    21:13:51.202 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:temperature:6b7baead' changed from OFFLINE to ONLINE
    21:13:51.203 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mysensors:humidity:8124dc86' changed from OFFLINE to ONLINE
    21:13:51.275 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    21:13:52.229 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    21:13:52.552 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    21:13:54.392 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    21:13:56.816 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    21:13:57.963 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
    	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0]
    	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0]
    	at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0]
    	at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0]
    	at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0]
    	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[186:org.openhab.binding.mysensors:2.2.0.201707241115]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0]
    	at java.lang.Thread.run(Thread.java:744)[:1.8.0]
    

  • Admin

    @TimO

    Found my issue after digging through both openhab and nodered..

    I had forgotten to add /n to data sent out on the virtual serial port towards openhab. As soon as I added that, then everything was working..

    Now, I just have to grasp the concept in openhab, which might take some time.



  • @philro I have the same issue on the 2.2 binding: when the esp8266 based ethernet gateway is restartet, only restarting the Openhab service to appears to restore communication between openhab and the gateway


  • Hardware Contributor

    Ok small update to my post above: I can add an RGBW node via the paperUI and then control it via items defined in the items file.
    But why does the same thing not work for things defined via the things file? Is something wrong with:

    Bridge mysensors:bridge-ser:gwSerial [ serialPort="/dev/ttyUSB0", sendDelay=100 ] {
    
        /** Lights */
        rgbwLight 		LichtKuecheUnten	[nodeID=4, childId=1, requestAck=true]
        //...
    }
    

    The thing created by the paperui is called

    mysensors:rgbwLight:gwSerial:rgbwlight_4_1:status / rgbw / ....
    

    so my settings are correct.

    Also is there a way to control the white part of the light? I have a colorpicker for that item linked to the rgbw channel but this seem to only change the color and brightness, ignoring the white part of the RGBW.

    PS I also sometimes get an acknowledgment message when no actual messages from/to the gateway and node are in the logs and the node doesn't react at all. Any idea how that can happen? It seems to mainly happen when switch very fast but I am not 100% sure about that.

    19:47:18.881 [INFO ] [rsAbstractConnection$MySensorsWriter] - ACK received for message: 4;1;1;1;2;1
    

    Should I report these error in a github issue?


  • Hero Member

    @philro and @syren : to get this straight: The sanity check is enabled but it won't send messages to the gateway after the connection is lost? The monitoring of the connection in the binding is very top-level, so it may happen, that a connection is lost and there is no information about that. But the sanity check needs to fail in that case and should try a reconnect.
    What are your exact parameters for the bridge/gateway?


  • Hardware Contributor

    I just reported some of my issues in the github repo. There might still be some errors there.
    I'll try to help solving them as best as I can as @TimO 's work with the integration into openhab 2 seems pretty awesome too me 👍
    I am trying to switch to openhab anyways and am not that bad at developing in java. Perhaps I can be of some help there.

    Here are the gitHub issues
    Dimmer not working
    Things definition not working


  • Hero Member

    @LastSamurai Thank you for your kind words and I'm very glad if you could help here. The RGBW implementation is the most advanced and I've no RGBW sensor myself to test it.

    I've commented your issue reports!


  • Hardware Contributor

    @TimO Thank you! You already solved one of my problems. I'll try to also look into the dimming problem although I first need to understand the openhab structure.

    I just added another issue in github as sometimes my nodes don't seem to update.

    Also I really want to be able to only activate the white part of the node when needed (as mixed white just looks bad, afterall thats why you use RGBW leds). I can change the level of the white leds via my openhab android app but I have found no way to set the leds to 00 00 00 FF. The RGB part always stays on. Should I add another gitHub issue for this or is there just some other kind of control I need to use?



  • @TimO Sorry for the delay
    the Problem is that the sanity-check didn't recognize if the Gateway is offline.
    My Settings are quite standard. I took a screenshot of my Settings and from the openhab Things page. At the Moment where the screenshot was taken, the Gateway are powered off till 24 hours.
    So, no Sensor or Gateway could be online
    1_1502722845032_thing-page.png 0_1502722845031_gw-config.png

    After i powered the Gateway on again, nothing happens in openHAB. I need to restart openHAB and all starts working again.

    Greets Phil



  • I have the same problem as @philro describe. I run a new topic here https://forum.mysensors.org/topic/7346/openhab-don-t-want-to-reconnect-after-gateway-restart . When I disconnect and than connect again or restart gateway everything seems to be Online but I can't take no action with actuators and don't receive any information from nodes. Also in log of OpenHab and gateway debug I can't see any "sanity check" behavior.



  • There are some new issues, OpenHab disconnect form gateway by it self, and did not reconnect. It was in the middle of the night when only temperature sensors sending data sometimes when temperature change.. After I restart openhab2 service all starts to work normal..



  • Ok, I've found that sanity check starting when you configure your thing through .thing file not from PaperUI. The sanity checker runs but when I disconnect and connect gateway sanity check send message to gateway and return that gateway isn't connected and start counting retries to disconnecting. That repeats until I restart OpenHab..


  • Hero Member

    @nofox It's definatly not working the way it should work. It also should not make any difference if the configuration comes from PaperUI or from a .thing file. It is not possible to differentiate between those configuration modes within the binding.

    My gateways are using static IPs, so I need to find a way to reproduce this behaviour. 🙂



  • @TimO, i could reproduce this problem if i power down the gateway for some Minutes



  • @TimO I confirm, I could reproduce that simply by resetting gateway or disconnect it from the network for a second. My gateway and controller are also on static IPs.



  • I don't know if it would help but openhab reconnects with the gateway when I change something in .things file and save it. Binding reloads and all starts to comunicate again.



  • @philro @nofox
    We are discussing this issue on GitHub. Probably we have found the problem and a possible, temporary, solution. If you can try it it would be useful, thanks! 😊


  • Hardware Contributor

    I have added 2 more issues in github. Most importantly there seems to be an issue with ACK right now. So if you have enabled acknowledgment on one of your things and sometimes see no reactions from your leds (or whatever you are using) try disabling ACK. I helped in my case.



  • Hello,
    Not sure if it is related to the above mentioned ACK issue... I have some distanced actuators, and was heavily relying on the repeated message send if no ACK. I habe the impression with this upgrade, it does not work as before. Can it be the case?


  • Hardware Contributor

    @krejcarek I haven't heard anything from @TimO recently but have you tried it without ACK enabled? In my case the rate of success increased visibly. There are still some cases where the message doesn't get send successfully though, so I am still waiting for the working ACK feature 😉


  • Hero Member

    @LastSamurai I haven't found the time to look at the issues lately, I'm sorry. 😕
    I'm on vacation for the next 10 days and will continue my work after after that. 🙂



  • @TimO enjoy your holidays 😉



  • Hi TimO, I am interested in Mqtt version of binding as I like the flexibility of my system with Mqtt. I see that Sean has already a PR open for this quite some time and I do not see any reason why his changes would break things. Any idea when can we expect this to be merged. Also I have just started getting involved in things and although don't have much time but will try to contribute around this area.


  • Hero Member

    Hi @gahlawathome !

    The code for the MQTT support is only working within the development environment. If I try to compile a jar, there is a dependency problem which I was not yet able to solve. There is MQTT support in ESH and in OpenHAB. The MQTT binding needs the one from Openhab because it is still based on Openhab 1. The MQTT support in the binding needs to be based on ESH, but you can't fulfill both dependencies because only one library at a time is allowed.

    I need to check if there has been some development on a MQTT 2.x binding, that would solve the problem.



  • @TimO Thank you very much for a very clear explanation. I will also search around MQTT 2.x on OpenHAB and post here if I find something relevant.


  • Hardware Contributor

    @TimO Hope you had a nice vacation!
    Is there already some new version of the binding to test?

    I was on vacation too lately and when I powered my openhab system back on I got lots of problems with my gateway and sensor connections. First I got a never ending circle of failing startup checks (although I could already switch lights). After I disabled the check it seemed to work. But when restarting a sensor node (that did not send any values after the controller restart) I got this error:

    16:55:54.552 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;159004 Skipping security for command 3 type 16
    16:55:54.604 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;159011 TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=OK:
    16:55:54.747 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
            at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0_144]
            at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0_144]
            at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0_144]
            at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0_144]
            at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0_144]
            at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0_144]
            at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0_144]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[205:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
            at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
    

    Any idea why or how to fix this? Everything was working fine before

    PS I also just got another error while switching a light (the light still worked though):

    
    17:08:31.549 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.text.ParseException: class java.text.ParseException : Message length is not > 4
            at org.openhab.binding.mysensors.internal.protocol.message.MySensorsMessage.parse(MySensorsMessage.java:337)[205:org.openhab.binding.mysensors:2.2.0.201707241115]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:345)[205:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
            at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
    17:08:31.678 [WARN ] [rsAbstractConnection$MySensorsReader] - Exception on reading from connection
    java.io.IOException: Underlying input stream returned zero bytes
            at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288)[:1.8.0_144]
            at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)[:1.8.0_144]
            at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)[:1.8.0_144]
            at java.io.InputStreamReader.read(InputStreamReader.java:184)[:1.8.0_144]
            at java.io.BufferedReader.fill(BufferedReader.java:161)[:1.8.0_144]
            at java.io.BufferedReader.readLine(BufferedReader.java:324)[:1.8.0_144]
            at java.io.BufferedReader.readLine(BufferedReader.java:389)[:1.8.0_144]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:335)[205:org.openhab.binding.mysensors:2.2.0.201707241115]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
            at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
    

  • Hardware Contributor

    Ok I reflashed the gateway and it's gotten a little better. Still have some errors though.


  • Hero Member

    Hi @LastSamurai !

    You've debug enabled on the gateway, have you? Looks like the binding does not like the (debug) output from the gateway.
    But the binding should recover just fine from the exception, only the (debug) message that has lead to this exception won't be parsed.


  • Hardware Contributor

    Wow, you are right of course. Debugging is indeed enabled... but than I can just ignore the errors, thank you.
    @TimO said in openHAB 2.2 binding:

    Hi @LastSamurai !

    You've debug enabled on the gateway, have you? Looks like the binding does not like the (debug) output from the gateway.
    But the binding should recover just fine from the exception, only the (debug) message that has lead to this exception won't be parsed.


  • Hardware Contributor

    So I disabled debug output on the gateway to avoid the error messages but I still have problems with my setup. I used to have a motion sensor that worked with openhab. Now when the sensor sends a motion event to the gateway nothing happens in openhab.

    Part of the log of the motion sensor:

    6236 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
    6307 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    6367 TSF:TDI:TSL
    6385 MCO:SLP:WUP=-1
    6406 TSF:TRI:TSB
    6424 MCO:SLP:MS=86400000,SMS=0,I1=1,M1=1,I2=255,M2=255
    6481 TSF:TDI:TSL
    6500 MCO:SLP:WUP=1
    6520 TSF:TRI:TSB
    6541 TSF:MSG:SEND,11-11-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1
    6612 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
    6670 TSF:TDI:TSL
    

    So it seems like the message gets send succesfully but on the openhab log I see no mentioning of that (although I enable debug output for mysensors and I can switch on/off some led nodes). Any ideas why? I really want to get this working again.


  • Hardware Contributor

    Sorry for bothering you guys, I figured out the problem: I have installed domoticz on the same raspberry and after a restart I forgot to turn it off. So all the missing data was "hidden" away by domoticz instead of openhab.


  • Hero Member

    @LastSamurai 😄
    I'm glad you've found the problem, I was out of ideas. 😉


  • Hardware Contributor

    The problem is that the motion sensor still doesn't show up at the gateway although it gets an answer from it. I disabled domoticz though so I need to find another reason ;( Earlier it showed up in domoticz ... strange. I will try to change the id and see if OH picks it up then.
    Btw @TimO Any idea yet when you will be able to work on the github issues I posted?



  • Hi @TimO and @andreacioni.
    Back in the day link we discussed about request type of messages being supported by the binding and the complex scenario it created.
    Are there any plans to continue developing this feature?


  • Hero Member

    @LastSamurai I can't say when I'm able to solve those issues.

    According the ACK problem I need to enable ACK support in my network at home, which was something I already wanted to do a long time ago but haven't found the time yet.

    The RGBW is a tough nut for me. I don't have a RGBW node to test with and the conversion HSB <=> RGBW is driving me crazy. The algorithm for the conversion can be found here: https://github.com/tobof/openhab2-addons/blob/MySensors_Binding/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/converter/MySensorsRGBWTypeConverter.java

    @gonzalonal May I ask you to add an issue on github? This would allow me track those enhancement requests. Thank you!



  • Yes, sure. I'll do that to keep track.

    By the way, I have RGBW led strip and I am using it with mysensors with no issues. Would you mind telling me what's wrong so I can recreate the scenario?


  • Hardware Contributor

    @gonzalonal said in openHAB 2.2 binding:

    Yes, sure. I'll do that to keep track.

    By the way, I have RGBW led strip and I am using it with mysensors with no issues. Would you mind telling me what's wrong so I can recreate the scenario?

    You can find the issues here. Basically you (I ;)) can't set RGBW nodes to display pure white colors via openhab, dimming is not working (error confirmed by TimO) and most importantly ACK isn't working properly (for me at least). If you can help with any of this (especially the conversion HSB <=> RGBW) you are most welcome.



  • Please kindly check my contribution in the git issue. Maybe it will help to clarify your issues.

    @LastSamurai said in openHAB 2.2 binding:

    @gonzalonal said in openHAB 2.2 binding:

    Yes, sure. I'll do that to keep track.

    By the way, I have RGBW led strip and I am using it with mysensors with no issues. Would you mind telling me what's wrong so I can recreate the scenario?

    You can find the issues here. Basically you (I ;)) can't set RGBW nodes to display pure white colors via openhab, dimming is not working (error confirmed by TimO) and most importantly ACK isn't working properly (for me at least). If you can help with any of this (especially the conversion HSB <=> RGBW) you are most welcome.


  • Hardware Contributor

    @gonzalonal I saw it earlier but did not understand it fully. I will take another look at it later.

    @TimO I might have found the error... maybe. I reflashed the motion sensor (with cleared eeprom before) and removed the static id and signing. Now I see that the problem seems to be that the node is unable to get an ID. Any idea what's happening herer? Is there a setting concerning that somewhere?

    Log from the node:

    ...
    102477 TSM:FAIL:RE-INIT
    102479 TSM:INIT
    102488 TSM:INIT:TSP OK
    102490 TSM:FPAR
    102492 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    103426 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    103432 TSF:MSG:FPAR OK,ID=0,D=1
    104501 TSM:FPAR:OK
    104503 TSM:ID
    104503 TSM:ID:REQ
    104507 TSF:MSG:SEND,255-255-0-0,s=55,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    106516 TSM:ID
    106516 TSM:ID:REQ
    106520 TSF:MSG:SEND,255-255-0-0,s=20,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    108529 TSM:ID
    108529 TSM:ID:REQ
    108533 TSF:MSG:SEND,255-255-0-0,s=241,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    110542 TSM:ID
    110542 TSM:ID:REQ
    110546 TSF:MSG:SEND,255-255-0-0,s=206,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    112556 !TSM:ID:FAIL
    112558 TSM:FAIL:CNT=6
    112560 TSM:FAIL:DIS
    112562 TSF:TDI:TSL
    ...
    

    Log from the openhab server:

    15:21:32.127 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 255;34;3;0;3;
    15:21:34.135 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 255;0;3;0;3;
    15:21:36.147 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 255;221;3;0;3;
    ...
    

    and lots more similar requests with different ids.


  • Hero Member

    @LastSamurai Upgrade the binding. You're using the current beta of MySensors and the request for I'd has changed.


  • Hardware Contributor

    @TimO Ahh thank you! I am using version 2.2 linked in the first post of this thread though. Where do I get a newer version? Maybe I overlooked it but I am not seeing any newer releases.


  • Hero Member

    @LastSamurai just replace the jar from the link above. I'm doing small changes from time to time.


  • Hardware Contributor

    @TimO Thank you again for the help. Everything is now back up and running 👍 With the new jar my node could finally get a new id and after also enabling signing again everything worked as expected.
    Can I see anywhere that you updated the jar file? I am using the current beta of mysensors mostly so I would also need to use an updated version of the openhab plugin.



  • @TimO , is this binding supported via mysensors MQTT gateway?
    In previous bending inormation you had some text indicating that you would implement it. But all that is gone.
    So I'm thinking you either implemented it, or aborted that feature 🙂


  • Hero Member

    @Nicklas-Starkel It happens, that MQTT support is sadly still on the to do list. There were some changes in the Smarthome MQTT library and we need to adopt them now.

    Here's the Issue: https://github.com/tobof/openhab2-addons/issues/98



  • @TimO, cool that you are stil on it, even if it's on the "todo-list".
    Kudos and keep up the great work 🙂



  • @TimO

    Can we use this binding for MQTT once the PR is available in OpenHAB?
    It is a separate mqtt generic binding in ESH for things discovery but I cannot make out if this will solve the dependency issue or not.
    https://github.com/eclipse/smarthome/pull/3876


  • Hardware Contributor

    @TimO My sketches are sending the nodes remaining battery power to the controller via a V_VOLTAGE. Openhab 2 with your binding doesn't seem to be able to read these values. Is this an error (possibly on my side) or does the not yet support this?


  • Hero Member

    @LastSamurai Did you connect a channel / item for V_VOLTAGE? If the sensor is not represented by the sketch you need to connect it manually.


  • Hero Member

    @gahlawathome I'm currently looking into the new MQTT implementation in smartphone. It should work without the PR above. The PR will bring us a new option to connect a MQTT binding with OpenHAB!


  • Hardware Contributor

    @TimO I am not sure what you mean.
    My sketch sends a presentation:

     present(CHILD_ID_BATTERY, S_MULTIMETER);
    

    and in openhab I added these (tried both sensor kinds)

    // things
    customSensor abc [nodeId=26, childId=1]
    multimeter def [nodeId=17, childId=1]
    // and items
    Number 	voltageSensorWZ ... { channel="mysensors:multimeter:gwSerial:def:volt" }
    //...
    

    Is there anything i am missing here?


  • Hero Member

    @LastSamurai

    The channel is not correct:

    channel="mysensors:multimeter:gwSerial:voltageSensorWZ:volt"
    

    It's confusing, but that's the way OpenHAB2 handles channels. 😕


  • Hardware Contributor

    @TimO Thanks for your help though I am afraid you mixed something up there. The channel linking to the item itself doesn't really make sense 😉
    Not 100% sure why it did not work earlier for me but I now got it to work like this:

    // thing
    multimeter		voltTHWohnzimmer	[nodeId=1, childId=2]
    // item
    Number 	voltageSensorWZ 		"Spannung [%3f mV]" 		<poweroutlet_eu> 	(grVolt, grWZ)	{ channel="mysensors:multimeter:gwSerial:voltTHWohnzimmer:volt" }
    

    My error in the code above seems to have been that I defined most as customSensor instead of multimeter.



  • @TimO said in openHAB 2.2 binding:

    @LastSamurai

    The channel is not correct:

    channel="mysensors:multimeter:gwSerial:voltageSensorWZ:volt"
    

    It's confusing, but that's the way OpenHAB2 handles channels. 😕

    Is the pattern:
    <binding name>:<mysensors type>:<gateway id>:<thing name>:<data name> ?



  • Just to let you know that I am very happy with this binding.
    One thing for others to be aware of:
    If you use PaperUI for configuring etc, make sure you leave Simple Mode off if you expect to use Groups later on. Simple mode adds the items (including the VAR1-5 :-() automatically but they are not 'managed'. This means you will get 404 and 405 errors on trying to edit them later on.
    My solution was to let the binding autodiscover and add the Things. Then add 1 Item manually so that the \\192.168.0.123\openHAB-share\openhab2-userdata\jsondb\org.eclipse.smarthome.core.items.Item.json
    file gets created and filled with an example to clone. I then added the various sensors using Name of pattern <binding name><sensorname><nodeid>_<dataname>, e.g. "mysensors_light_level_node4_last_update": { "class": "org.eclipse.smarthome.core.items.ManagedItemProvider$PersistedItem", "value": { "groupNames": [ "gLastUpdated" ], "itemType": "DateTime", "tags": [], "label": "Last", "category": "calendar" } },

    You must stop Openhab before editing the file (else you will lose your edits) but once it starts up again you will see the Items listed in PaperUI (and VSCode if you use that). You can then add the Channel/Item links for each Thing.



  • Thanks for some great work @TimO ! Version 2.2 now works smoothly with my simple OpenHAB setup (2.2 snapshot).

    One thing I noticed is that the gateway thing configuration page says "Disable network sanity check" even though the logic has been reversed in v2.2.
    So the UI needs to be similarly changed to "Enable startup check" instead.

    While I'm at it, could you please also clarify (in the UI) what "Send delay" is? Please also add that timing is in ms. If I understand things correctly it could say "Minimum time between messages sent to the gateway (ms)"

    Also, the comment for "Imperial/Metric selection" could use some clarification. Preferably change the label to "Imperial units" and the explanation to "Use imperial units (default is metric)."

    And finally it would be great to add add that the time is given in "...(minutes)" for the Network sanity check interval.


  • Hardware Contributor

    I have just updated to the stable openHAB 2.2 Version and everything seemed to be working just fine in the beginning but after the next restart I got this error:

    10:31:19.727 [WARN ] [fig.xml.osgi.XmlDocumentBundleTracker] - The XML document '/ESH-INF/binding/binding.xml' in module 'org.openhab.binding.mysensors' could not be parsed: The XmlConfigDescriptionProvider must not be null!
    

    It seems like I can still control my devices just fine but I just wanted to make sure that this doesn't cause errors down the line. So @TimO any idea where this error is coming from?



  • After upgrade OH to 2.2 stable release. (2.2_01). I'm having the same issue that zwave binding not working. After Mysensors binding is installed and gateway configured. There is only one serial port visiable in PaperUI, which is /dev/ttyUSB0 that is configured for the serial gateway. I'm using org.openhab.binding.mysensors-2.2.0-SNAPSHOT-serial-fix.jar.

    Also the old 2.1 snapshot version doesn't work either. anyone else experience this issue?



  • Hi,

    I have issues with MySensors and specifically Energy Sensors where they request latest value.
    See this thread for details: https://forum.mysensors.org/topic/8833/power-sensors-stopped-working

    Any idea how to solve it?



  • Hello,

    iam using "openHAB 2.2.0-1 (Release Build)" as openhabian on a PI3.

    i've installed "org.openhab.binding.mysensors-2.2.0-SNAPSHOT.jar" as explained in the instructions.

    configured the thing "MySensors Serial Gateway" to use "/dev/ttyACM0" with Baudrate "38400" because i'm using a pro micro with 8Mhz which isn't capable of 115200 (as far as i know).

    the Items got discovered fine.

    Atm i have only one item with

    #define CHILD_ID_TEMP 0
    unsigned long SLEEP_TIME = 3 * 1000; // Sleep time between reads (in milliseconds)
    
    MyMessage tempMsg(CHILD_ID_TEMP, S_TEMP);
    

    Presentation:

    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Temp/Hum/Pre Sensor", "1.2");
    
      // Register all sensors to gateway (they will be created as child devices)
      present(CHILD_ID_TEMP, S_TEMP);
    }
    

    and Loop:

      unsigned long currentTime = millis();
      temperature++;//bme.readTemperature();
    
    
        lastSend = currentTime;
        send(tempMsg.set(temperature, 2));
        lastTemp = temperature;
    
    
      sleep(SLEEP_TIME);
    

    This is my debug from "openhab-cli showlogs"

    2018-01-07 13:59:17.676 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 1;0;1;0;6;109.00
    2018-01-07 13:59:17.680 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 1 found in gateway
    2018-01-07 13:59:17.683 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 1
    2018-01-07 13:59:17.687 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_RAIN not present
    

    And this from Log Viewer

    2018-01-07 14:00:18.836 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 1 found in gateway
    2018-01-07 14:00:18.841 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 1
    2018-01-07 14:00:18.846 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_RAIN not present
    2018-01-07 14:00:27.561 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSF:MSG:READ,1-1-0,s=0,c=1,t=6,pt=7,l=5,sg=0:117.00
    2018-01-07 14:00:27.566 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 1;0;1;0;6;117.00
    2018-01-07 14:00:27.572 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 1 found in gateway
    2018-01-07 14:00:27.577 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 1
    2018-01-07 14:00:27.582 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_RAIN not present
    2018-01-07 14:00:36.301 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSF:MSG:READ,1-1-0,s=0,c=1,t=6,pt=7,l=5,sg=0:118.00
    2018-01-07 14:00:36.308 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 1;0;1;0;6;118.00
    2018-01-07 14:00:36.311 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 1 found in gateway
    2018-01-07 14:00:36.315 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 1
    2018-01-07 14:00:36.318 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_RAIN not present
    2018-01-07 14:00:45.034 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSF:MSG:READ,1-1-0,s=0,c=1,t=6,pt=7,l=5,sg=0:119.00
    2018-01-07 14:00:45.037 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 1;0;1;0;6;119.00
    2018-01-07 14:00:45.039 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 1 found in gateway
    2018-01-07 14:00:45.042 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 1
    2018-01-07 14:00:45.045 [WARN ] [rs.internal.gateway.MySensorsGateway] - Variable V_RAIN not present
    

    So from log i can see Temp is counting up. but in "Paper Ui"

    i always get "Temperature -NaN °C" or "Temperature 0 °C"

    Please correct me if this is the wrong place for this question.

    Greets Andi



  • @mythbai said in openHAB 2.2 binding:

    After upgrade OH to 2.2 stable release. (2.2_01). I'm having the same issue that zwave binding not working. After Mysensors binding is installed and gateway configured. There is only one serial port visiable in PaperUI, which is /dev/ttyUSB0 that is configured for the serial gateway. I'm using org.openhab.binding.mysensors-2.2.0-SNAPSHOT-serial-fix.jar.

    Also the old 2.1 snapshot version doesn't work either. anyone else experience this issue?

    Up my own post. Not many users are using Zwave dongle and Mysensors at the same time? I feel this forum or trend is dead... This problem is driving me crazy, render all my mysensors useless. I'm trying to build a ethernet gateway now...


  • Hero Member

    Hey @mythbai !

    Could you please download and install the most recent version of the binding? I've not changed anything at the serial code, but while we're trying to figure out the problem, we should be on the same base of code. 🙂

    I too have two serial devices connected to my OpenHAB box, one serial MySensors gateway and one Ebus-Adapter to Ebusd.

    You may need to execute:

    feature:install esh-io-transport-mqtt
    

    Because the most current version of the binding now supports MQTT gateways.


  • Hero Member

    Hello @lesockz !

    Well your node is sending V_RAIN instead of V_TEMP, so OpenHAB is not able to work with that.

    Try:

    MyMessage tempMsg(CHILD_ID_TEMP, V_TEMP);
    

    For presentation S_TEMP (== 6) is used, while for set messages V_TEMP (==0) is used.


  • Hero Member

    @mythbai While the code for the serial connection in the binding was unchanged for a while it definatly issn't working now together with zwave binding.

    Some time ago I've prepared a change of the serial library the binding is using. A few first tests looked promising but I didn't find the time to test it. So lets give it a new try: could you please test this binding: OH2 Binding with Serial Refactoring

    Please remove the old binding with bundle:list, bundle:remove ID before installing the new one.



  • I am moving the topic here as more appropriate 🙂 (old ref)

    I have OH v2.2 and latest MySensors 2.2.0 binding and my power sensors have stopped working.
    After some investigation it seems they cannot receive the old pulse count value and by that cannot start working.
    MySensors GW running 2.1.1 and the one power sensor I am testing also 2.1.1 (the rest 1.5.x)

    The debug (serial monitor) of the sensor shows that

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:INIT:STATID=5
    14 TSF:SID:OK,ID=5
    16 TSM:FPAR
    52 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2060 !TSM:FPAR:NO REPLY
    2062 TSM:FPAR
    2098 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2983 TSF:MSG:READ,0-0-5,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    2989 TSF:MSG:FPAR OK,ID=0,D=1
    4106 TSM:FPAR:OK
    4107 TSM:ID
    4108 TSM:ID:OK
    4110 TSM:UPL
    4147 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    6154 TSM:UPL
    6159 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=OK:1
    6168 TSF:MSG:READ,0-0-5,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    6173 TSF:MSG:PONG RECV,HP=1
    6175 TSM:UPL:OK
    6177 TSM:READY:ID=5,PAR=0,DIS=1
    6182 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    6189 TSF:MSG:READ,0-0-5,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    6232 !TSF:MSG:SEND,5-5-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=NACK:2.1.1
    6243 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0
    6259 TSF:MSG:READ,0-0-5,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    6305 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=NACK:Heater Energy
    6349 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=1,st=NACK:2.0
    6391 !TSF:MSG:SEND,5-5-0-0,s=0,c=0,t=13,pt=0,l=0,sg=0,ft=2,st=NACK:
    6397 MCO:REG:REQ
    6435 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=3,st=NACK:2
    8476 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=4,st=NACK:2
    10486 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=5,st=OK:2
    10493 TSF:MSG:READ,0-0-5,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    10499 MCO:PIM:NODE REG=1
    10501 MCO:BGN:STP
    10528 TSF:MSG:SEND,5-5-0-0,s=0,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK:
    Got Pulse
    10534 MCO:BGN:INIT OK,TSP=1
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    No count received. Try requesting it again
    30570 !TSF:MSG:SEND,5-5-0-0,s=0,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=NACK:
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    Got Pulse
    No count received. Try requesting it again
    50546 TSF:MSG:SEND,5-5-0-0,s=0,c=2,t=24,pt=0,l=0,sg=0,ft=1,st=OK:
    Got Pulse
    

    The sketch looks like this:

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * This sketch provides an example how to implement a distance sensor using HC-SR04
     * Use this sensor to measure KWH and Watt of your house meeter
     * You need to set the correct pulsefactor of your meeter (blinks per KWH).
     * The sensor starts by fetching current KWH value from gateway.
     * Reports both KWH and Watt back to gateway.
     *
     * Unfortunately millis() won't increment when the Arduino is in
     * sleepmode. So we cannot make this sensor sleep if we also want
     * to calculate/report watt-number.
     * http://www.mysensors.org/build/pulse_power
     */
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #define MY_NODE_ID 5
    #include <MySensors.h>
    
    #define DIGITAL_INPUT_SENSOR 3  // The digital input you attached your light sensor.  (Only 2 and 3 generates interrupt!)
    #define PULSE_FACTOR 1000       // Nummber of blinks per KWH of your meeter
    #define MAX_WATT 10000          // Max watt value to report. This filetrs outliers.
    
    #define CHILD_ID 0              // Id of the sensor child
    
    unsigned long SEND_FREQUENCY =
        20000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
    double ppwh = ((double)PULSE_FACTOR)/1000; // Pulses per watt hour
    bool pcReceived = false;
    volatile unsigned long pulseCount = 0;
    volatile unsigned long lastBlink = 0;
    volatile unsigned long watt = 0;
    unsigned long oldPulseCount = 0;
    unsigned long oldWatt = 0;
    double oldKwh;
    unsigned long lastSend;
    MyMessage wattMsg(CHILD_ID,V_WATT);
    MyMessage kwhMsg(CHILD_ID,V_KWH);
    MyMessage pcMsg(CHILD_ID,V_VAR1);
    
    
    void setup()
    {
     
      // Fetch last known pulse count value from gw
      request(CHILD_ID, V_VAR1);
    
      // Use the internal pullup to be able to hook up this sketch directly to an energy meter with S0 output
      // If no pullup is used, the reported usage will be too high because of the floating pin
      pinMode(DIGITAL_INPUT_SENSOR,INPUT_PULLUP);
    
      attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, RISING);
      lastSend=millis();
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Heater Energy", "2.0");
    
      // Register this device as power sensor
      present(CHILD_ID, S_POWER);
    }
    
    void loop()
    {
      unsigned long now = millis();
      // Only send values at a maximum frequency or woken up from sleep
      bool sendTime = now - lastSend > SEND_FREQUENCY;
      if (pcReceived && sendTime) {
        // New watt value has been calculated
        if (watt != oldWatt) {
          // Check that we dont get unresonable large watt value.
          // could hapen when long wraps or false interrupt triggered
          if (watt<((unsigned long)MAX_WATT)) {
            send(wattMsg.set(watt));  // Send watt value to gw
          }
          Serial.print("Watt:");
          Serial.println(watt);
          oldWatt = watt;
        }
    
        // Pulse cout has changed
        if (pulseCount != oldPulseCount) {
          send(pcMsg.set(pulseCount));  // Send pulse count value to gw
          double kwh = ((double)pulseCount/((double)PULSE_FACTOR));
          oldPulseCount = pulseCount;
          if (kwh != oldKwh) {
            send(kwhMsg.set(kwh, 4));  // Send kwh value to gw
            oldKwh = kwh;
          }
        }
        lastSend = now;
      } else if (sendTime && !pcReceived) {
        // No count received. Try requesting it again
        Serial.println("No count received. Try requesting it again");
        request(CHILD_ID, V_VAR1);
        lastSend=now;
      }
    
    }
    
    void receive(const MyMessage &message)
    {
      Serial.print("MessageType:");
      Serial.println(message.type);
      Serial.print("Message:");
      Serial.println(message.getLong());
      if (message.type==V_VAR1) {
        pulseCount = oldPulseCount = message.getLong();
        Serial.print("Received last pulse count from gw:");
        Serial.println(pulseCount);
        pcReceived = true;
      }
    }
    
    void onPulse()
    {
      Serial.println("Got Pulse");
      unsigned long newBlink = micros();
      unsigned long interval = newBlink-lastBlink;
      if (interval<10000L) { // Sometimes we get interrupt on RISING
        return;
      }
      watt = (3600000000.0 /interval) / ppwh;
      lastBlink = newBlink;
      pulseCount++;
    }
    

    Today I realized that I likely need to have item(s) created in OH to save the values - so created Var1 (and then added one after another with no success). Currently it looks like:

    Number CellarAirHeaterSensorWatt   "Airheater Watt" <energy> { channel="mysensors:power:gateway:sensor-air-pump-power:watt", mqtt=">[rabbitmq:/myhouse/airpump/sensor/power:state:*:Power,sensor=${itemName},location=airpump watt=${state} ]" }
    Number CellarAirHeaterSensorKwh    "Airheater Kwh" <energy> { channel="mysensors:power:gateway:sensor-air-pump-power:kwh", mqtt=">[rabbitmq:/myhouse/airpump/sensor/power:state:*:Power,sensor=${itemName},location=airpump kwh=${state} ]" }
    Number CellarAirHeaterSensorVar   "Airheater Var" <energy> { channel="mysensors:power:gateway:sensor-air-pump-power:var" }
    Number CellarAirHeaterSensorVar1   "Airheater Var1" <energy> { channel="mysensors:power:gateway:sensor-air-pump-power:var1" }
    Number CellarAirHeaterSensorVA   "Airheater VA" <energy> { channel="mysensors:power:gateway:sensor-air-pump-power:va" }
    

    Still no success!

    Do you have any idea what's wrong?



  • @timo said in openHAB 2.2 binding:

    Some time ago I've prepared a change of the serial library the binding is using. A few first tests looked promising but I didn't find the time to test it. So lets give it a new try: could you please test this binding: OH2 Binding with Serial Refactoring

    Please remove the old binding with bundle:list, bundle:remove ID before installing the new one.

    @TimO Thank you very much! Here is what I got with the new jar:

    Initial bundle:uninstall, and replace jar works. But after server reboot, the MySensor binding is not loading due to some "Multiexception" on framework level (sorry didn't capture that log).
    I tried to restart binding in console:

    openhab> bundle:restart 233
    Error executing command: Error restarting bundles:
            Unable to start bundle 233: Could not resolve module: org.openhab.binding.mysensors [233]
      Unresolved requirement: Import-Package: org.eclipse.smarthome.io.transport.mqtt
    

    This is an easy fix by "feature:install openhab-transport-mqtt". And after that bundle works! (why do I have to install mqtt transport here .... )

    2). After fix above, did a server reboot. Got MySensors thing discovery related exceptions, but both zwave and mysensors binding loaded, and things got online. The fix actually works!!! just with some minor glitch:

    09:04:38.710 [ERROR] [org.openhab.binding.mysensors        ] - [org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService(221)] Error during instantiation of the implementation object
    java.lang.InstantiationException: org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService
            at java.lang.Class.newInstance(Class.java:427) [?:?]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:237) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823) [42:org.apache.felix.scr:2.0.12]
            at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [?:?]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) [?:?]
            at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:72) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.inject.BindMethod.getServiceObject(BindMethod.java:651) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2201) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1714) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:372) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127) [42:org.apache.felix.scr:2.0.12]
            at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) [?:?]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) [42:org.apache.felix.scr:2.0.12]
            at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) [?:?]
            at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) [?:?]
            at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [?:?]
            at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) [?:?]
            at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [?:?]
            at org.eclipse.osgi.container.Module.start(Module.java:467) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
    Caused by: java.lang.NoSuchMethodException: org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService.<init>()
            at java.lang.Class.getConstructor0(Class.java:3082) ~[?:?]
            at java.lang.Class.newInstance(Class.java:412) ~[?:?]
            ... 70 more
    09:04:39.069 [WARN ] [org.openhab.binding.mysensors        ] - FrameworkEvent WARNING - org.openhab.binding.mysensors
    org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
            at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) [?:?]
            at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:72) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.inject.BindMethod.getServiceObject(BindMethod.java:651) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2201) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1714) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1699) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:372) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:320) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:291) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127) [42:org.apache.felix.scr:2.0.12]
            at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]
            at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) [?:?]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) [42:org.apache.felix.scr:2.0.12]
            at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) [42:org.apache.felix.scr:2.0.12]
            at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) [?:?]
            at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) [?:?]
            at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [?:?]
            at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) [?:?]
            at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [?:?]
            at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) [?:?]
            at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [?:?]
            at org.eclipse.osgi.container.Module.start(Module.java:467) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
            at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
            at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
    

    It's a good start, I now have all my sensors working now!


  • Hero Member

    @mythbai Thank you for reporting back! I'm glad it is working now.

    The transport-mqtt feature is now needed because the support for MQTT GW is now part of the binding and the fix I've provided to you is based on the current code base.

    The exception is completely unrelated to your problem and will do no harm. It only occures on startup and will soon be fixed!


  • Hero Member

    @jocke4u The request needs to be handled with rules because it is not allowed to access the value of an item via the binding API 😏.

    Please post the request (from the OpenHAB log, enable DEBUG with log:set DEBUG org.openhab.binding.mysensors if not already done in the karaf console) and we'll figure out the rule.



  • @timo regarding the issue with the pulse power node, the same as @jocke4u. I'm using a version of the same sketch and also the latest snapshot jar.

    This is the feedback in my openhab.log while looking att the debug level messages from the binding.

    15:59:15.829 [WARN ] [ors.internal.gateway.MySensorsGateway] - Request received, but variable state is not yet defined
    15:59:15.834 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 50;1;2;0;24;
    15:59:15.839 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Node 50 found in gateway
    15:59:15.844 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Child 1 found in node 50
    15:59:15.849 [WARN ] [ors.internal.gateway.MySensorsGateway] - Request received, but variable state is not yet defined
    15:59:15.854 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 50;1;2;0;24;
    15:59:15.859 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Node 50 found in gateway
    15:59:15.864 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Child 1 found in node 50
    15:59:15.869 [WARN ] [ors.internal.gateway.MySensorsGateway] - Request received, but variable state is not yet defined
    15:59:15.874 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 50;1;2;0;24;
    15:59:15.879 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Node 50 found in gateway
    

    As you can see the messages are quite frequent making it quite tedious for me to extract the relevant log messages. I'm no expert in browsing and searching text files from the command line.

    I guess because I'm using a version of the standard sketch my node does not wait for a response to the request before starting to count. I'm not sure how the node can neglect the response. Anyhow I restarted my node and now it tried to SET a new count instead.

    2018-01-10 16:26:22.341 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 50;1;1;0;24;150
    2018-01-10 16:26:22.571 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 50;1;1;0;24;150
    2018-01-10 16:26:22.791 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 50;1;1;0;24;150
    2018-01-10 16:26:23.011 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 50;1;1;0;24;150
    2018-01-10 16:26:23.230 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 50;1;1;0;24;150
    

    Hopefully this is useful feedback.



  • Hi @timo ,

    Here is the log when restarting the sensor:

    17:27:58.562 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;255;0;0;17;2.1.1
    17:27:58.573 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Presentation Message received
    17:27:58.583 [WARN ] [ors.internal.gateway.MySensorsGateway] - Presented child is alredy present in gateway
    17:27:58.593 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;255;3;0;6;0
    17:27:58.603 [DEBUG] [ors.internal.gateway.MySensorsGateway] - I_CONFIG request received from M, answering: (is imperial?)false
    17:27:58.614 [DEBUG] [orsAbstractConnection$MySensorsWriter] - Sending to MySensors: 5;255;3;0;6;M
    17:27:58.674 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;255;3;0;11;Heater Energy
    17:27:58.682 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;255;3;0;12;2.0
    17:27:58.690 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;0;0;0;13;
    17:27:58.698 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Presentation Message received
    17:27:58.705 [WARN ] [ors.internal.gateway.MySensorsGateway] - Presented child is alredy present in gateway
    17:27:58.719 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 5;0;2;0;24;
    17:27:58.727 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Node 5 found in gateway
    17:27:58.735 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Child 0 found in node 5
    17:27:58.743 [WARN ] [ors.internal.gateway.MySensorsGateway] - Request received, but variable state is not yet defined
    


  • @nickbuilder Check the code here and there is a SEND_FREQUENCY of 20 sec - would reduce the load quite a lot 🙂


  • Hero Member

    @jocke4u & @NickBuilder :

    Thank you! This will help me to find a solution. For reference, here is the corresponding issue on github: https://github.com/tobof/openhab2-addons/issues/69



  • @timo Ok, so there is a plan to solve it in a better way than using rules?
    Do you have any guidance of using rules until then?


  • Hero Member

    @jocke4u I'll try to document an example for using rules tomorrow. I'm not yet sure about the best final solution. Maybe I'll experiment with persistence within the binding.


  • Hardware Contributor

    @TimO Today I decided to finally read into how Openhab binding development works. And just when I started I saw that you finally fixed some of the problems that I reported via github (thank you very much for that). Had to laugh a little at that coincidence 🤣

    I just started a pullrequest where I tried to implement pure white colors for RGBW values fixing one of my problems left open. If you find the time please have a look at it. I did not yet write any tests for it or test it on my actual RGBW nodes but I will do that as soon as possible



  • [Solved] I've solved the issue by changing docker base image. The issue described here - https://github.com/openhab/openhab-docker/issues/144

    I'll keep the details for others:

    @TimO, thanks for the great openhab binding. I've used it on openhab 2.0 and it works just great. Now I have totally fresh openhab 2.2 setup and cannot make mysensors binding working. I've tried many things but with no luck. Can you point me into direction how to fix that?

    The gateway works as expected:

    root@machine:/home/kwull# cat /dev/ttyUSB0
    0;1;1;0;0;22.3
    0;0;1;0;1;23.0
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.1.1
    0;255;3;0;11;Garage Gateway
    0;255;3;0;12;1.0
    0;0;0;0;7;
    0;1;0;0;6;
    0;1;1;0;0;23.1
    0;0;1;0;1;22.1
    

    Bindings:

    25 │ Active   │  80 │ 3.12.0.OH              │ nrjavaserial
    210 │ Active   │  80 │ 1.0.2                  │ Paho MQTT Client
    211 │ Active   │  80 │ 0.10.0.b1              │ Eclipse SmartHome MQTT Transport Bundle
    214 │ Active   │  80 │ 2.3.0.201801160936     │ MySensors Binding
    

    openhab.log:

    2018-01-21 17:18:33.696 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge
    2018-01-21 17:18:33.703 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache file: given_ids.cached exist.
    2018-01-21 17:18:33.704 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache (given_ids) content: []
    2018-01-21 17:18:33.710 [DEBUG] [col.serial.MySensorsSerialConnection] - Enabling connection watchdog
    2018-01-21 17:18:33.712 [DEBUG] [col.serial.MySensorsSerialConnection] - Connecting to /dev/ttyUSB0 [baudRate:115200]
    2018-01-21 17:18:33.715 [DEBUG] [org.openhab.binding.mysensors       ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=325, service.bundleid=214, service.scope=singleton} - org.openhab.binding.mysensors
    2018-01-21 17:18:33.716 [DEBUG] [.discovery.MySensorsDiscoveryService] - Starting MySensors discovery scan
    2018-01-21 17:18:33.716 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge DONE!
    2018-01-21 17:18:36.027 [WARN ] [org.jline                           ] - Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
    

    Exception log:

    Current thread (0x000055797e792800):  JavaThread "org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection" [_thread_in_native, id=641, stack(0x00007f12eb309000,0x00007f12eb409aa8)]
    
    siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00000000000037a6
    
    Registers:
    RAX=0x0000000000000000, RBX=0x00007f12e7403940, RCX=0x00007f13197e3f04, RDX=0x00007f131934828c
    RSP=0x00007f12eb407d48, RBP=0x0000000000000001, RSI=0x0000000000000900, RDI=0x000055797ccb99a0
    R8 =0x000055797ccb99ac, R9 =0x000055797ccb99a0, R10=0x00000006d600e9d0, R11=0x0000000000000206
    R12=0x000055797ccb99a0, R13=0x000055797e7929e0, R14=0x00007f12eb407ec8, R15=0x0000000000000082
    RIP=0x00000000000037a6, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000014
      TRAPNO=0x000000000000000e
    
    Top of Stack: (sp=0x00007f12eb407d48)
    0x00007f12eb407d48:   00007f12e64e0965 00007f12eb407de8
    0x00007f12eb407d58:   00007f1300000001 00007f12e7403940
    0x00007f12eb407d68:   000055797e792800 00007f12e7403940
    0x00007f12eb407d78:   d85a256e98c0817f 00007f12eb407de8
    0x00007f12eb407d88:   00007f1318b46afc 00007f12eb407de8
    0x00007f12eb407d98:   00007f12eb407dc8 00007f12eb407de8
    0x00007f12eb407da8:   00007f1318b46b68 000055797e792800
    0x00007f12eb407db8:   00007f1318c99928 0000557981a9a5f0
    0x00007f12eb407dc8:   000055797e792800 000055797e792800
    0x00007f12eb407dd8:   00007f12e7403940 000055797e792800
    0x00007f12eb407de8:   00007f12e7403940 000055797e792800
    0x00007f12eb407df8:   d85a256e98c0817f 00007f12e7403940
    0x00007f12eb407e08:   00007f12e7403940 00007f12eb407ea0
    0x00007f12eb407e18:   0000000000000000 00007f12e7403940
    0x00007f12eb407e28:   00007f12eb407ed0 000055797e792800
    0x00007f12eb407e38:   00007f1308ccd7f4 00007f12eb407ea0
    0x00007f12eb407e48:   00007f1308ccd579 fffffffe00000000
    0x00007f12eb407e58:   00007f1308ccd542 00007f12eb407e60
    0x00007f12eb407e68:   00007f12e7403940 00007f12eb407ed0
    0x00007f12eb407e78:   00007f12e7405c28 0000000000000000
    0x00007f12eb407e88:   00007f12e7403940 0000000000000000
    0x00007f12eb407e98:   00007f12eb407ec0 00007f12eb407f18
    0x00007f12eb407ea8:   00007f1308cbd7d0 0000000000000000
    0x00007f12eb407eb8:   00007f1308cc7260 0000000000000001
    0x00007f12eb407ec8:   00000006d600e9a8 00000006d600b490
    0x00007f12eb407ed8:   00007f12eb407ed8 00007f12e7404122
    0x00007f12eb407ee8:   00007f12eb407f98 00007f12e7405c28
    0x00007f12eb407ef8:   0000000000000000 00007f12e7404270
    0x00007f12eb407f08:   00007f12eb407ec0 00007f12eb407f80
    0x00007f12eb407f18:   00007f12eb407fe0 00007f1308cbdffd
    0x00007f12eb407f28:   0000000000000000 0000000000000000
    0x00007f12eb407f38:   0000000000000000 00000006d600e9a8 
    
    Instructions: (pc=0x00000000000037a6)
    0x0000000000003786:   
    [error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]
    
    Register to memory mapping:
    
    RAX=0x0000000000000000 is an unknown value
    RBX={method} {0x00007f12e7403940} 'testRead' '(Ljava/lang/String;I)Z' in 'gnu/io/RXTXCommDriver'
    RCX=0x00007f13197e3f04: getpid+0x7 in /lib/ld-musl-x86_64.so.1 at 0x00007f131978d000
    RDX=0x00007f131934828c: gHotSpotVMStructs+0x218f4 in /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server/libjvm.so at 0x00007f1318861000
    RSP=0x00007f12eb407d48 is pointing into the stack for thread: 0x000055797e792800
    RBP=0x0000000000000001 is an unknown value
    RSI=0x0000000000000900 is an unknown value
    RDI=0x000055797ccb99a0 is an unknown value
    R8 =0x000055797ccb99ac is an unknown value
    R9 =0x000055797ccb99a0 is an unknown value
    R10=0x00000006d600e9d0 is pointing into object: 0x00000006d600e9c0
    [C 
     - klass: {type array char}
     - length: 12
    R11=0x0000000000000206 is an unknown value
    R12=0x000055797ccb99a0 is an unknown value
    R13=0x000055797e7929e0 is an unknown value
    R14=0x00007f12eb407ec8 is pointing into the stack for thread: 0x000055797e792800
    R15=0x0000000000000082 is an unknown value
    
    
    Stack: [0x00007f12eb309000,0x00007f12eb409aa8],  sp=0x00007f12eb407d48,  free space=1019k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  0x00000000000037a6
    
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  gnu.io.RXTXCommDriver.testRead(Ljava/lang/String;I)Z+0
    j  gnu.io.RXTXCommDriver.registerValidPorts([Ljava/lang/String;[Ljava/lang/String;I)V+202
    j  gnu.io.RXTXCommDriver.registerScannedPorts(I)V+1466
    j  gnu.io.RXTXCommDriver.initialize()V+35
    j  gnu.io.CommPortIdentifier.getPortIdentifiers()Ljava/util/Enumeration;+53
    j  gnu.io.NativeResource.testNativeCode()V+0
    j  gnu.io.NativeResource.inJarLoad(Ljava/lang/String;)V+37
    j  gnu.io.NativeResource.loadLib(Ljava/lang/String;)V+54
    j  gnu.io.NativeResource.load(Ljava/lang/String;)V+138
    j  gnu.io.SerialManager.<init>()V+23
    j  gnu.io.SerialManager.getInstance()Lgnu/io/SerialManager;+10
    j  gnu.io.RXTXCommDriver.<clinit>()V+39
    v  ~StubRoutines::call_stub
    J 1368  java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Class; (0 bytes) @ 0x00007f1309151eba [0x00007f1309151e40+0x7a]
    J 3010 C1 java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class; (15 bytes) @ 0x00007f13096ee94c [0x00007f13096ee7a0+0x1ac]
    j  gnu.io.CommPortIdentifier.<clinit>()V+12
    v  ~StubRoutines::call_stub
    j  org.openhab.binding.mysensors.internal.protocol.serial.MySensorsSerialConnection.establishConnection()Z+32
    j  org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection.connect()Z+2
    j  org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection.run()V+46
    J 10253 C2 java.util.concurrent.Executors$RunnableAdapter.call()Ljava/lang/Object; (14 bytes) @ 0x00007f1309884cac [0x00007f1309884c60+0x4c]
    J 9236 C1 java.util.concurrent.FutureTask.runAndReset()Z (128 bytes) @ 0x00007f130a4cd17c [0x00007f130a4ccf00+0x27c]
    J 9408 C1 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run()V (59 bytes) @ 0x00007f130a57bb8c [0x00007f130a57b600+0x58c]
    J 8894 C1 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (225 bytes) @ 0x00007f130a3b8e3c [0x00007f130a3b7e00+0x103c]
    j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
    J 11172 C1 java.lang.Thread.run()V (17 bytes) @ 0x00007f1308f58584 [0x00007f1308f58440+0x144]
    v  ~StubRoutines::call_stub
    

    Additional logs:

    2018-01-08 20:55:18.426 [ERROR] [org.openhab.binding.mysensors       ] - [org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService(195)] Error during instantiation of the implementation object
    java.lang.InstantiationException: org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService
    	at java.lang.Class.newInstance(Class.java:427) ~[?:?]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:237) ~[?:?]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109) ~[?:?]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906) ~[?:?]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879) ~[?:?]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
    	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) ~[?:?]
    	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) ~[?:?]
    	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) ~[?:?]
    	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) ~[?:?]
    	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) ~[?:?]
    	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) ~[?:?]
    	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) ~[?:?]
    	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) ~[?:?]
    	at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) ~[?:?]
    	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) ~[?:?]
    	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) ~[?:?]
    	at org.eclipse.osgi.container.Module.start(Module.java:467) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402) ~[?:?]
    	at org.eclipse.smarthome.extensionservice.marketplace.internal.BindingExtensionHandler.install(BindingExtensionHandler.java:82) ~[?:?]
    	at org.eclipse.smarthome.extensionservice.marketplace.internal.MarketplaceExtensionService.install(MarketplaceExtensionService.java:222) ~[?:?]
    	at org.eclipse.smarthome.io.rest.core.internal.extensions.ExtensionResource.lambda$0(ExtensionResource.java:157) ~[?:?]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:?]
    Caused by: java.lang.NoSuchMethodException: org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService.<init>()
    	at java.lang.Class.getConstructor0(Class.java:3082) ~[?:?]
    	at java.lang.Class.newInstance(Class.java:412) ~[?:?]
    	... 65 more
    2018-01-08 20:55:18.450 [WARN ] [org.openhab.binding.mysensors       ] - FrameworkEvent WARNING - org.openhab.binding.mysensors
    org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) ~[?:?]
    	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) ~[?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) ~[?:?]
    	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) ~[?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) ~[?:?]
    	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) ~[?:?]
    	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) ~[?:?]
    	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) ~[?:?]
    	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) ~[?:?]
    	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) ~[?:?]
    	at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) ~[?:?]
    	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) ~[?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) ~[?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) ~[?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) ~[?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) ~[?:?]
    	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) ~[?:?]
    	at org.eclipse.osgi.container.Module.start(Module.java:467) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402) ~[?:?]
    	at org.eclipse.smarthome.extensionservice.marketplace.internal.BindingExtensionHandler.install(BindingExtensionHandler.java:82) ~[?:?]
    	at org.eclipse.smarthome.extensionservice.marketplace.internal.MarketplaceExtensionService.install(MarketplaceExtensionService.java:222) ~[?:?]
    	at org.eclipse.smarthome.io.rest.core.internal.extensions.ExtensionResource.lambda$0(ExtensionResource.java:157) ~[?:?]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:?] 
    

    Any ideas where to look?



  • @kwull, @TimO - I've solved the issue by changing docker base image. The issue described here - https://github.com/openhab/openhab-docker/issues/144



  • Hi, I'd like to use the expert mode for viewing the raw messages from the serial gateway.
    I've created a new thing and item
    Thing:

     mySensorsMessage mySMsg01   [ nodeId=999, childId=999 ]
    

    Item:

    String mySMsg01  "MySensorsMessage"   { channel="mysensors:mySensorsMessage:gateway:mySMsg01:mySensorsMessage" }
    

    unfortunately i get no item state :
    openhab> smarthome:items list my*
    mySMsg01 (Type=StringItem, State=NULL, Label=MySensorsMessage, Category=null)

    did I do something wrong here?



  • 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 2.3.0.201801160936. 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
    java.io.IOException: Underlying input stream returned zero bytes
            at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:288) [?:?]
            at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) [?:?]
            at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) [?:?]
            at java.io.InputStreamReader.read(InputStreamReader.java:184) [?:?]
            at java.io.BufferedReader.fill(BufferedReader.java:161) [?:?]
            at java.io.BufferedReader.readLine(BufferedReader.java:324) [?:?]
            at java.io.BufferedReader.readLine(BufferedReader.java:389) [?:?]
            at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$MySensorsReader.run(MySensorsAbstractConnection.java:328) [255:org.openhab.binding.mysensors:2.3.0.201801160936]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
            at java.lang.Thread.run(Thread.java:748) [?:?]
    

    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.

    Cheers!


  • 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.
    file: MySensorsChildSGas.java
    github link: https://github.com/tobof/openhab2-addons/blob/MySensors_Binding/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/sensors/child/MySensorsChildSGas.java

    as by: https://www.mysensors.org/download/serial_api_20#sensor-types 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 org.eclipse.smarthome.io.transport.mqtt.MqttService. 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.

    Thanks!



  • @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: org.eclipse.smarthome.io.transport.mqtt
    	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
    2018-04-16 16:28:36.870 [INFO ] [penhab.io.transport.mqtt.MqttService] - 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 ] [penhab.io.transport.mqtt.MqttService] - 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 ] [rthome.io.transport.mqtt.MqttService] - MqttBroker start failed: Persistence already in use
    org.eclipse.smarthome.io.transport.mqtt.MqttException: Persistence already in use
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.start(MqttBrokerConnection.java:572) [219:org.eclipse.smarthome.io.transport.mqtt:0.10.0.b1]
    	at org.eclipse.smarthome.io.transport.mqtt.MqttService.modified(MqttService.java:145) [219:org.eclipse.smarthome.io.transport.mqtt:0.10.0.b1]
    	at org.eclipse.smarthome.io.transport.mqtt.MqttService.activate(MqttService.java:157) [219:org.eclipse.smarthome.io.transport.mqtt:0.10.0.b1]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
    	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:307) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:299) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:298) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823) [42:org.apache.felix.scr:2.0.12]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [?:?]
    	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) [?:?]
    	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) [?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) [?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) [?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) [?:?]
    	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]
    	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) [?:?]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) [42:org.apache.felix.scr:2.0.12]
    	at org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:187) [42:org.apache.felix.scr:2.0.12]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469) [?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415) [?:?]
    	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) [?:?]
    	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) [?:?]
    	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) [?:?]
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [?:?]
    	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) [?:?]
    	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [?:?]
    	at org.eclipse.osgi.container.Module.start(Module.java:467) [?:?]
    	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.start(ModuleContainer.java:736) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:727) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:497) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:443) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:987) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1368) [?:?]
    	at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
    Caused by: org.eclipse.paho.client.mqttv3.MqttPersistenceException: Persistence already in use
    	at org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence.open(MqttDefaultFilePersistence.java:112) ~[?:?]
    	at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:286) ~[?:?]
    	at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:167) ~[?:?]
    	at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.start(MqttBrokerConnection.java:570) ~[?:?]
    	... 79 more
    2018-04-16 16:30:14.330 [INFO ] [penhab.io.transport.mqtt.MqttService] - 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?



  • @fixjunk - I'm having the same problem and it's driving me crazy. I don't mind some troubleshooting but OpenHAB is new territory for me and I just can't find the problem.

    I have set up two mqtt broker connections (in two config files) for debugging. For the Eclipse bundle I define the connection "huset_mqtt" with user "openhab". For the legacy OpenHAB binding I define a connection "huset_mqtt_legacy" with user "openhab-legacy. Both connect to the same mosquitto server.

    I don't think there is a conflict between the openHAB MQTT Binding and esh-io-transport-mqtt. To test it I stopped the openHAB MQTT binding and transport bundles. The warning is still there even when only the Eclipse SmartHome MQTT Transport Bundle is running.

    When all bundles are running, I first stop the legacy broker and the log looks as expected. But when I restart the Eclipse bundle the warning "Persistence already in use" is thrown (below):

    2018-05-04 22:10:09.739 [INFO ] [penhab.io.transport.mqtt.MqttService] - Stopping broker connection 'huset_mqtt_legacy'
    2018-05-04 22:17:47.270 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection 'huset_mqtt' to 'tcp://
    192.168.1.5:1883' with clientid OpenHab and file store '/var/lib/openhab2/tmp/huset_mqtt'
    2018-05-04 22:17:47.349 [WARN ] [rthome.io.transport.mqtt.MqttService] - MqttBroker start failed: Persistence already in use
    org.eclipse.smarthome.io.transport.mqtt.MqttException: Persistence already in use
            at org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection.start(MqttBrokerConnection.java:572) [214:org.eclipse.sm
    arthome.io.transport.mqtt:0.10.0.b1]
    

    However, it is clear that the Eclipse broker connection does not fail completely. Mosquitto logs and mqtt-spy confirm that both transports/binding actually connect to the mosquitto server. One at a time or both at the same time.

    Below is the mosquitto log when I restart the OpenHAB MQTT transport, the OpenHAB MQTT binding and last the Eclipse MQTT transport. Clearly the clients disconnect and then reconnects like they should.

    1525466428: Client OpenHab_legacy disconnected.
    1525466428: New connection from 192.168.1.5 on port 1883.
    1525466428: New client connected from 192.168.1.5 as OpenHab_legacy (c1, k60, u'openhab-legacy').
    1525466645: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
    1525467392: Client OpenHab_legacy disconnected.
    1525467393: New connection from 192.168.1.5 on port 1883.
    1525467393: New client connected from 192.168.1.5 as OpenHab_legacy (c1, k60, u'openhab-legacy').
    1525467446: Client OpenHab disconnected.
    1525467446: New connection from 192.168.1.5 on port 1883.
    1525467446: New client connected from 192.168.1.5 as OpenHab (c1, k60, u'openhab').
    

    To test the two mqtt broker connections I have set up test switches in an .items file:

    Switch MQTT_TEST_legacy "Testing..." { mqtt="<[huset_MQTT_legacy:testing/mqtt/topic:state:default], >[huset_MQTT_legacy:testing/mqtt/back-topic:command:*:default]" }
    Switch MQTT_TEST_new "Testing..." { mqtt="<[huset_MQTT:testing/mqtt/topic:state:default], >[huset_MQTT:testing/mqtt/back-topic:command:*:default]" }
    

    To test them I manually send the message "ON" to the topic "testing/mqtt/topic". The MQTT_TEST_legacy switch state changes to ON. So the legacy OpenHAB binding works fine.
    However, the MQTT_TEST switch that uses the Eclipse mqtt broker/transporrt does not respond at all to my messages.

    To summarize, the Eclipse mqtt feature throws a warning but connects to my mosquitto server,and then wont change items with messages I send.

    Am I missing a component, or what could possibly be the reason?

    It is a basic, fresh install of OpenHAB 2.2 on openhabian. I have cleaned caches and tmp, cleaned up config files in /var/lib/openhab/config and even reinstalled OpenHAB. The Mysensors binding 2.2.0.201710190834 is running.

    Now I don't even have a clue on what to check next.
    OpenHAB gurus out there - please help me!


Log in to reply
 

Suggested Topics

  • 22
  • 19
  • 1
  • 10
  • 135
  • 3

60
Online

11.4k
Users

11.1k
Topics

112.7k
Posts