-
No, do not rename the jar file - keep the .jar file extension as it is.
-
I have always changed the owner and group to “openhab”. As long the file permission is at least -r–r–r–, it should be okay.
I updated from
org.openhab.binding.broadlink-3.2.0-SNAPSHOT.jar
to
org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar
today.
My RM Pro was online immediately, but my RM4 Pro, which was added via a .things file before, was not showing up. I deleted the .things file and added the RM4 Pro via scan, which worked fine
I was very surprised, when I saw that the RM4 Pro offers separate channels for IR and RF, but the RM Pro does not. Was that a change in the binding to offer separate channels for RF and IR?
Also noticed that neither IR, nor RF is working with the RM Pro
Tested only IR with the RM4 Pro, but also does not work
Does the binding still use the broadlink.map file?
edit:
I enabled DEBUG logs for the binding, now I see something like this in the logs
2024-05-23 12:52:34.268 [DEBUG] [dler.BroadlinkRemoteModel4ProHandler] - Handling ir command ‘AMP_DENON_POWER’ on channel command of thing Broadlink RM4 Pro
2024-05-23 12:52:34.276 [DEBUG] [ink.internal.BroadlinkMappingService] - IR Command not label found.
Any guess what could be wrong? The broadlink.map file contains an entry for this label:
AMP_DENON_POWER=260066000A180A3A0B180A180B170B3A0B170B170B180A180A180B3A0A3A0B180A180A0005F40A180B3A0A180B170B170B180A3A0B3A0B3A0A3B0A3A0B180A180A3A0B3A0B0005690B170B3A0A180B170B180A3A0B170B180A180A180B170B3A0B390B180B170B000D050000
edit 2:
OK, I have looked at the source code and read the readme.md file. Seems like a broadlink.map file is not supported anymore. The readme.md explains how the old format can be converted into the new format using a python script.
2 questions come up now:
- Is there no automatic conversion available?
- I have RF- and IR-Commands in one .map file. Do I have to split the file, before converting?
@mjeshurun Can you see the binding in the UI? It should appear there in the section “Other Add-Ons”.
There you can also configure the logging for the binding, see my screenshots
Hi @Bernd_Ritter , thank you for your suggestion.
My OpenHAB 4.1.2 system fails to see/start the org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar file which I saved in the openhab/addons folder, so, unfortunately, the Broadlink Binding is not showing up on my Other Add-ons list.
I’m not sure what to do to fix this.
@AntonJansen was very kind and tried to help me a few days ago, but we couldn’t get it to work.
Hi Bernd,
-
See the documentation, there is a python script you can use to convert the old map file to the new json db format.
-
You do need to split between IR and RF commands.
-
IR/RF should also work for your RM Pro. Which device type is reported by the thing created for the RM Pro?
The RM Pro is reported as RM2. But the thing was created with the old binding.
I will try to delete the thing and recreate it with the new binding tomorrow.
We will see, if I get separate channels for RF and IR there too
Did not get an RF command-channel, after deleting the thing and scanning for it
I see in rm-types.xml, that RM2 does not support a RF channel:
<thing-type id="rm2">
<label>Broadlink RM2</label>
<description>The Broadlink RM 2/Pro is a Wi-Fi IR/RF transmitter with a temperature sensor.</description>
<channels>
<channel id="command" typeId="command"/>
<channel id="temperature" typeId="temperature"/>
<channel id="learningControl" typeId="learningControl"/>
</channels>
<representation-property>macAddress</representation-property>
<config-description-ref uri="thing-type:broadlink:rmconfig"/>
</thing-type>
So how is RF supposed to work with RM2?
By the way: IR and RF with RM4 Pro is now working here!
But there is a strange log message, every time the RM4 Pro executes a RF command, because the handleCommand method in class BroadlinkRemoteHandler is also called, after the RF command was handled in handleCommand of BroadlinkRemoteModel4ProHandler:
Thing Broadlink RM4 Pro has unknown channel type ‘rfcommand’
2024-05-24 09:16:19.500 [DEBUG] [ink.internal.BroadlinkMappingService] - RF Command label found. Key value pair is RS_LIVING1_UP,b200be0044090b4243094409430a0a424409440943090b424409430a43090b42430a0b4144090b00021144090b424309440944090b424309440943090c414409430a43090b42430a0b4243090b00021243090b424409430944090b42430a430944090b42430a430944090b4243090b4244090b00021144090b4144094409430a0b414409430a43090b424409430944090b4244090b4243090b00021243090b424408440944090b4243094409430a0a4244094409430a0a4244090b4244080b0005dc00000000000000000000
2024-05-24 09:16:19.504 [DEBUG] [dler.BroadlinkRemoteModel4ProHandler] - Transformed command 'RS_LIVING1_UP' for thing Broadlink RM4 Pro
2024-05-24 09:16:19.547 [DEBUG] [dler.BroadlinkRemoteModel4ProHandler] - Thing Broadlink RM4 Pro has unknown channel type 'rfcommand'
Maybe the call to
super.handleCommand(channelUID, command);
should better be in the default-section of the switch-block?
I think the mapping of the deviceType is wrong. Could you share what deviceType is reported on the Things page? It should look like this when you expand the Thing properties:
Please let me know which number is reported for the deviceType (as highlighted in the red box in the picture).
With respect to the debugging message; this is by design. The RM4 Pro class extends a base class as some clean up is happening there. I did not want to replicate the code. It could use a bit more clean up, but it is a minor thing.
Yep, I understand. Was just a suggestion to move the call to the base class like this:
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
ChannelTypeUID channelTypeUID = extractChannelType(channelUID, command);
if (!Utils.isOnline(getThing())) {
logger.debug("Can't handle command {} because handler for thing {} is not ONLINE", command,
getThing().getLabel());
return;
}
if (command instanceof RefreshType) {
updateItemStatus();
return;
}
if (channelTypeUID == null) {
return;
}
switch (channelTypeUID.getId()) {
case BroadlinkBindingConstants.RF_COMMAND_CHANNEL: {
byte code[] = lookupRFCode(command, channelUID);
if (code != null) {
sendCode(code);
} else {
logger.warn("Cannot find the data to send out for command {}", command.toString());
}
break;
}
case BroadlinkBindingConstants.RF_LEARNING_CONTROL_CHANNEL: {
switch (command.toString()) {
case BroadlinkBindingConstants.LEARNING_CONTROL_COMMAND_LEARN: {
handleFindRFFrequencies();
break;
}
case BroadlinkBindingConstants.LEARNING_CONTROL_COMMAND_CHECK: {
handleFindRFCommand(false);
break;
}
case BroadlinkBindingConstants.LEARNING_CONTROL_COMMAND_MODIFY: {
handleFindRFCommand(true);
break;
}
case BroadlinkBindingConstants.LEARNING_CONTROL_COMMAND_DELETE: {
deleteRFCommand();
break;
}
default: {
// this should never happen, should it?
}
}
}
break;
default:
super.handleCommand(channelUID, command);
}
}
I had the same issue. First, avoid renaming or modifying the downloaded jar file, and copy it to the add-on folder.
How I got it fixed:
- ssh to the Openhab host and login as user with root access
- sudo -i
- systemctl stop openhab.service
- open-cli clean-cache
- shutdown -r now
After the reboot and when openhab is restarted, it should show up in the Other Add-ons list.
Hi Matt,
Thank you for your suggestion
I tried to delete the cache and tmp folders and then reboot (as directed in this forum thread Clear the Cache - #101 by HaKuNa ), but it didn’t do the trick.
My OpenHAB system still doesn’t recognize the binding.
Okay, I didn’t get it that easy either…
- ssh to the Openhab host and login as user with root access
- Navigate to your addons directory
- Rename your Broadlink jar file to something else to stop OpenHAB from loading it - eg. mv org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar.disabled
- ssh -p 8101 openhab@localhost
- bundle:list
- Look for the number in the first column of the line that has the words “Broadlink Binding” at the end
- bundlle:uninstall {number}
- bundle:list
- Verify that there is no more line ending with “Broadlink Binding”
- logout
- sudo -i
- systemctl stop openhab.service
- open-cli clean-cache
- shutdown -r now
- Login to Openhab host once it has completed restarted
- Navigate to your addons directory
- Restore name of your Broadlink jar file - eg. mv org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar.disabled org.openhab.binding.broadlink-4.2.0-SNAPSHOT.jar
- Wait a few minutes and then check OpenHAB log for indications that the binding is detected and loaded. If it’s not, reboot and check again.
- If it still does not work, repeat the steps here from the beginning.
Good luck.
Having trouble learning codes, added an RM4 pro Thing successfully and have Temperature and Humidity readings. But when I try steps below I get stuck at step 4, as the “rectangular area that is marked NULL” can not be clicked and no pop-up menu appears as detailed in step 5 below.
Any ideas or suggestions?
To obtain the command codes, you can get this binding to put your Broadlink RMx device into “learn mode” and then ask it for the code it learnt. Here are the steps:
0. In the openHAB web UI, navigate to your RMx Thing
1. Set the Name of IR/RF command to learn property to the name of the command you want the device to learn
2. Click on its Channels tab
3. For IR find the Remote Learning Control channel and create an Item for it, for RF use the Remote RF Learning Control channel instead.(Only needed the first time)
4. Click the item, and click the rectangular area that is marked NULL
5. In the pop-up menu that appears, select Learn IR command for IR or Learn RF command for RF
Many thanks for the detailed explanation
I ran the bundle:list
command in the OpenHAB console, but I’m not seeing any line with reference to the Broadlink Binding.
I think that’s the main problem. My OpenHAB 4.1.2 docker instance, just doesn’t recognize the Broadlink Binding jar file that I copied into the addons folder, so it doesn’t show up as a listed bundle.
mjeshurun, did you previously install a non-docker OpenHAB in the same machine?
If yes, are the previous OpenHAB directories and files still there?
What I am getting at is the possibility that you may have drop the jar file in the wrong addons directory.
I am having trouble with the RM 4 mini with RF learning:
a) I am not seeing the option to learn RF commands
b) I also have an RM4 pro - and if I learn with that, it instantly says it has learned the command before I have pressed a button on the remote.
RM4 Mini does not support RF, only IR
On this machine I only installed OpenHAB with docker.
I copied the updated 4.2.0 jar file into the same addons folder the old 3.4.3 jar file was in.
Until I updated OpenHAB to version 4.1.2, everything worked great with the broadlink binding when I used the 3.4.3 jar file, so I don’t understand why things aren’t working now
Hi Sam, did you make any additional steps to get the learning commands menu appear? How did you add the associated Item for the RM4 pro RF command learn channel?
Would appreciate any pointers.
Thanks