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

I use a zwave remote blaster for my AC

Hi @themillhousegroup i am having issues the RM is getting a communication error for the last two days
the item is with the below error

Item RM2 predicted to become null

and i need to go change the IP to same ip and settings will be ok…
is there any fix for this?

works great, thanks for sharing!

There is no other way than to catch all combinations of codes that you plan to use. I have three different temperatures times two ventilation modes, and three other commands on top of that, which do not have combinations.

You could then use dummy items (no channel linked) that hold temperature, ventilation mode etc. Then put them in a group and use the group to trigger a rule which picks the appropriate IR command to fire.

To learn codes I’m still very happy with the RM Bridge, http://rm-bridge.fun2code.de
(I have 2 RM Pro’s & 3 RM Mini’s) you run the bridge on a local android device, and you can run the software to get the codes on a local windows pc bij copying the software to your PC.
Also you can make a backup of ALL your learned codes, via the “Export” function, and restore them via the “Import” function.
This also gives you the option to use all the commands by HTTP that is what i do for my MP1’s and SP’s.

Ray

Just used this windows broadlink tool to map all 82 possible commands of my airco. Took less than an hour.

Hi everyone,
just a quick feedback. I was using my RM2 with the last binding version (BETA-11) and the last days I realized that i was getting disconnections a few times in an hour.
So, I totally removed the RM2 thing from my list, I switch the BETA-11 version with the BETA-10 and till now everything seems to work great.
For those have the same issue, if the want to try.
Thanks again.

Nope…
Still having problems…

2019-02-25 15:26:06.292 [hingStatusInfoChangedEvent] - ‘broadlink:rm2:34-ea-34-58-78-21’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.1.142

2019-02-25 15:26:24.186 [vent.ItemStateChangedEvent] - network_pingdevice_192_168_1_34_latency changed from 100.0 to 97.0

2019-02-25 15:26:24.203 [vent.ItemStateChangedEvent] - network_pingdevice_192_168_1_34_lastseen changed from 2019-02-25T15:25:24.065+0200 to 2019-02-25T15:26:24.172+0200

2019-02-25 15:26:37.375 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:34-ea-34-58-78-21’ has been updated.

2019-02-25 15:26:37.463 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:34-ea-34-58-78-21’ has been updated.

2019-02-25 15:26:37.586 [hingStatusInfoChangedEvent] - ‘broadlink:rm2:34-ea-34-58-78-21’ changed from OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.1.142 to ONLINE

2

I have exactly the same problem with 2 x RM2 and they toggle disconnections using the latest release. The units seem to work most of the time but the logs fill up with failures?

‘’’’2019-02-26 09:59:16.587 [ERROR] [handler.BroadlinkRemoteModel2Handler] - rm2:78-0f-77-fd-67-a1[^]: Could not get status: {}

java.net.ProtocolException: Incoming packet from device is null.

at org.openhab.binding.broadlink.internal.BroadlinkProtocol.decodePacket(BroadlinkProtocol.java:193) ~[252:org.openhab.binding.broadlink:2.4.0.201901041112]

at org.openhab.binding.broadlink.handler.BroadlinkRemoteModel2Handler.getStatusFromDevice(BroadlinkRemoteModel2Handler.java:39) [252:org.openhab.binding.broadlink:2.4.0.201901041112]

at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler.updateItemStatus(BroadlinkBaseThingHandler.java:204) [252:org.openhab.binding.broadlink:2.4.0.201901041112]

at org.openhab.binding.broadlink.handler.BroadlinkBaseThingHandler$1.run(BroadlinkBaseThingHandler.java:79) [252:org.openhab.binding.broadlink:2.4.0.201901041112]

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:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

2019-02-26 09:59:16.594 [ERROR] [handler.BroadlinkRemoteModel2Handler] - rm2:78-0f-77-fd-67-a1[^]: Problem getting status. Marking as offline …

2019-02-26 09:59:16.597 [ERROR] [handler.BroadlinkRemoteModel2Handler] - rm2:78-0f-77-fd-67-a1[^]: updateItemStatus: Online -> Offline

==> /homeautomation/openhab/userdata/logs/events.log <==

2019-02-26 09:59:16.619 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:78-0f-77-fd-67-a1’ has been updated.

2019-02-26 09:59:16.660 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:78-0f-77-fd-67-a1’ has been updated.

2019-02-26 09:59:16.672 [hingStatusInfoChangedEvent] - ‘broadlink:rm2:78-0f-77-fd-67-a1’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.100.105

‘’’’

Then 30 secs later:

‘’’’

2019-02-26 09:59:46.762 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:78-0f-77-fd-67-a1’ has been updated.

2019-02-26 09:59:46.794 [me.event.ThingUpdatedEvent] - Thing ‘broadlink:rm2:78-0f-77-fd-67-a1’ has been updated.

2019-02-26 09:59:46.928 [hingStatusInfoChangedEvent] - ‘broadlink:rm2:78-0f-77-fd-67-a1’ changed from OFFLINE (COMMUNICATION_ERROR): Could not find device at IP address 192.168.100.105 to ONLINE

‘’’’

Hi everybody, hi John (@themillhousegroup) ,

I have started using openHAB only very recently. Mostly because I was interested to control my air conditioner via infrared. John’s binding looks very promising and I have been able to add it (beta v11). However, when I try to add the recently bought RM mini 3 (firmware v40), no device is listed and the log shows:

2019-03-05 22:38:58.541 [WARN ] [.discovery.BroadlinkDiscoveryService] - BroadlinkDiscoveryService - Beginning Broadlink device scan...
2019-03-05 22:38:58.548 [WARN ] [internal.discovery.DiscoveryProtocol] - Beginning async Broadlink device scan; will wait 10000ms for responses
2019-03-05 22:38:58.568 [WARN ] [internal.discovery.DiscoveryProtocol] - Broadlink device scan waiting for 10000 ms to complete ...
2019-03-05 22:38:58.615 [ERROR] [nding.broadlink.internal.ModelMapper] - Device identifying itself as '10178' is not currently supported. Please report this to the developer!
2019-03-05 22:38:58.622 [ERROR] [nding.broadlink.internal.ModelMapper] - Join the discussion at https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest/22768/616
2019-03-05 22:38:58.629 [INFO ] [.discovery.BroadlinkDiscoveryService] - Data received during Broadlink device discovery: from 192.168.1.6:80[78:0f:77:51:91:f6]
2019-03-05 22:39:08.573 [WARN ] [internal.discovery.DiscoveryProtocol] - Device scan: wait complete ...
2019-03-05 22:39:08.575 [WARN ] [internal.discovery.DiscoveryProtocol] - Ended Broadlink device scan...
2019-03-05 22:39:08.578 [INFO ] [link.internal.socket.BroadlinkSocket] - Socket closed
2019-03-05 22:39:08.581 [INFO ] [.discovery.BroadlinkDiscoveryService] - Discovery complete. Found 1 Broadlink devices

I checked, and definitely the device with this ip and mac is the RM mini 3.
Has somebody experienced something similar? Any ideas how to solve my problem?

Thanks and best wishes

UPDATE (2019-03-13):
I got it working and I just wanted to report what I did.
Restarting openHab still did show the the RM mini 3 but now I was able to add it manually.
I tried the app and the website RM bridge to get the codes from my remote, but that did not work either. Instead I used the broadlink python-module https://github.com/mjg59/python-broadlink . I installed it using pip, but that did not retrieve a version compatible with my RM mini 3. I replaced the one installed with the one from the repo and added the identifier “10178”. That allowed me to retrieve the codes.

I dont have an android anything - what emulator are people using - Ive tried bluestacks but the IP it gets I think is not able to get to via the rm bridge website - i get http404 error

OK answered my own question - if you learn them all in the windows app, you can get the commands from commands.json

Hi!

Thanks for all helping post, my setup works perfectly!

Can I send multiple code at one switch?
I mean, for example: turn on Tv and Amp and Media Player at once, some delay between the codes.

i have a similar setup, and is working fine, allthough i have been experiencing some random disconnects of my rmpro (rm3).

here’s a rule i use

rule "dimmer ON"  
  when 
    Item Dimmer_Sogg_EXP received command ON
    then
     if(DimMem_Sogg.state !=ON ) {
     RM3_in.sendCommand("Sogg_Dimmer")  
     Luce_Sogg_EXP.postUpdate(ON)
        if(Led_Sogg_EXP.state !=OFF ) {
        Thread::sleep(4800) 
        RM3_in.sendCommand("Sogg_Led_Off")
        }
      }
     if(DimMem_Sogg.state !=OFF ) {
     RM3_in.sendCommand("Sogg_MemDim")  
     Luce_Sogg_EXP.postUpdate(ON)
       if(Led_Sogg_EXP.state !=OFF ) {
       Thread::sleep(800) 
       RM3_in.sendCommand("Sogg_Led_Off")
       }
     }
     Led_Sogg_EXP.postUpdate(OFF)
end

In other words:
When the Dimmer_sogg_EXP (dummy item exposed throught openhabcloud to google home) receives the command ON (it’s usually off, but it being a dummy in the off chance it were undefined, it realigns itself)

IF before switching off the light WASN’T dimmed(the ceiling fan memorizes it- that’s represented by the DimMem_sogg.state)
then
send an approx 4 seconds long dimming rf433 command that takes the light to 50% intensity and refresh the dummy light switch to ON
then in case the night light was on, wait for the lenght of the dimming command and only then switch the night light off(and refresh the dummy).

IF before switching off the light, it WAS dimmed,
then
do the same as above but sending a different very short dimming rf433 command which brings back up the dimmed light to 50% directly(it memorised it)
in case the night light is on, wait much less(0,8secs), switch it off(and refresh the dummy).

There is a long tutorial/design pattern by rIkoshak about why thread::sleep is a bad idea.
I havent’ managed (java noob here) to make that timer strategy work, the rm3 is unable to send multiple commands closely chained, nor the listening rf433 devices like them stacked too close in time. so the best option i came up with - in order to avoid too much thread::sleep - was to exclude it if a clause isn’t met…

Hope it helps

EDIT
also - if it can help:
respective to the original guides, i have only 1 thing&item connected to this binding(the RM3_in) to which i send the various hex string commands i mapped in the map file as by the guides in this thread - while i use dummies to represent the logical states and expose the ones i want to command via google home(ending in EXP).

1 Like

Hi all

Thanks to @Cato_Sognen to bring this up. I would definitely support a binding for Broadlink devices. I currently use the python script instead, but a native inclusion would make sense from my point of view.

Regards
Stefan

I’m doing something similar to send command to TV to switch to channel above 9. I have a rule that sends commands with a delay of 1 sec between them. I used ‘Thread::sleep(1000)’.

Hi!

Can you post your rule ?

This is just a part of my rule:

while ((i=i+1) < numchar) {
var num = status.substring(i,i+1)
if (AMP_Input.state.toString==“AV4”)
SKY_COMMAND.sendCommand(“SAMSUNG_”+num)
else
SKY_COMMAND.sendCommand(“SKY_”+num)
Thread::sleep(1000)
}

As you can see every 1 second I use sendcommand with a different command.

Thanks!

Hi all, here is my setup. I checking the switch state with the network state, of the device.

sitemap

Frame label=“Házimozi”
{ Switch item=tv_onoff }
ir.items
Switch presence_tv “TV” {channel=“network:pingdevice:tv:online” }
String BroadlinkRM3 “Broadlink Mini” { channel=“broadlink:rm3:xx-xx-xx-xx-xx-xx:command” }
Switch tv_onoff “TV” [ “Switchable” ]

items

Switch presence_tv “TV” { channel=“network:pingdevice:tv:online” }
String BroadlinkRM3 “Broadlink Mini” { channel=“broadlink:rm3:xx-xx-xx-xx-xx-xx:command” }
Switch tv_onoff “TV” [ “Switchable” ]

rules

rule “TV”
when Item tv_onoff received command
then switch (receivedCommand)
{
case ON: { BroadlinkRM3.sendCommand(“TV_ON”) }
case OFF: { BroadlinkRM3.sendCommand(“TV_OFF”) }
}
end

rule “TV State”
when Item presence_tv changed
then

if (tv_onoff.state != presence_tv.state)
tv_onoff.postUpdate(presence_tv.state)
end

things

network:device:tv [hostname=“192.168.xxx.xxx”, port=0, retry=1, timeout=5000, refresh_interval=60000, use_system_ping=“true”, dhcplisten=“true”]

map

TV_ON = 260018
TV_OFF = 26008c

1 Like