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

Ok Tejo,

I think because the 2 RM’s are online that we can say the IV & Key are ok, lets check some other things:

  1. Do you have the “Broadlink.map” file added in PaperUI for the RM’s?
  2. Is the “Broadlink.map” file in the “openhab/transform” folder?
  3. I would remove the [“Lighting”] tag, from your items, cause thats not going to work like that
  4. What does your “openhab.log” say?

Ray

HI Cato,

Great works, I got RM2 and RM3, RM2 works, but RM3 is not,
openhab detected offline when I unplug USB and went back online when plug it back,
but it got no response for take command, usually when boradlink receive command, led will flash one time,
but it’s not on RM3

P.S. Problem solved by remove thing and readd

01:29:22.190 [DEBUG] [dlink.handler.BroadlinkRemoteHandler] - Handling ir/rf command Contex_TV_VolumDown on channel command of thing Broadlink RM3 [192.168.xxx.xxx]
01:29:22.207 [DEBUG] [dlink.handler.BroadlinkRemoteHandler] - Transformed Contex_TV_VolumDown for thing Broadlink RM3 [192.168.xxx.xxx] with map file 'broadlink.map'

I got no issue with python script, it also works well on RM2 pro. I also got issue with MP1, I got it detected in Inbox, but it’s all default off, when click on, it will turn back off around 15 seconds later. if socket is off, it can be turn on, but not off, S1-S3 can turn on, S4 no response and no status return.

1 Like

Guys, first sorry for my english.
I use the broadlink perfectly on basic ui and android
Anyone can help a send a comand by a habpanel?
I’m a noob yet.

Hi guys

i succeed to add :
Broadlink RM Pro -RM2 [10.100.102.101]
Broadlink RM Mini -RM3 [10.100.102.102]
BroadLink SP3 Home Socket SIMANE -SP2 [10.100.102.103]
BroadLink SP3 Home Socket -SP2 [10.100.102.105]

but it’s impossible to add SmartOne Alarm & Security Kit Smart Home Automation For BroadLink S1C For Phone ERROR: 409 - Conflict

@Cato_Sognen, feel free to send a beta, i can test on all those devices

Rollertrol blinds … RF codes challenge

I was able to record both RF and a IR codes using the command 'http://192.168.1.xxx:xxxx/study?deviceMac=34:ea:34:d0:xx:xx to the free version of RM Plugin Lite.

using http://192.168.1.xxx:xxxx/codes - I’m able to extract the codes and the IR ones work … happy to share the Haiku Fan IR controls codes if anyone needs them.

Using the same methodology I can’t get RF codes to work … do I need to do something different?

Examples of the capture codes from my map file included here:

Haiku IR
fan_whoosh = 260050000001279612121313111412131312111412131312113913371337123813381238113813381213131211391213111412131312111512371238121411381338123811391238140005220001274b14000d050000000000000000

Rollertrol RF
blind_up = b2005601160a0c15160a160b0b15160a0c150b15160a170a0b150c15160a160a160a170a160a0c140c150c140c150b15160a170a160a0c150b150c140c150b150c140c15160a160b160a160a160b0b150b150c15160ca150360a160b0b15160b160a0c14170a0c140c15160a160a0c150b15160a170a160a160a170a0b150c140c150c140c15160a160a160b0b150c140c150c140c140c150c14170a160a160a170a160a0c150b150c14160da150360a160a0c15160a160b0b15160a0c140c15160a160b0b150c14170a160a160b160a160a0c150b150c150b150b15160a170a160a0c150b150b150c150c140c140c15160a160b160a160a170a0b150c140c15160ca150370a160a0c14160a170a0c14160b0b150c14170a160a0c140c15160a170a160a160a170a0c140c150b150c140c15160a160a170a0c140c150b150c140c150b150c14160b160a160a160b160a0c150b150c14160005dc

Hi there,
Does the RF code work and keeps working with the e-control app?

I can’t create the code in the e-control app on android as it gives an error. But previously created ones on the iphone app work reliably. I was just trying to find a method to get the codes as a workaround for the error.

ok, so it should work, i asked, because there are rolerblinds that use a changing RF code for security, , so that won,t work.
Have you tried the RM Bridge? http://rm-bridge.fun2code.de/ I’m using that for some devices via HTTP code until we have a complete and stable OH broadlink binding

Yes, I tried that but it didn’t work … I found the web interface to be more practical.
I have the blinds working from the broadlink but via the iPhone app and also have them operating a schedule. So I know it can work!

I have a Somfy blind as well that has rolling codes … I’m just hoping someone will reverse engineer the logic and implement a solution!

1 Like

Do you think that’s possible to connect thee broadlink to ifft directly or through openhab?

OK so a little more playing around …

If I use the command http://192.168.1.xxx:xxxx/send?deviceMac=34ea34d0xxxx&codeId=l1504580573113

where

 '0a170a160005dc","i**d":"l1504651358128**","name":"My new '

from

 http://192.168.1.xxx:xxxx/codes

then it works … but then I suppose it would as it’s the stored value on the device as opposed to a code string sent to it. It does however validate that the code string is correct.

I was also able to validate that the RF signal which is around 315Mhz for this device is being sent by the broadlink when I use the send command above but not when using the binding. I’m able to observe this using a SDR receiver … which takes the mystery out of RF signals being sent or not!

also I note that there is a remote type field : remoteType":0 for RF signals and remoteType":6 for IR.

@cato i wonder if there is a need to communicate the remote type?

anyway i feel like i made some progress!

  1. Yes, I have broadlink.map in PaperUI
  2. Yes, I have broadlink.map, all in lower case as written in paperUI
  3. I get that revelation with my conversation with @Eric_Dycus before, I have to use rules to use [ “Lighting” ] tag
  4. and here is my openhab.log that may contain information to help

2017-09-03 00:19:16.616 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@126dd90{r=16,c=false,a=IDLE,uri=/rest/items/Light_FF_Front} handle enter
2017-09-03 00:19:16.617 [DEBUG] [clipse.jetty.server.HttpChannelState] - HttpChannelState@1604f39{s=IDLE i=true a=null} handling IDLE
2017-09-03 00:19:16.618 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@126dd90{r=16,c=false,a=DISPATCHED,uri=/rest/items/Light_FF_Front} action REQUEST_DISPATCH
2017-09-03 00:19:16.619 [DEBUG] [org.eclipse.jetty.server.Server ] - REQUEST POST /rest/items/Light_FF_Front on HttpChannelOverHttp@126dd90{r=16,c=false,a=DISPATCHED,uri=/rest/items/Light_FF_Front}
2017-09-03 00:19:16.619 [DEBUG] [ax.web.service.spi.model.ServerModel] - Matching [/rest/items/Light_FF_Front]…
2017-09-03 00:19:16.620 [DEBUG] [ax.web.service.spi.model.ServerModel] - Path [/rest/items/Light_FF_Front] matched to {pattern=/rest/.,model=ServletModel{id=org.ops4j.pax.web.service.spi.model.ServletModel-9,name=org.ops4j.pax.web.service.spi.model.ServletModel-9,urlPatterns=[/rest/],alias=/rest,servlet=com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge@fb7ccb,initParams={},context=ContextModel{id=org.ops4j.pax.web.service.spi.model.ContextModel-8,name=,httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default],contextParams={},virtualHosts={},connectors={}}}}
2017-09-03 00:19:16.620 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]}
2017-09-03 00:19:16.621 [DEBUG] [.jetty.server.handler.ContextHandler] - context=||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]}
2017-09-03 00:19:16.621 [DEBUG] [org.eclipse.jetty.server.session ] - sessionManager=org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager@88881f
2017-09-03 00:19:16.622 [DEBUG] [org.eclipse.jetty.server.session ] - session=null
2017-09-03 00:19:16.622 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - servlet |/rest|/items/Light_FF_Front → org.ops4j.pax.web.service.spi.model.ServletModel-9@378be101==com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge,-1,true
2017-09-03 00:19:16.623 [DEBUG] [ce.jetty.internal.HttpServiceContext] - Handling request for [/rest/items/Light_FF_Front] using http context [DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]]
2017-09-03 00:19:16.623 [DEBUG] [y.internal.HttpServiceServletHandler] - handling request org.ops4j.pax.web.service.jetty.internal.HttpServiceRequestWrapper@19db5c8, org.ops4j.pax.web.service.jetty.internal.HttpServiceResponseWrapper@124e0a9
2017-09-03 00:19:16.624 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - chain=null
2017-09-03 00:19:16.629 [DEBUG] [org.eclipse.jetty.http.HttpParser ] - parseNext s=CONTENT HeapByteBuffer@1e2fac3[p=450,l=465,c=8192,r=15]={POST /rest/items/…8,id;q=0.6\r\n\r\n<<<Front_Light_OFF>>>2 Sep 2017 08:37:…\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2017-09-03 00:19:16.630 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@126dd90{r=16,c=false,a=DISPATCHED,uri=/rest/items/Light_FF_Front} content java.nio.HeapByteBufferR[pos=450 lim=465 cap=8192]
2017-09-03 00:19:16.630 [DEBUG] [org.eclipse.jetty.http.HttpParser ] - parseNext s=CONTENT HeapByteBuffer@1e2fac3[p=465,l=465,c=8192,r=0]={POST /rest/items/…Front_Light_OFF<<<>>>2 Sep 2017 08:37:…\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2017-09-03 00:19:16.630 [DEBUG] [org.eclipse.jetty.http.HttpParser ] - CONTENT → END
2017-09-03 00:19:16.631 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@126dd90{r=16,c=false,a=DISPATCHED,uri=/rest/items/Light_FF_Front} messageComplete
2017-09-03 00:19:16.631 [DEBUG] [org.eclipse.jetty.server.HttpInput ] - HttpInputOverHTTP@1a1a961 EOF
2017-09-03 00:19:16.632 [DEBUG] [org.eclipse.jetty.io.ChannelEndPoint] - filled 0 SelectChannelEndPoint@35722b{/192.168.1.70:55255<->8080,Open,in,out,-,-,48/30000,HttpConnection}{io=0,kio=0,kro=1}
2017-09-03 00:19:16.634 [DEBUG] [.eclipse.jetty.server.HttpConnection] - HttpConnection@11941c[FILLING,SelectChannelEndPoint@35722b{/192.168.1.70:55255<->8080,Open,in,out,-,-,49/30000,HttpConnection}{io=0,kio=0,kro=1}][p=HttpParser{s=END,15 of 15},g=HttpGenerator{s=START},c=HttpChannelOverHttp@126dd90{r=16,c=false,a=DISPATCHED,uri=/rest/items/Light_FF_Front}] filled 0
2017-09-03 00:19:16.634 [DEBUG] [org.eclipse.jetty.server.HttpInput ] - HttpInputOverHTTP@1a1a961 eof EOF
2017-09-03 00:19:16.635 [DEBUG] [org.eclipse.jetty.server.HttpInput ] - HttpInputOverHTTP@1a1a961 eof EOF
2017-09-03 00:19:16.635 [DEBUG] [org.eclipse.jetty.server.HttpInput ] - HttpInputOverHTTP@1a1a961 eof EOF
2017-09-03 00:19:16.639 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at ‘items/Light_FF_Front’ with an invalid status value ‘Front_Light_OFF’.
2017-09-03 00:19:16.641 [DEBUG] [.eclipse.jetty.server.HttpConnection] - org.eclipse.jetty.server.HttpConnection$SendCallback@1c9f7f5[PROCESSING][i=ResponseInfo{HTTP/1.1 400 Bad Request,313,false},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@b33ea5] generate: NEED_HEADER (null,[p=0,l=313,c=4096,r=313],true)@START
2017-09-03 00:19:16.642 [DEBUG] [.eclipse.jetty.server.HttpConnection] - org.eclipse.jetty.server.HttpConnection$SendCallback@1c9f7f5[PROCESSING][i=ResponseInfo{HTTP/1.1 400 Bad Request,313,false},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@b33ea5] generate: FLUSH ([p=0,l=214,c=8192,r=214],[p=0,l=313,c=4096,r=313],true)@COMPLETING
2017-09-03 00:19:16.642 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - write: WriteFlusher@18e562e{IDLE} [HeapByteBuffer@1aba51a[p=0,l=214,c=8192,r=214]={<<<HTTP/1.1 400 Bad …v20160908)\r\n\r\n>>>it/537.36 (KHTML,…\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00},HeapByteBuffer@8ae90e[p=0,l=313,c=4096,r=313]={<<<\n\n<me…/body>\n\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00…\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}]
2017-09-03 00:19:16.643 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@18e562e{WRITING}:IDLE–>WRITING
2017-09-03 00:19:16.644 [DEBUG] [org.eclipse.jetty.io.ChannelEndPoint] - flushed 527 SelectChannelEndPoint@35722b{/192.168.1.70:55255<->8080,Open,in,out,-,W,59/30000,HttpConnection}{io=0,kio=0,kro=1}
2017-09-03 00:19:16.644 [DEBUG] [org.eclipse.jetty.io.WriteFlusher ] - update WriteFlusher@18e562e{IDLE}:WRITING–>IDLE
2017-09-03 00:19:16.645 [DEBUG] [.eclipse.jetty.server.HttpConnection] - org.eclipse.jetty.server.HttpConnection$SendCallback@1c9f7f5[PROCESSING][i=ResponseInfo{HTTP/1.1 400 Bad Request,313,false},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@b33ea5] generate: DONE ([p=214,l=214,c=8192,r=0],[p=313,l=313,c=4096,r=0],true)@END
2017-09-03 00:19:16.646 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ o.e.j.s.h.ContextHandler@1a5c00c{/static,null,AVAILABLE}
2017-09-03 00:19:16.647 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.dashboard_2.1.0 [170], contextID=default]}
2017-09-03 00:19:16.647 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.io.rest.docs_2.1.0 [201], contextID=default]}
2017-09-03 00:19:16.648 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.core.audio_0.9.0.b5 [99], contextID=default]}
2017-09-03 00:19:16.648 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui_0.9.0.b5 [136], contextID=default]}
2017-09-03 00:19:16.648 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b5 [137], contextID=default]}
2017-09-03 00:19:16.649 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=org.jupnp.transport.impl.osgi.DisableAuthenticationHttpContext@1f901cd}
2017-09-03 00:19:16.649 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.basic_0.9.0.b5 [188], contextID=default]}
2017-09-03 00:19:16.650 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.paper_0.9.0.b5 [189], contextID=default]}
2017-09-03 00:19:16.650 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=org.openhab.io.net.http.SecureHttpContext@af6ecc}
2017-09-03 00:19:16.650 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=org.openhab.io.net.http.SecureHttpContext@4b6478}
2017-09-03 00:19:16.651 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.habmin_2.1.0 [206], contextID=default]}
2017-09-03 00:19:16.651 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.habpanel_2.1.0 [207], contextID=default]}
2017-09-03 00:19:16.652 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/items/Light_FF_Front @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.core_2.1.0 [166], contextID=default]}
2017-09-03 00:19:16.652 [DEBUG] [org.eclipse.jetty.server.Server ] - RESPONSE /rest/items/Light_FF_Front 400 handled=true
2017-09-03 00:19:16.652 [DEBUG] [clipse.jetty.server.HttpChannelState] - HttpChannelState@1604f39{s=DISPATCHED i=true a=null} unhandle DISPATCHED
2017-09-03 00:19:16.653 [DEBUG] [org.eclipse.jetty.http.HttpParser ] - reset HttpParser{s=END,15 of 15}
2017-09-03 00:19:16.653 [DEBUG] [org.eclipse.jetty.http.HttpParser ] - END → START

Thanks for your answer

not sure to have understood what you mean by "you’d better off installing current meter "?

a switch is a two ways switch if two switches can control a same light

the TC2 is one way…

i have a corridor and one switch at each extremity. if i turn one switch, the second should be turned off.

since the TC2 are not 2 ways, i want to make it with some rules.

is it possible?

@nakh_Home power current, with the unit of measurement is Ampere. You have to use a plug that can measure power current, like sonoff pow, broadlink SP3S plug.

You can’t get two way switch functionality with TC devices. Make it one way switch, and the other switch, is to send command to openHAB to turn on/off the switch.
To make openHAB know whether the lamp is on, you have to use current meter on your lamp.

@Cato_Sognen

Cato, I prefer to keep al things defined in the things folder and not using the discovery options. How should I define a thing for RM3?

Is there a way to see the code of the binding (is it on github)?

Thx
(Great work btw!)

So to further troubleshoot I installed tcpdump on the RPI and performed some packet captures … again showing that nothing is being sent out …

any ideas?

Hey guys

first of all great development and really useful project. Thanks to Cato.
I tried to use the broadlink adapter to control my AC, which works perfectly fine with the python-broadlink script.

I am using a Broadlink RM3 mini.
Unfortunately after installing everything to openhab, I do not get any response (Auth key: ****b02, IV: ****f58, map: broadlink.map ). mapping binding is installed.

default.items:

String AC_IR “AC” { channel=“broadlink:rm3:34-ea-34-bb-0d-96:command” }

default.sitemap:

sitemap default label=“Main Menu”
{ Frame label=“Climate” {
Switch item=AC_IR label=“Power” mappings=[AC_POWER_ON=“On”,AC_POWER_OFF=“Off”]
}
}

broadlink.map:

AC_POWER_ON = 26007000000126931139111411141014111410141114113911141039113910141214103911391014113a1014111410141114101510151039111410391139113911391039113a1014110005660001244b12000c4b0001264a13000c4a0001264914000c490001274913000c4a0001254a14000d050000000000000000
AC_POWER_OFF = 26007000000126931139111411141014111410141114113911141039113910141214103911391014113a1014111410141114101510151039111410391139113911391039113a1014110005660001244b12000c4b0001264a13000c4a0001264914000c490001274913000c4a0001254a14000d050000000000000000

events.log

2017-09-10 13:04:06.831 [ItemCommandEvent ] - Item ‘AC_IR’ received command AC_POWER_ON
2017-09-10 13:04:06.846 [ItemStateChangedEvent ] - AC_IR changed from AC_POWER_OFF to AC_POWER_ON

Is there anything obvious I am missing? Any help would be appreciated.

1 Like

Hi Lucs, try putting quotes around the sitemap commands

I finally find my problem. I use caps for mac address in items file. After I change mac address to lower case, it works. Thanks for all who help, especially @Eric_Dycus and @X-Ray181 .

Well Done! “search and thou shall find