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

Most blinds on a multi program remote have an “all” channel usually 0 which send all channels up and down. My remote also allows blinds to be grouped to be programmed to a Specific channel

Failing that run the commands one after the other in a rule

I have read about rules, but I don’t get how to use rules with this binding.
Can you give an example? How does a rule work together with the .map file?

I know the thread is dautingly long, but there are many rules examples, just take your time to sift throgh it.

Generally it works like this:

In the broadlink.map file you have a commmand lights_toggle=[HexCodeHere].
As far as openhab is concearned that is “a string with a name”.

Than you have your broadlink RM thing created within the binding.
you can now either link all the items representing your devices to it, or create only one item connected to it, representing the RMdevice itself (this depends on you logic needs and preferences).

Whenever one of the command arrives at any item linked to the binding’s channel sendCommand(RM_X,lights_toggle) it gets converted into the hex code in the map and sent.

Now , in regards to your question to close all blinds- as you might have guessed rf433 can’t transmit more than one command at a time.
You will first need to acquire all of the commands for every single blind, and understand the lenght (in ms) it needs to be sent properly, and than send them in a timed queue one after the other.

To do that, you can write a rule with many timers or Thread::sleep, however that poses some issues, so i posted a while back a working buffering rule with explanations.

Also, it is your choice whether to

  • create many blinds items (all linked to the broadlink binding channel), and a blinds group item to command them all at once
  • create many blind items (all unlinked to any channel and they all send commands through rules to a RM_in item- see the mentioned buffering method above) , and a blinds group item to command them all at once
  • create one ALL_Blinds item that triggers within a rule all the sendCommands you need
    Any of the above will work for you
2 Likes

Hello, can you explain to me why if I test several times the same key I obtain different codes as follows:

TV_VOL_MOINS = 2600f80000011f9512131014113811141114101411141114103912371213103912371138113910391138113811141114101510141114101411141015103910391237113910391237120005220001244b12000c4b0001254a12000c4a0001254a12000c4a0001254a11000c4c0001254a12000c4a0001244b12000c4a0001264a12000c4a0001244c10000c4c0001244c12000c4a0001254a11000c4b0001254a12000c4a0001264a12000c4a0001244b12000c4a0001264a12000c4a0001264912000c4b0001254a12000c4b0001254a12000c4a0001254a12000c4a0001254a12000c4a0001264913000c490001264a12000c4a0001254a12000d05

TV_VOL_MOIN2 = 2600500000011f9512141113123712131213121113131213123610391016123613361336133710391336133611151213121212131213111312131213113713361237133614361039130005200001274910000d050000000000000000

TV_VOL_MOIN3 = 2600600000011f9510141114103911141015101411150f141139103910160f39103910391138113910391039111410160f150f15101411150f160f15103811391039103911381139100005230001244c10000c4b0001234c10000c5000011f4b10000d050000000000000000

TV_VOL_MOIN4 = 2600880000011f9511141015103910151014111410141114113812381014113812381039103911381238123710151014111410151014121310151014113811391039103910391237110005230001254b12000c490001264a11000c4a0001244b12000c4b0001254a12000c4b0001234b11000c4b0001254b10000c4b0001254b12000c4a0001254a11000d05

for the last example the complete line is:
{“api_id”:1004,“command”:“send_code”,“mac”:“XX:XX:XX:XX:XX:XX”,“data”:“2600880000011f9511141015103910151014111410141114113812381014113812381039103911381238123710151014111410151014121310151014113811391039103910391237110005230001254b12000c490001264a11000c4a0001244b12000c4b0001254a12000c4b0001234b11000c4b0001254b10000c4b0001254b12000c4a0001254a11000d05”}
Thank’s

My only guess is that your device might have rolling code encription.
I am really not sure whether you can implement it with the binding( i don’t think so)

I found a solution that appears much simpler and does not require much manipulation because we import all the codes in one operation. I tested some codes and it seems to work for me. I give the manipulation and tell me if it’s OK for you…

1 - Download and decompress Broadlink Manager:

2 - download (Android phone or tablet) the e-Control application from Broadlink on the PlayStore
or Here.

3 - Record all the remotes you want in E-Control…

4 - Then in the e-Control menu, click on “Share” -> “Share to other phones on the network in WLAN”, a popup is displayed: click on “Cancel” to close it. You can then leave the 'application.

5 - Connect your phone or tablet to your PC and transfer the 4 files: jsonButton - jsonDevice - jsonIrCode - jsonSubIr which are in the folder “/ broadlink / newremote / SharedData” in the directory where you

6 - unplug your phone or tablet and run “Broadlink.WinApp.exe”
7 - click “Scan” and the prog should find your RMx
8 - click on “Transfer econtrol” the prog answers “Successful import!”
9 - click on “Save” and a file “Orders.Json” is created in the same directory

It only remains to open it and import the lines of Data
//////
“ID”: “1”,
“Key”: “tv-onoff”,
“Name”: “TV \u2022 On/Off”,
“Code”: “2600940000011F9512121312123713121213121212131213113711381313113714361039133612371312131113121336131312111411131213361336123714111336103913361436100005220001244C10000C490001234C10000C490001244B10000C490001264910000C4D0001204B13000C470001244B12000C470001254A12000C47000126491300058D080006B10001264A12000D0500000000”
},
{
“ID”: “9”,
“Key”: “tv-right”,
“Name”: “TV \u2022 Right”,
“Code”: “2600500000011F9511141014113910141114101411141015103910391015103910391039113811381114113811381114111410141114101510391014111411381138113812381237120005230001244913000D050000000000000000”
}, /////

I tested with a line obtained with RM Link code learning by changing the data and it works for me!
example:
http://192.168.0.26:7474/?cmd={“api_id”:1004,“command”:“send_code”,“mac”:“XX:XX:XX:XX:XX:XX”,“data”:2600c80000012196111412131114121312131213121411141138123811381238113811391237123712381138123811141214101412381214101510141114113813371237121411381100051b0001274b11000c4c0001274a13000c480001264b11000c560001254b12000c590001224b12000c550001274a12000c4a0001274a12000c560001284814000c540001254b12000c560001254b11000c570001244b12000c550001264b11000c570001254b11000c560001254b12000c550001264b11000c550001274a11000d05”%7D


!!! do not forget to start RMlink (Android) to test
Thank’ for this procedure comes from a Jeedom tutorial found here

Looking forward to your feedback

Hello again,
I have changed my items from String to Rollershutter and created rules to send the codes to the BROADLINK item. But unfortunately, I cannot get it to work this way.

broadlink.items:

String BROADLINK "Broadlink RM Pro" { channel="broadlink:rm2:**-**-**-**-**-**:command" }

rollershutter.items:

Rollershutter RS_LIVING1 "Wohnen 1"

rollershutter.sitemap:

sitemap Rollladen label="Rollläden"
{
	Frame label="Wohnzimmer"
	{
		Switch item=RS_LIVING1
	}
}

broadlink.map:

RS_LIVING1_UP=b200be0044090b4243094409430a0a424409440943090b424409430a43090b42430a0b4144090b00021144090b424309440944090b424309440943090c414409430a43090b42430a0b4243090b00021243090b424409430944090b42430a430944090b42430a430944090b4243090b4244090b00021144090b4144094409430a0b414409430a43090b424409430944090b4244090b4243090b00021243090b424408440944090b4243094409430a0a4244094409430a0a4244090b4244080b0005dc00000000000000000000
RS_LIVING1_STOP=b200a4010b090b090b090b0001d40b42430943090b41440944090b420a4244090b42430a4309430a43090b420b420b420b41440944090a42440944090b420b410c410b420b420b410c4144090b420b4243090b42430a43090b420b420b0002250b42420a43090b41440944090b4144090b42430a43094409440943090c410b4244090b410c41430a430944090b420b420b4144090b420b4243094409430a430944090b42430944094409430a0b41440001ec0a42430943090b4144094409430a0a420b420b42430a0b410b42430a43090b420b42430a0b410b420b42430a4309430a0b414409440943094409430a430a4309430a0b410b42440943090c410b42430001ec0b41430a43090a42430a43094409430a43090b4244090b420a420b420b42430944090b420b410b424409430a430a0a420b420a430a420b420b42430a0b414409430a0b4144090b420a420b424409430001ed0a42430943090b420b410b420b420b420b414409440943090b42430a0b420a420b42430a43090b420b420b420a420b420b420b4243090b420b420b420b414409440943094409430a0b4144094409430005dc00000000
RS_LIVING1_DOWN=b200be0044090b424409430944090b424408440944090b414409440944090b4243090b420b420b00021144090b424309440944090b414409430a430a0b414409430a43090b42430a0b420b420a00021243090b4244094409430a0b414409430944090b424409430944090b4243090c410b420b00021144090b424309440a43090b4243094409430a0b424309440944090b4144090b420b420a000212430a0a4244094409430a0a424409430944090b42430a430944090b4243090b420b420b0005dc00000000000000000000

rollershutter.rules:

rule "Item RS_LIVING1"
when
    Item RS_LIVING1 received command
then
    switch receivedCommand
    {
            case UP : BROADLINK.sendCommand(RS_LIVING1_UP)
            case STOP: BROADLINK.sendCommand(RS_LIVING1_STOP)
            case DOWN : BROADLINK.sendCommand(RS_LIVING1_DOWN)
            default : logWarn("RS_LIVING1","Command {} not supported!",receivedCommand)
    }
end

When I click on the rollershutter, I get this error:

[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Item RS_LIVING1': The name 'RS_LIVING1_DOWN' cannot be resolved to an item or type; line 9, column 51, length 15

So it looks like the .map file is not used in the rule. What am I missin here? Do I have to specify the map explicitly?

Regards
Bernd

just a shot i the dark…
on the site map try to replace switch item to defult item

i never used rollershutter item …

thanks for your help.
But the sitemap is not the problem. Turned out that the problem was in the rules file.
I forgot the quotation marks in the SendCommand.

Wrong:

BROADLINK.sendCommand(RS_LIVING1_UP)

Correct:

BROADLINK.sendCommand("RS_LIVING1_UP")
2 Likes

@Cato_Sognen
Hi, I went to the link http://rm-bridge.fun2code.de/rm_manage/code_learning.html

but unfortunately I get the following error and can’t find the codes.

Error learning code: mac: 78: 0F: 77: 63: A2: 64 not rm2

I’m using openhabian 2.4 with your latest binding broadlink 2.4 beta 17.

I bought a RM pro +

can you help me.

i did not use the bridge for a long time …
try this https://sourceforge.net/projects/broadlink-manager/

Unfortunately, Broadlink Manager does not work for RF with the latest RM Pro.

But Python Broadlink works very well. But this is more for advanced users:

Ok solved with Jean Jacques LARIVIERE method

Hi all, I’m a newbie to this awesome addon.

This is my things file.

Thing broadlink:sp2:78-0f-77-d5-0d-65 “txtBroadlink SP2 [78:0f:77:d5:0d:65] SP2_3” [ ipAddress=“10.230.0.105”, port=80, mac=“78:0f:77:d5:0d:65”, authorizationKey=“097628343fe99e23765c1513accf8b02”, iv=“562e17996d093d28ddb3ba695a2e6f58”, pollingInterval=30, staticIp=false ]

I’m using DHCP so I set staticIp=false but I still got OFFLINE - COMMUNICATION_ERROR even I changed ipAddress to 10.230.0.105
“Status: OFFLINE - COMMUNICATION_ERROR Could not find device at IP address 10.230.0.136”

Also I have several SP2 which is working fine on ihc App but cannot be scanned/detected on OpenHAB discovery. Any idea on this? Or shall I use .things file to add them?

Thanks in advance on helping.

yes install transformation

Thanks, it;s well working and it bring some stablity to the system

i have removed the hashmap timeout with a constant one

1 Like

really glad it helped :slight_smile: it’s the first time i manage to contribute in some way :slight_smile:

1 Like

What fixed my No Entry for … in map file issue was ensuring there were NO spaces between the label and = and none between the = and the string of numbers.

Does someone also have the problem that the Broadlink disconnects from my WLAN every 5 minutes or so. It is offline for less than a minute and then reconnects to the WLAN. It does that all the time.

Me too… Unfortunately I have tried many things but without any result.