Broadlink binding for RMx, A1, SPx and MP. Any interest?

Binding not work on latest 2.5 M6

2019-12-03 09:41:57.714 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler@d99458’: bundleContext

java.lang.NoSuchFieldError: bundleContext

at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.lookupCode(BroadlinkRemoteHandler.java:110) ~[?:?]

at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.handleCommand(BroadlinkRemoteHandler.java:87) ~[?:?]

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.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]

at com.sun.proxy.$Proxy409.handleCommand(Unknown Source) [?:?]

at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]

at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]

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]

@phui I have the exact same error introduced with M6. I spend all last night trying to solve it with no success.

I fall back to M5 then all error gone and work properly …

Looking at the changelog point 5 is the cause of the problem.
And it looks like the binding needs an update to work og 2.5M6 and forward.

Is it possible to disable add-in loggin? I have openhab.log file plenty of

2019-12-07 20:56:51.391 [WARN ] [nal.discovery.DeviceRediscoveryAgent] - DeviceRediscoveryAgent - Beginning Broadlink device scan for missing BroadlinkDeviceConfiguration [ipAddress=192.168.0.167 (static: false), port=80, mac=b4:43:0d:cb:f2:15, pollingInterval=30, mapFilename=null, authorizationKey=097628343fe99e23765c1513accf8b02, iv=562e17996d093d28ddb3ba695a2e6f58]
2019-12-07 20:56:51.393 [WARN ] [internal.discovery.DiscoveryProtocol] - Beginning async Broadlink device scan; will wait 5000ms for responses
2019-12-07 20:56:51.398 [WARN ] [internal.discovery.DiscoveryProtocol] - Broadlink device scan waiting for 5000 ms to complete …
2019-12-07 20:56:56.406 [WARN ] [internal.discovery.DiscoveryProtocol] - Device scan: wait complete …
2019-12-07 20:56:56.409 [WARN ] [internal.discovery.DiscoveryProtocol] - Ended Broadlink device scan…
2019-12-07 20:56:56.411 [INFO ] [link.internal.socket.BroadlinkSocket] - Socket closed
2019-12-07 20:56:56.421 [INFO ] [link.internal.socket.BroadlinkSocket] - Receiver thread ended

every minute. How can I disable it?

I forked the github project and (dirty) fixed the Broadlink binding for Openhab 2.5 M6: https://github.com/berni2288/openhab2-addons

The new jar can be downloaded from here: https://github.com/berni2288/openhab2-addons/releases/tag/2.5-M6

I basically added back the removed bundleContext to the BroadlinkRemoteHandler class. But I have read the bundleContext should not be used anymore. Maybe someone else wants to fix it properly according to this thread: [SOLVED] Cannot figure out how to avoid bundleContext.registerService()!
I didn’t want to invest too much time into this :stuck_out_tongue:

1 Like

Tried to install it several times on my 2.5-M6, unfortunately with no luck.
Maybe is just me.
fyi.

I was not luck as well. Maybe someone else help us?

Hello Berni,

I tried to use your jar but it does not work with currently version. I can see on openhab-cli

openhab> bundle:list | grep Broadlink
259 | Active | 80 | 2.5.0.201912081254 | Broadlink Binding
openhab>

but I can see on openhab paperui binding

2.5.0-SNAPSHOT
Build #1774

Did you solved it?

It works for me…
Did it work for you with the old binding? Do you have some error stacktrace?

I just compiled it again with Java 8 instead of Java 9, try this one: https://github.com/berni2288/openhab2-addons/releases/tag/2.5.0-java8

Unfortunately that’s the first time I touched the code of a Openhab binding, if this does not work for you I don’t know why.

I got no error come out with this one or previous work, but no response after, no IR send out from RM2, on RM2, red led should on when Tx IR, but no.

Albeit I am still running on 2.5M3 and everything works for me (so i’m not switching now), I just wanted to thank you for contributing. It feels like this binding really changes the use of many of our homes.

Hello,

how to choose the update for M3 or M4? I only was able to update to latest milestone and do not choose tM3 or m4

Unfortunately binding still doesn’t work for my setup 2.5 M6, I can’t even see the binding on the paper UI list.

Another colleague told me that it works for M4 versions, but I’m not sure how to choose or jump to this version

Hi everyone, I’m new around here and new to openhab too, but amazed of what you could realize with it.
Last year i bought a RM mini 3 always used with his app, worked like a charm, now that I discovered OH I’d like to integrate with it, but I’m facing some problem:
I installed the binding, and followed the steps to get it working, but I got stucked in the channel linking:
no channel is associated with the broadlink item:
brl1

I’m using Paper UI and OH 2.4 stable, these are my config files:

broadlink.items:
String AIR “Air” { channel=“broadlink:rm3:brdlk3:command” }

default.sitemap:
sitemap default label=“Test sitemaps” {
Switch item=AIR label=“Power” mappings=[AIR_ON=“On”,AIR_OFF=“Off”]
}

transform/broadlink.map:
AIR_ON=26005002100C100D0F0D0F0E0F0D0F00033973371029100D0F0D100D0F2A0F0D100D0F0D100D0F2A0F0D0F2A0F2A0F0D10291029102910290F2A0F0E0F0D0F2A0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F0E0F29100D0F2A0F0D100D0F0D102910290F0E0F0D0F0E0F0D0F2A0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F2A0F2A0F2A0F0D100D0F2A0F2A0F2A0F00048E73380F2A0F0D0F0D100D0F2A0F0D100D0F0D100D0F2A0F0D0F2A0F2A0F0D102910291029102910290F0E0F0D0F2A0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F2A0F0D100D0F0D100D0F2A0F0D100D0F0D100D0F2A0F29100D0F2A0F2A0F0D100D0F0D10290F0E0F0D0F0E0F0D0F0D100D0F2A0F0D10291029100D0F0D0F00048E733810290F0E0F0D0F0E0F29100D0F0D100D0F0D1029100D0F2A0F2A0F0D0F2A0F2A0F2A0F2A0F2A0F0D100D0F2A0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F0E0F0D0F0D100D0F2A0F0D100D0F2A0F0D100D0F2A0F0D0F0D100D0F0D100D0F2A0F2A0F0D100D0F0D0F0E0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D1029100D0F2A0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F0D100D0F2A0F2A0F0D100D0F0D100D0F0D0F0E0F0D0F0E0F0D0F0D10291029100D0F0D100D0F0D100D0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D10290F0E0F0D0F0E0F0D0F0D10291029100D0F0D100D0F0D100D0F0D0F0E0F29100D0F0D100D0F0D100D0F0D100D0F0D100D0F2A0F0D0F0E0F0D0F0D100D0F2A0F000D050000000000000000
AIR_OFF=26005002100C100D0F0D100D0F0D1000033873380F2A0F0D0F0E0F0D0F2A0F0D100D0F0D100D0F2A0F0D102910290F0E0F291029102910291029100D0F0D0F2A0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F2A0F0D0F2A0F0D100D0F0D10291029100D0F0D100D0F0D0F2A0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D10290F2A0F2A0F0D100D0F2A0F2A0F2A0F00048E73380F2A0F0D100D0F0D0F2A0F0D100D0F0D100D0F2A0F0D102910290F0E0F291029102910291029100D0F0D10290F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D10290F0E0F0D0F0E0F0D0F2A0F0D10291029100D0F2A0F2A0F0D0F2A0F2A0F0D100D0F0D1029100D0F0D0F0E0F0D0F2A0F2A0F2A0F0D10291029100D0F0D0F00048E73380F2A0F0E0F0D0F0E0F29100D0F0D100D0F0D1029100D0F2A0F29100D0F2A0F2A0F2A0F2A0F2A0F0D0F0E0F29100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D1029100D0F0D0F2A0F0D100D0F0D100D0F0D10291029100D0F0D100D0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F2A0F0D10290F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F0D0F0E0F0D0F0D100D0F0D10291029100D0F0D100D0F0D0F0E0F0D0F0E0F0D0F0D100D0F2A0F2A0F0D100D0F0D100D0F0D0F0E0F0D0F0D100D0F0D100D0F0D100D0F0D100D0F0D100D0F2A0F0D0F0E0F0D0F0D100D0F2A0F2A0F0D100D0F0D100D0F0D0F0E0F0D0F2A0F0D100D0F0D100D0F0D100D0F0D100D0F2A0F0D0F0E0F0D0F0D100D0F0D102910000D050000000000000000

I really don’t understand why it doesn’t work. Any help will be appreciated.

Hi @BundleBee - did you forget to post your rule file or is this the bit you are missing?

Hi @Andrew_Pawelski, I don’t have any rule file, it wasn’t mentioned in the installation post :thinking:

did you put broadlink.map in broadlink thing config?
did you try restart?