OH 2.5 snapshot and MySensors binding

Hi,
I’ve tried to update my fresh installation to 2.5.0-SNAPSHOT Build #1766 because of issue https://github.com/openhab/openhab2-addons/issues/6224

Unfortunately, the upgrade is breaking MySensors binding.

I have MySensor binding 2.4.0 and 2.5.0 installed.

openhab> bundle:list|grep -i senso
264 x Resolved  x  80 x 2.4.0.201812040738      x MySensors Binding
265 x Installed x  80 x 2.5.0.201902051046      x MySensors.test Binding

When I start MySensors 2.4.0, I get such logs:

openhab> bundle:start 264
----
2019-11-30 18:46:05.977 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@4b668bd1': bundleContext
java.lang.NoSuchFieldError: bundleContext
	at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?]
	at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2019-11-30 18:46:05.986 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mysensors:bridge-eth:gateway': bundleContext
java.lang.NoSuchFieldError: bundleContext
	at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?]
	at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2019-11-30 18:46:06.698 [INFO ] [al.protocol.ip.MySensorsIpConnection] - Successfully connected to MySensors Bridge.

If I try with 2.5.0:

openhab> bundle:stop 264                                                                                                                                                                                                                                              
openhab> bundle:start 265
Error executing command: Error executing command on bundles:
        Error starting bundle 265: Invalid operation on a fragment.

Any help appreciated to bring this service back :slight_smile:
Thanks a lot!!!

Hey @kumy!

I’m in the middle of the migration progress to support the current OH versions.
Please test THIS version, but be aware that this is a work in progress release and is not tested that well yet. Please report back to me, if you find the time to test this release!

1 Like

Excellent, just in time! :slight_smile:

I just made the switch from OH stable to snapshot and got problems with the 2.4.0 MySensors snapshot. It wasn’t completely broken, I had to comment and uncomment the thing definitions within the bridge after the controller went online.

Just now tried the 2.5.0 snapshot and it seems to work just fine from the little time I’ve tested it.

Thanks @TimO! Looking forward to an official, stable release.

Thanks a lot @TimO, just replaced the plugin had with yours and it’s working fine.

openhab> bundle:list|grep -i senso                                                                                                                                                                                                                                    
266 x Active x  80 x 2.5.0.201911301940      x openHAB Add-ons :: Bundles :: MySensors Binding

Just a side question, is there a page, or where can I find such ‘unofficial’ plugins builds?

hi there. I had everything working with 2.4. Now I upgraded openhab and TimO binding and I’m getting bridge offline.

Could you please share your config so I can compare? Thanks

Just upgraded and it works :+1:
+1 h running so far

openhab> bundle:list | grep Sensors
234 x Active   x  80 x 2.5.0.201911301940      x openHAB Add-ons :: Bundles :: MySensors Binding
openhab>

Hmm,

It seems that the latest version is missing support for the MQTT gateway? Is this temporary?

Kind regards

1 Like

Yeah! Same question here. I was using it via MQTT. Now it stopped working but it resumed when I uploaded the simple ethernet gateway sketch.

Would love to have MQTT support as I use this system with other controllers also.

Regards

Hi Tim. Once again, thanks for your effort.

Some issues regarding your module:

  1. It works. OpenHAB 2.5 + mysensors 2.3.1 + ethernet gateway. It connects and communicate with the modules.
  2. It doesn’t discover new sensors. Whatever I already had it worked, new sensors had to be added manually.
  3. It doesn’t work via MQTT. I suppose that is by design? I’d love to use it via MQTT because I share controllers between openhab and mycontroller, so i can do FOTA, and some topology discovery which openhab won’t do.
  4. I’m a heavy user of the rollershutter element. I don’t know if it’s on this 2.5 snapshot or the problem is that I’m not using it via MQTT anymore, but it doesn’t report cover percentaje, and of course it wont update openhab icons or labels.

Thanks again

regards

Guillermo

Is this the stable version released last weekend? Most of the posts in this thread appear to have been using 2.5 snapshots.

Openhab 2.5 stable rpm packaged version.

1 Like

Same here. I installed openhab 2.5 release and mysensors 2.4 jar stopped working. But with 2.5 jar seems things back to normal (I had my configuration in .things and .items files).

Hi Tim,
is there any location where we can find the latest code and try it out? Anything we can do to help with the MQTT part?

Kind regards,
Dries

2 Likes

Hey Dries,
the latest code is on github and yes, I’ve excluded the MQTT gateway from the current code. There were some dependency problems and the code needed some testing. I’ll look into it.

1 Like

Any help needed regarding the MQTT gateway, count me in. It’s not that mysensors can’t work without it, but it’s so much better.

You can try different controllers, you can use even different controllers at the same time. And you can benefit from it without putting pressure on the openhab (my preferred controller) developers on some functionality, i.e. FOTA or topology mapping.

There is also some simple automation that you can do “outside” openhab that it’s easier with mqtt.

Anyways, thanks A LOT for your effort.

Where, if I may ask is this github? I can’t seem to find it at your link GitHub - tobof/openhab-addons: The next-generation open Home Automation Bus (openHAB)

It all says like 11 months old there.

Thanks

There is a different branch for the bnd migration:

@Guillermo_Schimmel Maybe latest code is in branch MySensors_Binding_bnd, it is only 23 days ago :wink:

Oh I see it. Thank you very much.

Thanks for the update and info. I certainly want to help, as this library is very important for my installation and I appreciate the work you already put into this.

I can see that the move to bnd requires some big changes. That is new for me too. If you can use some help with the MQTT specific part, does it require an update to to API changes in the org.eclipse.smarthome.io.transport.mqtt library or is it also due to the bnd changes? If you can give us some pointers, I might be able to help this weekend.