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

Hello,
I’m newbie and having problems with sending codes. I followed all steps and seems everything fine but openhab throwing error when I try to send codes. How can I fix the error?

2020-11-07 19:20:35.678 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.broadlink.handler.BroadlinkRemoteModel4Handler@1b49c7c’: hexString needs to have an even length:

I came here after a bit of a journey, but I think I’ve nearly reached the goal. I have a BG Electrical Smart Socket, which is shown in the Broadlink App as a compatible device. From there I found the Python script, which supports the BG1, and then here.

I’ve loaded in Beta14 and see this in my logs:

2020-11-08 21:25:54.107 [WARN ] [internal.discovery.DiscoveryProtocol] - Device scan: wait complete ...
2020-11-08 21:25:54.108 [WARN ] [internal.discovery.DiscoveryProtocol] - Ended Broadlink device scan...
2020-11-08 21:25:54.108 [INFO ] [link.internal.socket.BroadlinkSocket] - Socket closed
2020-11-08 21:25:54.108 [INFO ] [.discovery.BroadlinkDiscoveryService] - Discovery complete. Found 0 Broadlink devices
2020-11-08 21:25:57.390 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Beginning Broadlink device scan...
2020-11-08 21:25:57.390 [WARN ] [internal.discovery.DiscoveryProtocol] - Beginning async Broadlink device scan; will wait 10000 ms for responses
2020-11-08 21:25:57.392 [WARN ] [internal.discovery.DiscoveryProtocol] - Broadlink device scan waiting for 10000 ms to complete ...
2020-11-08 21:25:57.461 [ERROR] [nding.broadlink.internal.ModelMapper] - Device identifying itself as '20963' (0x51e3) is not currently supported. Please report this to the developer!
2020-11-08 21:25:57.461 [ERROR] [nding.broadlink.internal.ModelMapper] - Join the discussion at https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest/22768/616

So it looks like we’ve got a new device 20963. I couldn’t see that code mentioned in this thread so thought it’s best I mention it. Have you seen this device before?

Hi,
nice binding, a use it on oh 2.x
is there a version available for OH3
regards ?
Ronny

1 Like

I’ve made a bit of progress, but not much. I’ve added the device to the supported list and can discover the device in Paper UI
image

I can’t authenticate though. It looks like getMac() doesn’t have anything set for the string mac

    2020-11-13 15:36:40.742 [ERROR] [dlink.handler.BroadlinkSocketHandler] - bg1:c8-f7-42-97-45-33[v]: Authentication failed:
    java.lang.NumberFormatException: For input string: ""
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_252]
            at java.lang.Integer.parseInt(Integer.java:592) ~[?:1.8.0_252]
            at org.openhab.binding.broadlink.config.BroadlinkDeviceConfiguration.getMAC(BroadlinkDeviceConfiguration.java:78) ~[bundleFile:?]
            at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.buildMessage(BroadlinkBaseThingHandler.java:183) ~[bundleFile:?]
            at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.authenticate(BroadlinkBaseThingHandler.java:139) [bundleFile:?]
            at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.transitionToOnline(BroadlinkBaseThingHandler.java:273) [bundleFile:?]
            at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.updateItemStatus(BroadlinkBaseThingHandler.java:227) [bundleFile:?]
            at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler$1.run(BroadlinkBaseThingHandler.java:104) [bundleFile:?]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_252]
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_252]
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_252]
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_252]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
    2020-11-13 15:36:40.743 [ERROR] [dlink.handler.BroadlinkSocketHandler] - bg1:c8-f7-42-97-45-33[v]: Attempting to authenticate prior to getting device status FAILED. Will mark as offline

Hi all, I have been trying to get this Binding working on my 2 RM3Mini’s. I previously had them working great on BlackBeanControl using the old Exec binding but my Pi died and I didn’t have a backup so took the opportunity to upgrade. Now running 2.5.10-1 and the org.openhab.binding.broadlink-2.5.1-SNAPSHOT.jar version of the binding. It installed lovely and picked up both devices on the network but when I try and send a command I get a similar Java error.

2020-11-18 12:24:42.889 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler@4e967068’: bundleContext
java.lang.NoSuchFieldError: bundleContext
at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.lookupCode(BroadlinkRemoteHandler.java:102) ~[?:?]
at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.handleCommand(BroadlinkRemoteHandler.java:72) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor64.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
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.$Proxy550.handleCommand(Unknown Source) [?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
at org.openhab.transform.map.internal.profiles.MapTransformationProfile.onCommandFromItem(MapTransformationProfile.java:91) [bundleFile:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
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:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

not sure if it’s just me or if there is an issue with the binding on these versions or if anyone else has managed to get it working? I feel like I am so close but now looking at using exec with Python Broadlink similar to what I had before but the binding approach would be far better if it worked. Unfortunately BlackBeanControl doesn’t work now either as I believe the Python version it was on is no longer supported sadly as it worked seemlessly.

Hello Friends,
After many weeks of dead ends, I finally managed to learn my RF remotes’ codes using my RM4 Pro.

Could someone please be kind to point me to a guide on how to continue setting up the Broadlink binding so that it sends my RF commands using OpenHAB and the RM4 Pro?

My RM4 Pro is already configured as a Thing in OpenHAB, but I don’t know where I should save the RF codes for OpenHAB to use them?

I would also like to know how to configure my sitemap to include buttons that control my RF devices.

Many thanks to anyone that can point me in the right direction :pray: :pray: :pray:

[UPDATE]: I was able to find a simple guide to where and how to save the RF codes and how to add buttons for them in the sitemap.

In case someone finds it helpful, here is a link to the guide I found:

not sure if RF is working as IR
but you will need a MAP file

the map file is in the maps folder (that i cant find right now… but its in the same folder as the addon folder)

in the map file you will need to put somthing like

FAN_ON = 4353463763734 (RF CODE)
FAN_OFF = 345345345345354

then when aproching the thing in the site map or where ever else you can ask for the FAN_ON
there also a way of giving the complete code but this is not good for humens :slight_smile:

1 Like

I recently bought a new device for sending RF (BroadLink - RM4 Pro):

[ERROR] [nding.broadlink.internal.ModelMapper] - Device identifying itself as '25755' (0x649b) is not currently supported. Please report this to the developer!
[ERROR] [nding.broadlink.internal.ModelMapper] - Join the discussion at https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest/22768/616

Thanks for the binding. Could anybody help? I am getting the following problem:

I installed the latest .jar version “org.openhab.binding.broadlink-2.5.1-SNAPSHOT.jar”. I could install the binding and recognized my RM3 hardware correctly. Then I created the item line:

String FF_Library_TV_Power “TV” {channel=“broadlink:rm3:34-ea-34-40-93-68:command”}

and sitemap line:

    Switch item=FF_Library_TV_Power label="TV Power" mappings=[TV_POWER_ON="On", TV_POWER_OFF="Off"]

Everything seems ok… BUT, when I click in basic UI, I get the folloging error in the log:

2020-11-26 23:48:02.648 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler@18c0088’: hexString needs to have an even length:

java.lang.IllegalArgumentException: hexString needs to have an even length:

at org.eclipse.smarthome.core.util.HexUtils.hexToBytes(HexUtils.java:105) ~[bundleFile:?]

at org.eclipse.smarthome.core.util.HexUtils.hexToBytes(HexUtils.java:119) ~[bundleFile:?]

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

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_262]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_262]

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.$Proxy200.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_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_262]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_262]

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_262]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_262]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_262]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]

Could anybody help? Thanks!

hello everyone!

question:
is the latest version of the binding (maybe any version is… dunno) compatible with OH 3.0.M4?

I might have to migrate from OH.2.4m3 due to some new Z-Wave database devices, but i don’t want to loose this binding’s functionality… it’s been really solid.

Thanks @themillhousegroup for the amazing work, you’ve improved my home :slight_smile:

Hi Dario
To my understanding it is not yet ready at least I didn’t find anything.
I also used it under v2.5

Hey Dario,
You’re welcome!
Absolutely intending for this binding to get OH3.0 compatibility. The best way (I think…) would be to get it into the main OH codebase before 3.0 is released so that someone with more experience and time than I could then migrate it with all the other officially-supported bindings.

To this end and with thanks to @Cossey I’m making some progress towards the binding being acceptable to the maintainers. I’ve just completed an update that resyncs the binding with the latest from the OH 2.5.x branch, meaning that the amount of work needed to merge it with the main codebase is minimised.

While there I’ve also added support for the following devices:

  • RM4c Mini (0x6539) thanks to a PR from Joshua Hampp
  • RM4 Pro (0x649b) as reported by @frest

You can grab this new version (release BETA 16) from here:

BTW @Rob_Pope I’d love to add support for your BG Electrical device 0x51e3 - can you tell me a bit more about it - specifically, which Broadlink device does it most resemble?

Cheers,
John

BTW @Rob_Pope I’d love to add support for your BG Electrical device 0x51e3 - can you tell me a bit more about it - specifically, which Broadlink device does it most resemble?

Physically it’s most similar to an M1 power strip, but with two sockets instead of four. Judging by the code implemented by others, it’s controlled differently. There’s a JSON body put together with the attributes that you want to change and sent as a payload to the device.

I started updating your code to work with it, but only got as for as an Auth, sending data failed - probably as I’m terrible at bit operations and the encoding failed. Then I got frustrated with the screen resolution on my laptop, bought a new one and wiped the code. I might have a backup that I’ll pop on my git over the weekend.

Hello,
Im trying to connect two SP3S. Im using the last addon org.openhab.binding.broadlink-2.5.9.jar. The problem is probably that it recognizes the Thing as SP2 or SP3 without ‘S’ because i dont have a Nightlight but Power consumption:

just got my RM4 pro and added the latest version (Beta 16). Added device manually (IP and MAC) and get this error.
Am I missing something as no docs on git that i can see.

==> /QPKGs/OpenHab/userdata/logs/openhab.log <==

2020-12-15 14:14:43.702 [ERROR] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Authentication failed: 

2020-12-15 14:14:43.703 [ERROR] [handler.BroadlinkRemoteModel4Handler] - Broadlink Exception: 

java.net.ProtocolException: Response from device is not valid. (0x22=0xFF,0x23=0xFF,0x24=0xFF)

	at org.openhab.binding.broadlink.internal.BroadlinkProtocol.decodePacket(BroadlinkProtocol.java:195) ~[bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.decodeDevicePacket(BroadlinkBaseThingHandler.java:180) ~[bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.authenticate(BroadlinkBaseThingHandler.java:140) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.transitionToOnline(BroadlinkBaseThingHandler.java:263) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.updateItemStatus(BroadlinkBaseThingHandler.java:216) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler$1.run(BroadlinkBaseThingHandler.java:104) [bundleFile:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_241]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_241]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_241]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_241]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_241]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_241]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_241]

2020-12-15 14:14:43.704 [ERROR] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Attempting to authenticate prior to getting device status FAILED. Will mark as offline

2020-12-15 14:14:43.705 [WARN ] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Online -> Offline due to: Couldn't authenticate

2020-12-15 14:15:08.492 [INFO ] [ntesisbox.internal.IntesisBoxHandler] - keep alive sent

2020-12-15 14:15:08.512 [INFO ] [ntesisbox.internal.IntesisBoxHandler] - keep alive sent

2020-12-15 14:15:08.600 [INFO ] [ntesisbox.internal.IntesisBoxHandler] - keep alive sent

2020-12-15 14:15:13.728 [ERROR] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Authentication failed: 

2020-12-15 14:15:13.728 [ERROR] [handler.BroadlinkRemoteModel4Handler] - Broadlink Exception: 

java.net.ProtocolException: Response from device is not valid. (0x22=0xFF,0x23=0xFF,0x24=0xFF)

	at org.openhab.binding.broadlink.internal.BroadlinkProtocol.decodePacket(BroadlinkProtocol.java:195) ~[bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.decodeDevicePacket(BroadlinkBaseThingHandler.java:180) ~[bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.authenticate(BroadlinkBaseThingHandler.java:140) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.transitionToOnline(BroadlinkBaseThingHandler.java:263) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.updateItemStatus(BroadlinkBaseThingHandler.java:216) [bundleFile:?]

	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler$1.run(BroadlinkBaseThingHandler.java:104) [bundleFile:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_241]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_241]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_241]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_241]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_241]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_241]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_241]

2020-12-15 14:15:13.729 [ERROR] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Attempting to authenticate prior to getting device status FAILED. Will mark as offline

2020-12-15 14:15:13.729 [WARN ] [handler.BroadlinkRemoteModel4Handler] - rm4:c0611c45[v]: Online -> Offline due to: Couldn't authenticate

==> /QPKGs/OpenHab/userdata/logs/events.log <==

Hi All,

Running the beta 16 version of the binding on OH 2.5.11 Release and keep coming across the following errors. As far as I can tell, the devices aren’t dropping off the LAN so at a loss. Can anybody shed any light?

2020-12-23 11:38:37.008 [WARN ] [dlink.handler.BroadlinkRemoteHandler] - rm3:34:EA:34:58:C7:78[^]: Online -> Offline due to: Couldn’t find statically-IP-addressed device

2020-12-23 11:38:37.009 [hingStatusInfoChangedEvent] - ‘broadlink:rm3:34:EA:34:58:C7:78’ changed from ONLINE to OFFLINE: Couldn’t find statically-IP-addressed device

2020-12-23 11:38:58.070 [hingStatusInfoChangedEvent] - ‘broadlink:rm3:34:EA:34:58:C7:78’ changed from OFFLINE: Couldn’t find statically-IP-addressed device to ONLINE

2020-12-23 11:39:47.573 [WARN ] [dlink.handler.BroadlinkRemoteHandler] - rm3:34:EA:34:58:C7:78[^]: Online -> Offline due to: Couldn’t find statically-IP-addressed device

2020-12-23 11:39:47.574 [hingStatusInfoChangedEvent] - ‘broadlink:rm3:34:EA:34:58:C7:78’ changed from ONLINE to OFFLINE: Couldn’t find statically-IP-addressed device

Happy new year

Is there a version of the addin compatible to OH 3.0?

3 Likes

meneldor i didn’t see working solution for SP3S. Maybe some hardware problems, to get power consumption data?

Hi everyone,
As per @nakh_Home asked, is there any update about OH3 binding?
Thanks a lot and happy holidays!

Hi All,

see also OH3 UI IR widget

Thanks for all the good work
Happy holidays

Ronny