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

Yes & Yes :crazy_face:

cool thx , last question : you think I can keep Black bean control on the raspberry and install this binding, because the self-learning is really useful :slight_smile:

Think that should be posible, I also have an android device with the RM Plugin online that can do Mqtt & http , they don’t bite eachother, so make a good backup and give it a try! and with the Pi thats easy to do (OpenHabian)

thank you again @X-Ray181 :wink:

please see this…
its windows way to copy codes… i found it most easy than all other methodes

Hi there, do you guys know about RM code generator to generate random RF and IR command? I find it promising, however it is developed with HomeAssistant in mind and it is not optimized for this binding.

Can anybody take a look on result code and give enlightenment to convert it to be put on broadlink.map?
TIA

I agree, I placed the jar in the folder, I configured everything but I’m stuck since I have no idea of how to set the signal codes, and use a button to send the signal :frowning:

All the information is there, did you do step 7?

Step 7 : For RMx devices only. Create an item in your items file and add it to your sitemap.

item file:
String TV_LIVINGROOM “TV” { channel=“broadlink:rm2:b4-43-0d-38-fa-9d:command” }

sitemap file:
Switch item=TV_LIVINGROOM label=“Power” mappings=[TV_POWER_ON=“On”, TV_POWER_OFF=“Off”]

Thank you for this summary @X-Ray181 , I was spending lot of time going through all posts and was not clear how to make it work.
Now it works like a charm (I have 2 RM3 mini and add AC’s, TV’s , set top boxes and fans).

Dear @Cato_Sognen,
Is it possible to update 1st post with info from X-ray181 post 813 to allow new users go directly for installation/configuration?

1 Like

Hello Karel,
You’re welcome, Cato is not with us anymore, so he won’t answer, but whats keeping you from making a new and improved version of the installation/configuration? you now know how to make it work and where you struggled…

1 Like

edit : I’m sorry for Off Topic

sounds as good idea to create additional how to (i’ll try to summary it during weekend) even i would say your post is enough to guide anybody and I really appreciate your help. But my point was more that it is not easy to find correct info in several hundreds of posts.
There is no function to make some of the posts “sticky” on top of thread?

No Problem! I understand the problem :crazy_face: All the information is here, but its not easy to find, I agree totaly.
I think this info should be on the document site off OH, with all the other binding “How To’s’” documentation, I think it should be here: https://www.openhab.org/addons/ ?
I have no idea how to get it there, but somebody will tell us soon!:laughing:, I will help and I hope John will to @themillhousegroup
I think it’s time to make it official, the binding is stable and working reliable for many off us, so now its time to document it for the next generation! :vulcan_salute:
Ray

1 Like

hi @themillhousegroup,

thanks for fixing this binding, Broadlink SP2 going online and offline, check below

from events.log:
21:13:03.074 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘broadlink:sp2:34-ea-34-b6-9e-8c’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.1.14

21:13:33.184 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘broadlink:sp2:34-ea-34-b6-9e-8c’ changed from OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.1.14 to ONLINE

from openhab.log:
2019-07-22 21:13:03.036 [ERROR] [handler.BroadlinkSocketModel2Handler] - sp2:34-ea-34-b6-9e-8c[^]: Exception while getting status from device
java.net.ProtocolException: Incoming packet from device is null.
at org.openhab.binding.broadlink.internal.BroadlinkProtocol.decodePacket(BroadlinkProtocol.java:193) ~[199:org.openhab.binding.broadlink:2.4.0.201906030227]
at org.openhab.binding.broadlink.handler.BroadlinkSocketModel2Handler.getStatusFromDevice(BroadlinkSocketModel2Handler.java:47) [199:org.openhab.binding.broadlink:2.4.0.201906030227]
at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.updateItemStatus(BroadlinkBaseThingHandler.java:204) [199:org.openhab.binding.broadlink:2.4.0.201906030227]
at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler$1.run(BroadlinkBaseThingHandler.java:77) [199:org.openhab.binding.broadlink:2.4.0.201906030227]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
2019-07-22 21:13:03.048 [ERROR] [handler.BroadlinkSocketModel2Handler] - sp2:34-ea-34-b6-9e-8c[^]: Problem getting status. Marking as offline …
2019-07-22 21:13:03.049 [ERROR] [handler.BroadlinkSocketModel2Handler] - sp2:34-ea-34-b6-9e-8c[^]: updateItemStatus: Online -> Offline

thanks

@Mohammad_Chaaban Try with the parameters below

StaticIp
IgnoreFailedUpdateds
Retries 1

Thing broadlink:sp2:34-ea-34-f5-ae-aa "txtBroadlink SP2 [192.168.1.105] SP2_3" [ ipAddress="192.168.1.105", port=80, staticIp=true, mac="34:ea:34:f5:ae:aa", authorizationKey="097628343fe99e23765c1513accf8b02", iv="562e17996d093d28ddb3ba695a2e6f58", pollingInterval=400, retries=1, ignoreFailedUpdates=true]

Hi,
I would like to control my TV using a Broadlink IR mini and Google Home Assistant.
To achieve this I configured IFTTT to react to a Change Channel command and to Update an Openhab Item with channel number, in example 401.

I created a map file for ir with all 10 digit, called IR_SKY_0 to IR_SKY_9
In a rule i scompose channel number 401 to 4 single digits 4, 0 and 1

The stem I miss is how to send this 3 command to broadling from a rule, instead using button from a sitemap, using the same map file. Someone can help me?

Thanks

i quite enjoy the question because it’s on the very to the limit of my knowlede and i enjoy challenges.

disclaimer:
in principle i know it works.
in practice, i’ve seen a lambda working this way in the OH scheduler widget for habpanel, but have never written one myself YET, and the inner workings of reentrant lock are still vague to me

I’d try this way:

  1. create a Digits_Group containing the items with single digits (first_digit, second_digit, third_digit, fourth_digit)

  2. write a rule that fires when any of your regex-ed single digits is updated with a non null value (maybe it’s enough reacting on the first one as it’s always going to be there)
    This rule would need a “Digits_Group.members.forEach” lambda expression, and within the lambda, if the digit item is not null, you compose the name of the command to send as a String command="IR_SKY_"+digit , where var digit = triggeringItem.state or similar.
    Send the command.
    You will need a brief Thread::sleep to give the Broadlink device the necessary time to send the IR command AND you might need to use concurrency guard via reentrand lock.

  3. use expire binding or something similar to reset the digit items to null after use

There! i might try in the next few weeks to write something alike for the sheer fun of the challenge XD

PS.: it just dawned on me that with reentrant lock+ expire binding would be possible to write a buffer for the commands sent to the broadlink device. another challenge XD

PS2: @marcolino7 , if you make it, please post it, i’m really interested

HI,
this is how I would like to procede. Issue is that the channel is into a string, like 401 or 5001
My issue at this time is to iterate the string and extract single digit.

Hi Dario,
for sure.

Marco

thanks… ill try it and report back…

Hi @lagging
there is 1st version of my rule. I did not tested yet with real IR codes but looking at the logs it works:

rule "Imposta Canale Sky"
when
	Item SALOTTO_IR_IFTTT received command
then
    val sState = SALOTTO_IR_IFTTT.state.toString
	logInfo("IR.SKY.Channel","Ricevuto Canale Sky "+sState)
    
    var len = sState.length
    logInfo("IR.SKY.Channel","Lunghezza Canale Sky "+len.toString)

    var String digit = ""
    var int charIndex = 0
    while(charIndex < sState.length){
        digit = sState.toString.substring(charIndex,charIndex+1)
        logInfo("IR.SKY.Channel","index Ciclo / Digit da Inviare :"+charIndex.toString+" / "+digit)
        SALOTTO_IR.sendCommand("IR_SKY_"+digit)
        Thread::sleep(500)
        charIndex = charIndex+1
    }

end

Basically IFTTT update item SALOTTO_IR_IFTTT with the string containing the channel (IE 401 or 5001), then rule iterate throught digit of received string and Update the Broadlink Item (SALOTTO_IR) with the map name IR_SKY_ and the digit. A sleep should give time to broadlink to receive command and sent to my TV set top Box.

This Night I will test.

Marco

1 Like