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

Just removed and replaced the new version of the binding…unfortunately the same issue remains.

The binding autodiscovers the device.

I enter the key and vector, and the device reports back could not find a device at that IP.

Does the communication happen on any specific ports?

what is the device type discovery sets for you?

port: yes as discovered port 80 (but it’s not http, just the weird broadlink udp protocol)

did you already enable debug logging? imo there are a few log lines missing log:set debug org.openhab.binding.broadlink

Here’s the log which includes discovery and a bit afterwards

30-Mar-2020 20:29:35.536 [WARN ] [dlink.internal.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Beginning Broadlink device scan...
30-Mar-2020 20:29:35.536 [WARN ] [ing.broadlink.internal.discovery.DiscoveryProtocol] - Beginning async Broadlink device scan; will wait 10000 ms for responses
30-Mar-2020 20:29:35.721 [WARN ] [ing.broadlink.internal.discovery.DiscoveryProtocol] - Broadlink device scan waiting for 10000 ms to complete ...
30-Mar-2020 20:29:35.864 [INFO ] [dlink.internal.discovery.BroadlinkDiscoveryService] - Data received during Broadlink device discovery: from 10.x.xx.xxx:80 [78:xx:xx:xx:xx:xx]
30-Mar-2020 20:29:35.865 [DEBUG] [dlink.internal.discovery.BroadlinkDiscoveryService] - Adding new Broadlink device on 10.x.xx.xxx with mac '78:xx:xx:xx:xx:xx' to Smarthome inbox
30-Mar-2020 20:29:35.865 [DEBUG] [dlink.internal.discovery.BroadlinkDiscoveryService] - Device 'broadlink:rm3:78:xx:xx:xx:xx:xx' discovered at '10.x.xx.xxx'.
30-Mar-2020 20:29:41.811 [DEBUG] [binding.broadlink.internal.BroadlinkHandlerFactory] - Creating Thing handler for 'broadlink:rm3'
30-Mar-2020 20:29:41.811 [DEBUG] [binding.broadlink.internal.BroadlinkHandlerFactory] - RM 3 handler requested created
30-Mar-2020 20:29:45.721 [WARN ] [ing.broadlink.internal.discovery.DiscoveryProtocol] - Device scan: wait complete ...
30-Mar-2020 20:29:45.721 [WARN ] [ing.broadlink.internal.discovery.DiscoveryProtocol] - Ended Broadlink device scan...
30-Mar-2020 20:29:45.721 [INFO ] [.binding.broadlink.internal.socket.BroadlinkSocket] - Socket closed
30-Mar-2020 20:29:45.721 [INFO ] [dlink.internal.discovery.BroadlinkDiscoveryService] - Discovery complete. Found 1 Broadlink devices
30-Mar-2020 20:29:45.721 [INFO ] [.binding.broadlink.internal.socket.BroadlinkSocket] - Receiver thread ended
30-Mar-2020 20:30:13.339 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: initializing
30-Mar-2020 20:30:13.341 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: initialization complete. Updating status.
30-Mar-2020 20:30:14.745 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: We've never actually successfully authenticated with this device in this session. Doing so now
30-Mar-2020 20:30:14.745 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: 39079
30-Mar-2020 20:30:14.745 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: java.lang.IllegalArgumentException: Empty key
30-Mar-2020 20:30:14.745 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: Attempting to authenticate prior to getting device status FAILED. Will mark as offline
30-Mar-2020 20:30:14.745 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[?]: updateItemStatus: Online -> Offline
30-Mar-2020 20:30:14.747 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: REFRESH
30-Mar-2020 20:30:45.176 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: We've never actually successfully authenticated with this device in this session. Doing so now
30-Mar-2020 20:30:45.176 [DEBUG] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: 39080
30-Mar-2020 20:30:45.177 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: java.lang.IllegalArgumentException: Empty key
30-Mar-2020 20:30:45.177 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: Attempting to authenticate prior to getting device status FAILED. Will mark as offline
30-Mar-2020 20:30:45.177 [ERROR] [b.binding.broadlink.handler.BroadlinkRemoteHandler] - rm3:78-0f-77-1a-13-38[v]: updateItemStatus: Online -> Offline

Well…

For some unknown reason, I pulled up PaperUI this morning and low and behold the broadlink thing is ONLINE!!!

I’ll start testing to make sure things work as expected.

Squid

Hi @KidSquid , sometimes my rm4 mini goes offline to, i discovered that when this happen the key retrieved by thing is empty https://github.com/tknaller/openhab2-addons/pull/1#discussion_r400399458
but i don’t know why, maybe some openhab expert tell us something.

Hi everyone,
Sorry about the problems with device initialization; I was doing some tidying-up to get the code to pass all of the formatting checks required to get this binding merged into the main openHAB source, and managed to mess up what should have been an innocent change.

Anyway, here’s BETA 2 of the 2.5 binding. @tknaller if you’d like to reissue your PR for the additional device support I’ll gladly merge it.

https://github.com/themillhousegroup/openhab2-addons/releases/download/BROADLINK_2.5.BETA_02/org.openhab.binding.broadlink-2.5.1-SNAPSHOT.jar

Cheers,
John (themillhousegroup)

2 Likes

done, i’m glad you are continuing :slight_smile:
i am running on the version of my new pull request now :+1:

I’m following this thread but need help,

I’m am using 3x RM4C Mini (Bestcon branded) working with broadlink app (Android)

Questions:

  1. Broadlink = Bestcon?
  2. Are these compatible with this binding?
  3. How to get the necessary key?

I got my devices before I started using OpenHAB.

1 Like

I can answer one of your three questions…

Search this thread for the key and the vector

Hi @tknaller,
Thanks so much for your contribution. It’s been merged and built into BETA 3 of the 2.5.x binding:

https://github.com/themillhousegroup/openhab2-addons/releases/download/BROADLINK_2.5.BETA_03/org.openhab.binding.broadlink-2.5.1-SNAPSHOT.jar

Cheers,
John

3 Likes
  1. Yes
  2. Yes

Hello,
I’ve installed this jar on OH 2.5.3. Broadlink RM2 thing added and configured. Can read temperature but when sending command - getting error without any details, even with log:set debug org.openhab.binding.broadlink

12:32:17.362 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'BroadlinkRM2_Command' received command AC_AUTO
12:32:17.448 [INFO ] [arthome.event.ItemStatePredictedEvent] - BroadlinkRM2_Command predicted to become AC_AUTO
12:32:17.474 [INFO ] [smarthome.event.ItemStateChangedEvent] - BroadlinkRM2_Command changed from NULL to AC_AUTO
12:32:17.496 [DEBUG] [.handler.BroadlinkRemoteModel2Handler] - rm2:aa-bb-cc-dd-ee-ff[^]: AC_AUTO
12:32:17.508 [ERROR] [.handler.BroadlinkRemoteModel2Handler] - rm2:aa-bb-cc-dd-ee-ff[^]: Broadlink RM2 [1.2.3.4]

Hi friends,
Hope you and your families are all well and healthy.
Does this binding works with the Broadlink RM4 Pro?
I just added the binding to my OpenHAB 2.5.3 system, but when I search for my RM4 Pro in the Inbox, it is not found.

Hi @mjeshurun -
It’s probably not recognised by the binding because of a missing identification code.
If you’re able to check your OpenHAB logs, you should hopefully find a message with something like "Device identifying itself as 'XXXX' is not currently supported. Please report this to the developer!"

If you can find this line, please reply back here with the ‘XXXX’ value, and I’ll add it as an RMx Remote device. I don’t know if it adds any capabilities over other older RMx devices - if so, that will take a bit longer/more effort to add support. But one step at a time :slight_smile:

1 Like

Hi John,
Thank you for the explanation :slight_smile:
I was able to find the error message on my OpenHAB log.
“Device identifying itself as ‘24994’ is not currently supported. Please report this to the developer!”
Hope you can fix this. I don’t think the RM4 Pro has any new special features.

New binding version for OpenHAB 2.5.x:

BETA 4 is now available for download:
https://github.com/themillhousegroup/openhab2-addons/releases/download/BROADLINK_2.5.BETA_04/org.openhab.binding.broadlink-2.5.1-SNAPSHOT.jar

This includes support for all (known) variants of the RM4 remote blaster - namely the RM4 Pro, RM4b, RM4c and RM4 Mini (really Broadlink, really?)

As usual please let me know if you encounter any issues.

Cheers,
John

4 Likes

Hi John,
Thanks for the updated plugin.
OpenHAB now recognizes my device in the inbox, but i’m getting an “ERROR: 409 - Conflict” message when trying to add the thing.
Looks like the device isn’t fully recognized. Under the Broadlink RM4… title, it’s showing “Unknown device” (see screenshot).

409 conflict typically means there are remnants of your previous thing. It may not have been completely uninstalled. You may need to go into the REST api interface and make sure it’s fully removed.

Thanks for the explanation, @KidSquid.
I never added any Broadlink devices as things to my OpenHAB system before.
So I’m not sure what could cause the conflict

Sometimes just copying over the top of an existing .jar doesn’t cleanly upgrade.

It’s probably best to do it in discrete steps:

  • move the Broadlink .jar file out of your addons directory
  • let OpenHAB “recover” from that binding being unloaded (watch the logs until they are quiet)
  • then move the .jar back into addons.
2 Likes