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

Yes I have seen them before, but I believe they only show up when you create certain types of pages. If you don’t want to create custom pages and just set a default display widget when clicking on equipment in the semantic system it does not offer anything I can see that will then carry over into all auto generated UI lists. Since I don’t need to do this and don’t own any broadlink products it is not high on my list of things to look at but thanks for posting that it is possible with those widgets/cards.

@themillhousegroup
Can we RM4mini owners do something for helping you ? Did you need more Info? / Logs?

I previously attempted to add the BG1 and U01 with limited success. You can find repo here.

It worked ok for a while, then I changed something and haven’t been able to get it working again since :roll_eyes:

@themillhousegroup @matt1

Fixes

  • Power consumption calculations for SPxS devices

I think the problem persist, I’ve connected for example, a sonoff th16 to the SP3s plug and he tells me that consumption is 130w:

Screenshot_20210704_212327

In a xiaomi plug, the consumption is 0.52w and with the broadlink-mqtt project tells me the same thing:

Screenshot_20210704_212648

Best Regards,
Fernando Gomes

OK thanks for the bug reports all. I’ve been away for the last few days but I can see the problem affecting RM4 devices which would stop them entering learn mode thanks @cwi , and an actual example of the power consumption figures is really useful for the SPxS devices too - thanks @fapg

Should have a new version up shortly. Cheers.

1 Like

New version of the binding is out:

I’m hopeful to have finally sorted out the SP3S power consumption calculation, and I’ve also taken delivery of an RM4 Pro so was able to sort out issues with learning-related commands and command sending.

This version is based on the openHAB 3.2 sources but I’ve been testing it on my openHAB 3.1 system with no problems noted. As usual, please take care when updating the binding; note especially that the actual filename of the JAR has changed so you’ll need to remove the old 3.1 binding. For safety, I’d recommend the following:

  • Remove all your Broadlink Things
  • Delete the Broadlink 3.1 JAR file from addons
  • Let the system stabilise
  • Shut down your openHAB server
  • Copy the new 3.2 JAR into addons
  • Restart your openHAB server
  • Rediscover your Broadlink Things

Cheers,
John

3 Likes

Your new version looks good in conjunction with RM4mini, even with learn mode as you described in an earlier post. Testing on oh3.1 release version.
One comment: When triggering “Check last captured IR code” a second time after its learning, or after no code learnt (e.g. after timeout), it runs into a failure, which you might be able to avoid, see log below. I guess it is OK to notify that a learnt code can only be presented once or no (new) code available, so needs re-learning.

2021-07-08 09:10:51.437 [TRACE] [handler.BroadlinkRemoteModel4Handler] - Sending learning-channel command CHECK
2021-07-08 09:10:51.440 [TRACE] [handler.BroadlinkRemoteModel4Handler] - Sending send learnt code check command to <ip>:80
2021-07-08 09:10:51.441 [TRACE] [handler.BroadlinkRemoteModel4Handler] - Sending send learnt code check command complete
2021-07-08 09:10:51.443 [TRACE] [handler.BroadlinkRemoteModel4Handler] - Awaiting send learnt code check command response
2021-07-08 09:10:51.517 [TRACE] [handler.BroadlinkRemoteModel4Handler] - Received send learnt code check command (72 bytes)
2021-07-08 09:10:51.519 [WARN ] [handler.BroadlinkRemoteModel4Handler] - Exception while attempting to check learnt code
java.net.ProtocolException: Response from device is not valid. (0x22=0xFB,0x23=0xFF)
	at org.openhab.binding.broadlink.internal.BroadlinkProtocol.decodePacket(BroadlinkProtocol.java:192) ~[bundleFile:?]
	at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.decodeDevicePacket(BroadlinkBaseThingHandler.java:183) ~[bundleFile:?]
	at org.openhab.binding.broadlink.handler.BroadlinkRemoteModel4Handler.extractResponsePayload(BroadlinkRemoteModel4Handler.java:95) ~[bundleFile:?]
	at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.sendCheckDataCommandAndLog(BroadlinkRemoteHandler.java:114) [bundleFile:?]
	at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.handleLearningCommand(BroadlinkRemoteHandler.java:131) [bundleFile:?]
	at org.openhab.binding.broadlink.handler.BroadlinkRemoteHandler.handleCommand(BroadlinkRemoteHandler.java:170) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor171.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy16743.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [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.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.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) [?:?]

Hello John - great work - thank you for fixing the rm4mini leraning channel - i´ts working now!

It´s very iportant to follow the recommanditions of John aka the @themillhousegroup for installing the Binding…, without deleting and unlinking all device and giving enough time after erease the old jar file… stopping openhab copy the new one starting openhab… it will not work!

It´costs me 2 hrs for trying the quick and dirty way… had to reinstall the version before … After clean Reinstall with de advice of John the rm4mini also is working now with open hab!

The Errors wich Carl was reporting before i can also confirm - i have the same behavior when i try to show the last learned code a second time…

Thanks a lot for this great working binding!

Binding looks good. I have 3 remote controls and I created one item and 3 rules .One for each remote.
I created 3 remote widgets. It all works well.
Below is what I did, more or less.

@ubeaut
What do you need the broadlink-mqtt for? Is that a replacement for the broadling-binding?

I have only 1 item, no rules and 4 different remote control widgets. Works great :slight_smile:

I didn’t install the binding.
I did mine before I saw the binding but mine is working.
How is yours set up?
I really couldn’t find the instructions for this binding (granted I didn’t look too hard)
If your set up is easier I might install the binding.

The binding offers a “command” channel. You just have to link that channel to an item of type “string”.
Then you can assign the commands to the string item and there you go…


Optionally, you can save the IR-codes in a .map file, so you can use “pretty” names e.g. in your widgets.
So my widget definition on the pages has the pretty names, e.g.

          slots:
            default:
              - component: widget:UniversalRemote2
                config:
                  item: BroadlinkRMPro
                  power: SAT_POWER
                  volumeup: SAT_VOL_UP
                  volumedown: SAT_VOL_DOWN
                  devicetype: Sat
                  volumemute: SAT_MUTE
                  channelup: SAT_CH_UP
                  channeldown: SAT_CH_DOWN
1 Like

Interesting but how do you get the IR commands from the remotes?
In other words how do you get into learn mode?
I have a test system I can try all this on.

Previously you had to use other tools to get the code, but as I read in this thread, the binding now offers a learning mode. I have not tried that yet.

I used

to get my codes.

OK thanks. I think I will just stick with how I have it as the way I do it generates the codes into the folders etc.

Instructions fpr learning channel… Broadlink binding for RMx, A1, SPx and MP. Any interest? - #1411 by themillhousegroup

Thanks i did see that but it didn’t make any sense as I haven’t installed the binding.
I might play with it on my test system just to see how it works.

Hmm @millhousegroup there is one point interesting… may be there is a way to store the Learned automatically in the broadlink.map … Me be with option to Insert also the Command name ?

hi guys,i just got a RM4 mini,is it supported by this binding at openhab2.5.x?If yes where can i find the right jar? thnx!

OpenHAB has a StorageService which allows storing data internally. The MAP could be removed then.