BroadLink Mark II plugin

@blacey

Pleased to see you are making good use of the plugin. You might want to give us some idea of what all these black beans are doing. You seem to have your hand on a few of them.

Thanks for the pull request. I’ve been slow to act on it. Seems there is a bigger problem in the world at this time. I also wanted to add some of my own mods. Regardless GitHub has now been updated and thank you for your contribution. Have you any idea why Broadlink now needs the header stuff for some the new devices?

My sensors is still going along nicely, so that’s great work.

2 Likes

I use most of them to turn my wife’s candles on and off throughout our home. She loves the ambiance and tuning them by sunset/sleep works much better than the candles fairly unintelligent built-in timer.

No worries - thank for incorporating it into your main version. The delay allowed me to add a couple more broad link devices that require the new headers :wink:

Broadlink has evolved the protocol to require these new headers and in some cases, once an IR blaster is paired with the cloud, it no longer accepts local network requests - users have to actually remove it from their cloud account using the Broadlink App.

Hi,

First time poster to this forum.

Just trying to get to grips with using the plugin and the first question is if it will work with the RM4 Pro. I am running this under ALTUI as recommended

I have uploaded the files from GitHub as described in one of the earlier emails, using version 0.55

  1. Restarted Luup engine
  2. Create device using D_BroadLink_Mk2_1.xml and Upnp Implementation Filename: I_BroadLink_Mk2_1.xml
  3. run the code luup.reload()

Device created but no devices found

  1. Added to device variable
    {“24:df:a7:d3:2c:05”: {“blInternalId”: “???”,“blKey”:“097628343fe99e23765c1513accf8b02”,“blDeviceType”: 10119,“blIp”:“192.168.1.111”,“blDesc”: “RM4 PRO”}}
    using MAC address and IP address of Broadlink RM4 unit
  2. Restarted Luup engine

Still no devices found?

If I need to post logs do I just tail the last 50 lines or use a search string?

Thanks

The RM4 Pro appears to be a fairly recent model. When was it purchased? I suspect I need to provide support for it.

Here’s a list of current models:

GitHub BroadLink Python

and here’s what this plugin supports:

GitHub BroadLink Mk2

Set the ‘DebugEnabled’ flag to 1, save and restart the Luup Engine and search the log for the string: ‘is not known to this plugin’.

You’ll probably find that it says:

‘The BroadLink device at IP address … and of type 0x61a2 is not known to this plugin’

Don’t forget to turn debugging off again.

I need to know the the value shown - I expect it to be: 0x61a2

Some of the new Broadlink devices seem to allow some weird lead that has a humidity & temp sensor to be plugged in. I have no plans to support this lead.

2 Likes

^^^ The RM4 has been around for about 12 months now, it’s main bitch is that the protocols have been changed and don’t work with either Vera Plug In, it also appears not to come with an AC adaptor as the RM3 did and doesn’t work with other equipment that the RM3 worked with, consequently up take has been slow.
I’ve been debating whether to stock these again but with the poor exchange rate it’s not feasible presently.
Painful really as the RM3 was perfect for HA use and there was no need for an upgraded version, it also appears after months of searching there are few if any alternatives that are certified FCC. (if anyone knows of any I’d be delighted to hear from you)

It seems according to the GitHub BroadLink Python there are a few RM4 Pro versions. The Vera plugin was updated to suit a change in protocol for some of the RM3’s, so I suspect the RM4 Pros have the same protocol changes. If I get the ID number (eg like the 0x61a2 discussed above) we can try it out.

In variables I set

  1. Broadlink devices set to {“24:df:a7:d3:2c:05”:{“blInternalId”:"???",“blKey”:“097628343fe99e23765c1513accf8b02”,“blDeviceType”:10119,“blIp”:“192.168.1.111”,“blDesc”:“RM4 Pro”}}
  2. set the DebugEnabled’ flag to 1
  3. reloaded Luup Engine
  4. OS command search for ‘is not know to this plugin’
    command succeed but nothing came back
  5. Also in the message tab it says ‘Controller did not respond
  6. OS command search for ‘Broadlink’ and got back
09 07/01/20 10:25:46.425 JobHandler_LuaUPnP::Run device 57 ptr 0xefc768 Broadlink RM4 PRO room 1 type urn:schemas-a-lurker-com:device:BroadLink_Mk2:1 cat 11:-1 id parent 0/0xf9bf20 upnp: 0 plugin:0 pnp:0 mac: ip: <0x77c55320>
10 07/01/20 10:26:07.476 XXX-UpdateSystemMessagesTasks now 1=Broadlink RM4 PRO[57]: Running Lua Startup timeout 0 (-1593595567) count: 8 pend:Running Lua Startup/err:(null)/done:(null) <0x7707e520>
10 07/01/20 10:26:07.480 XXX-UpdateSystemMessagesTasks now 1=Broadlink RM4 PRO[57]: Running Lua Startup timeout 0 (-1593595567) count: 8 pend:Running Lua Startup/err:(null)/done:(null) <0x7707e520>
10 07/01/20 10:26:07.484 XXX-UpdateSystemMessagesTasks now 1=Broadlink RM4 PRO[57]: Running Lua Startup timeout 0 (-1593595567) count: 8 pend:Running Lua Startup/err:(null)/done:(null) <0x7707e520>
10 07/01/20 10:26:59.335 mg_callback from IP:127.0.0.1:49905 /port_3480/data_request id=lr_ALTUI_Handler&command=oscommand&oscommand=cat%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20%22Broadlink%22&_=1593595238918 start id: 45 <0x73223520>
12 07/01/20 10:26:59.336 luvd_get_info_data_request starting /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=cat%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20%22Broadlink%22&_=1593595238918 pMem 0x1655000/23416832 diff: 7766016 <0x73223520>

Not sure if I have done something wrong?

in step 4 I did copy and paste your ‘is not known to this plugin’

This won’t help:

{“24:df:a7:d3:2c:05”:{“blInternalId”:"???",“blKey”:“097628343fe99e23765c1513accf8b02”,“blDeviceType”:10119,“blIp”:“192.168.1.111”,“blDesc”:“RM4 Pro”}}

Just delete it and save.

If you are using AltUI go to Misc–>OsCommand then select ‘Tail logs’ Tab. You get this command:

tail -n 50 /var/log/cmh/LuaUPnP.log

You can change the 50 to say 500 to see more from the log. Do this after a Luup Engine restart. If doing correctly there will be many mentions of BroadLink_Mk2

  1. Deleted {“24:df:a7:d3:2c:05”:{“blInternalId”:"???",“blKey”:“097628343fe99e23765c1513accf8b02”,“blDeviceType”:10119,“blIp”:“192.168.1.111”,“blDesc”:“RM4 Pro”}}

  2. saved

  3. Reloaded Luup engine

  4. tail -n 1500 /var/log/cmh/LuaUPnP.log

  5. Searched for ‘Broadlink_Mk2’ within tail results

25 07/01/20 13:51:22.510 LuImplementation::StartLua device: 57 file:I_BroadLink_Mk2_1.xml startup:luaStartUp pLuaInterface: 0x1356208 ip: port 0 protocol: raw <0x766d8520>
25 07/01/20 13:51:22.511 LuImplementation::StartLua running startup code for 57 I_BroadLink_Mk2_1.xml <0x766d8520>
50 07/01/20 13:51:22.512 luup_log:57: BroadLink_Mk2 debug: Initialising plugin: BroadLink_Mk2 <0x766d8520>
50 07/01/20 13:51:22.512 luup_log:57: BroadLink_Mk2 debug: Using: Lua 5.1 <0x766d8520>
50 07/01/20 13:51:22.512 luup_log:57: BroadLink_Mk2 debug: 0.55 --> PluginVersion <0x766d8520>
50 07/01/20 13:51:22.533 luup_log:57: BroadLink_Mk2 debug: Using: dkjson <0x766d8520>
50 07/01/20 13:51:22.533 luup_log:57: BroadLink_Mk2 debug: 300 --> PollInterval <0x766d8520>
50 07/01/20 13:51:22.537 luup_log:57: BroadLink_Mk2 debug: Broadcasting discovery message <0x766d8520>
50 07/01/20 13:51:22.538 luup_log:57: BroadLink_Mk2 debug: 192.168.0.54 <0x766d8520>
50 07/01/20 13:51:23.539 luup_log:57: BroadLink_Mk2 debug: {} --> BroadLinkDevices <0x766d8520>
10 07/01/20 13:51:23.544 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 All OK / BroadLink_Mk2 <0x764d8520>
10 07/01/20 13:51:23.565 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 OK / BroadLink_Mk2 <0x764d8520>
10 07/01/20 13:51:35.442 mg_callback from IP:127.0.0.1:51882 /port_3480/data_request id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_Mk2&_=1593606102636 start id: 32 <0x7247d520>
12 07/01/20 13:51:35.442 luvd_get_info_data_request starting /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_Mk2&_=1593606102636 pMem 0x182d000/25350144 diff: 7602176 <0x7247d520>

@ Seeker That’s useful info. The ‘Broadcasting discovery message’ was issued but no BroadLink device was found, as indicated by:

50 07/01/20 13:51:23.539 luup_log:57: BroadLink_Mk2 debug: {} --> BroadLinkDevices <0x766d8520>

However some device was found at this debug line (ip address redacted and you may want to do the same in your replies if possible).

50 07/01/20 13:51:22.538 luup_log:57: BroadLink_Mk2 debug: redacted <0x766d8520>

but it could be anything that responds to broadcasts. What is it - your Vera? Then in your previous post, you have:

{“24:df:a7:d3:2c:05”:{“blInternalId”:"???",“blKey”:“097628343fe99e23765c1513accf8b02”,“blDeviceType”:10119,“blIp”:“Redacted”,“blDesc”:“RM4 Pro”}}

given the ip address mentioned; it appears that the Broadlink device is on another sub net? Where it is unlikely to be detected.

Yes, that would be the Veraplus.
You were right that the Veraplus and Broadlink were on different subnets. I have now moved the Veraplus onto the same subnet as the Broadlink and performed the same procedure as the last time.

25 07/02/20 2:17:51.748 LuImplementation::StartLua device: 57 file:I_BroadLink_Mk2_1.xml startup:luaStartUp pLuaInterface: 0x13d28e0 ip: port 0 protocol: raw <0x76c90520>
25 07/02/20 2:17:51.749 LuImplementation::StartLua running startup code for 57 I_BroadLink_Mk2_1.xml <0x76c90520>
50 07/02/20 2:17:51.750 luup_log:57: BroadLink_Mk2 debug: Initialising plugin: BroadLink_Mk2 <0x76c90520>
50 07/02/20 2:17:51.750 luup_log:57: BroadLink_Mk2 debug: Using: Lua 5.1 <0x76c90520>
50 07/02/20 2:17:51.750 luup_log:57: BroadLink_Mk2 debug: 0.55 --> PluginVersion <0x76c90520>
50 07/02/20 2:17:51.768 luup_log:57: BroadLink_Mk2 debug: Using: dkjson <0x76c90520>
50 07/02/20 2:17:51.779 luup_log:57: BroadLink_Mk2 debug: 300 --> PollInterval <0x76c90520>
50 07/02/20 2:17:51.782 luup_log:57: BroadLink_Mk2 debug: Broadcasting discovery message <0x76c90520>
50 07/02/20 2:17:51.783 luup_log:57: BroadLink_Mk2 debug: redacted <0x76c90520>
50 07/02/20 2:17:52.784 luup_log:57: BroadLink_Mk2 debug: {} --> BroadLinkDevices <0x76c90520>
10 07/02/20 2:17:52.789 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 All OK / BroadLink_Mk2 <0x76a90520>
10 07/02/20 2:17:52.811 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 OK / BroadLink_Mk2 <0x76a90520>
10 07/02/20 2:17:59.914 mg_callback from IP:127.0.0.1:51044 /port_3480/data_request id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20BroadLink_Mk2&_=1593652515951 start id: 52 <0x72a19520>
12 07/02/20 2:17:59.914 luvd_get_info_data_request starting /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20BroadLink_Mk2&_=1593652515951 pMem 0x164c000/23379968 diff: 7598080 <0x72a19520>

OK - same as before. The BroadLink device is not responding to the broadcasts. May be a router issue? Can you Ping it from the Vera Edge? Using AltUI go to Misc–>OsCommand then enter a ping command and see what happens.

The plugin needs to id your BroadLink device - until it can, it’s a problem. In previous cases we knew the BroadLink device type and could manually enter as you previously tried with the json code. However with a brand new device (which yours appears to be) we need the magic BroadLink device type code in order to proceed.

Ping from ALTUI I get ‘failed to execute’
Tried pinging from laptop on the same subnet and I get ‘No route to host’
I can ping other devices like Veraplus.
Not sure how to resolve?

I did that and crashed my system. I think we need a network engineer to chime in?

The newest class of Broadlink devices will not respond locally if they have been “provisioned” with the Broadlink cloud via the Broadlink app. You have to disable cloud access first. Here is how others have done it - https://github.com/home-assistant/core/issues/30215#issuecomment-581159499. Try that and then see if the discovery works.

Not 100% clear but I tried to follow the suggestions and I got to the stage where its looks like the Broadlink is broadcasting on WI-FI the device Universal Remote (unsecured, also interesting in their doc they say the device should be named BroadLink_??? or a variation).

I then re-ran as before but still not picked up

50 07/02/20 14:40:35.705 luup_log:57: BroadLink_Mk2 debug: Initialising plugin: BroadLink_Mk2 <0x77594520>
50 07/02/20 14:40:35.705 luup_log:57: BroadLink_Mk2 debug: Using: Lua 5.1 <0x77594520>
50 07/02/20 14:40:35.716 luup_log:57: BroadLink_Mk2 debug: 0.55 --> PluginVersion <0x77594520>
50 07/02/20 14:40:35.733 luup_log:57: BroadLink_Mk2 debug: Using: dkjson <0x77594520>
50 07/02/20 14:40:35.734 luup_log:57: BroadLink_Mk2 debug: 300 --> PollInterval <0x77594520>
50 07/02/20 14:40:35.737 luup_log:57: BroadLink_Mk2 debug: Broadcasting discovery message <0x77594520>
50 07/02/20 14:40:35.738 luup_log:57: BroadLink_Mk2 debug: redacted <0x77594520>
50 07/02/20 14:40:36.739 luup_log:57: BroadLink_Mk2 debug: {} --> BroadLinkDevices <0x77594520>
10 07/02/20 14:40:36.745 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 All OK / BroadLink_Mk2 <0x77394520>
10 07/02/20 14:40:36.766 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 OK / BroadLink_Mk2 <0x77394520>
10 07/02/20 14:40:42.772 mg_callback from IP:127.0.0.1:59250 /port_3480/data_request id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_mk2&_=1593693361516 start id: 60 <0x72f1d520>
12 07/02/20 14:40:42.772 luvd_get_info_data_request starting /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_mk2&_=1593693361516 pMem 0x12cb000/19705856 diff: 7593984 <0x72f1d520>

Step forward?

25 07/03/20 0:16:17.127 LuImplementation::StartLua running startup code for 57 I_BroadLink_Mk2_1.xml <0x77476520>
50 07/03/20 0:16:17.127 luup_log:57: BroadLink_Mk2 debug: Initialising plugin: BroadLink_Mk2 <0x77476520>
50 07/03/20 0:16:17.127 luup_log:57: BroadLink_Mk2 debug: Using: Lua 5.1 <0x77476520>
50 07/03/20 0:16:17.128 luup_log:57: BroadLink_Mk2 debug: 0.55 --> PluginVersion <0x77476520>
50 07/03/20 0:16:17.148 luup_log:57: BroadLink_Mk2 debug: Using: dkjson <0x77476520>
50 07/03/20 0:16:17.148 luup_log:57: BroadLink_Mk2 debug: 300 --> PollInterval <0x77476520>
50 07/03/20 0:16:17.152 luup_log:57: BroadLink_Mk2 debug: Broadcasting discovery message <0x77476520>
50 07/03/20 0:16:17.153 luup_log:57: BroadLink_Mk2 debug: redacted Veraplus <0x77476520>
50 07/03/20 0:16:17.702 luup_log:57: BroadLink_Mk2 debug: redacted Broadlink app iPhone <0x77476520>
50 07/03/20 0:16:17.704 luup_log:57: BroadLink_Mk2 debug: **Rx’ed a discovery response: rxMsg length = 48
50 07/03/20 0:16:17.705 luup_log:57: BroadLink_Mk2 debug: Error: discovery msg - incorrect size: redacted Broadlink app iphone <0x77476520>
50 07/03/20 0:16:18.705 luup_log:57: BroadLink_Mk2 debug: {} --> BroadLinkDevices <0x77476520>
10 07/03/20 0:16:18.712 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 All OK / BroadLink_Mk2 <0x77276520>
10 07/03/20 0:16:18.722 XXX-UpdateSystemMessagesTasks StartupTask #7 = 4 OK / BroadLink_Mk2 <0x77276520>
10 07/03/20 0:16:22.086 mg_callback from IP:127.0.0.1:38427 /port_3480/data_request id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_mk2&_=1593722570141 start id: 37 <0x7341b520>
12 07/03/20 0:16:22.086 luvd_get_info_data_request starting /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%201500%20%2Fvar%2Flog%2Fcmh%2FLuaUPnP.log%20%7C%20grep%20-i%20Broadlink_mk2&_=1593722570141 pMem 0x14c2000/21766144 diff: 7602176 <0x7341b520>

Doesn’t look it. In fact, given Blacey’s comments, looks like you are in a bit of a pickle on this one. I had a ‘quick’ read through the nearly 500 comments on the topic linked by Blacey. Didn’t come out the other side with much of a clear result. Has anyone?

I have to say, I find it really annoying that the manufacturer’s in general don’t provide a little API with just a bit of JSON to get things going. Problem is; there is virtually no money in the hardware. It’s all about getting their own little software ecosystem going, so they can value add when the figure out how to do that. Everyone ends up with about twenty apps on their phone to getting anything happening around their house.

In short until the Broadlink device can be discovered it’s probably a no go.

I figured why the ping caused me problems. It doesn’t stop until Control C if hit - bit hard through AltUI - unlike Windows that does stop by itself after a few pings. Need to put a count switch on it, like so:

ping -c 5 BroadLink_IP_address

Hmm, I think you are right. I now have to see if I should/can return the unit and get an RM3.
As you say the manufacture doesn’t provide much help, but considering that it would be in their interest that people see how easy it is to setup etc. and therefore buy never makes sense.
I am happy to get in contact with their support and try to get something sorted out. If you don’t mind giving me the exact questions I need to ask. Knowing how their support works you have to ask precise questions otherwise it becomes long drawn out exercise.

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules