Author Topic: BroadLink Mark II plugin  (Read 9930 times)

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #45 on: April 03, 2018, 07:46:28 am »
Quote
Error: discovery msg - incorrect size

The above is just a check to make sure we have a BroadLink device (we don't). In this case device 192.168.81.1 is replying. It's just ignored. What sort of device is 192.168.81.1 - a router?

And the rest of the log says what?

No BroadLink devices are being discovered. Possibly a router issue?

Offline rvendrame

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #46 on: April 03, 2018, 08:42:10 am »
Quote
Error: discovery msg - incorrect size

The above is just a check to make sure we have a BroadLink device (we don't). In this case device 192.168.81.1 is replying. It's just ignored. What sort of device is 192.168.81.1 - a router?

And the rest of the log says what?

No BroadLink devices are being discovered. Possibly a router issue?

192.168.81.1 is not in my DHCP range (192.168.1.xxx) ,  it should be the UPNP autodiscovery of one of my routers/modem.
I could not find anything else relevant in the logs.
The broadlink is in the same network as vera,  I was able to ping it (192.168.1.95) via SSH on Vera.   It is still working via e-control android app.
Can I force it manually into the plugin variables,  just to test it?


Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #47 on: April 03, 2018, 08:46:24 pm »
Quote
Can I force it manually into the plugin variables,  just to test it?

You haven't said what sort of BroadLink device you have. The plugin knows of about thirty. Assuming you have a 'RM2 Pro Plus 2' or a 'RM Mini' you can try one of the following:

In the variable 'BroadLinkDevices' you probably find  {}  or  []   Please take note and let know which type of bracket/braces were there. Update this variable by replacing the existing with the json code for either the  'RM2 Pro Plus 2' or a 'RM Mini' below with these two modifications:

1) the device's mac address  ie replace this  "3d:8e:43:43:ea:3d"  with your device's mac
2) the the device's ip address  ie replace this  "192.168.1.95"  if/as necessary

Leave the rest as is - be careful to edit carefully.

Save the updated 'BroadLinkDevices' variable and do a restart and browser refresh - check the log. If this doesn't work, I can look at a plan B.

Code: [Select]
{
"3d:8e:43:43:ea:3d": {
"blInternalId": "????",
"blKey": "097628343fe99e23765c1513accf8b02",
"blDeviceType": 10119,
"blIp": "192.168.1.95",
"blDesc": "RM2 Pro Plus 2"
}
}

Code: [Select]
{
"3d:8e:43:43:ea:3d": {
"blInternalId": "????",
"blKey": "097628343fe99e23765c1513accf8b02",
"blDeviceType": 10039,
"blIp": "192.168.1.95",
"blDesc": "RM Mini"
}
}

Offline rvendrame

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #48 on: April 04, 2018, 06:26:02 am »
@a-lurker,

I have a "Broadlink RM Pro" ,  you can check the specs here:   https://www.banggood.com/Broadlink-RM-Pro-Smart-Home-Automation-Phone-Wireless-Remote-Universal-Controller-p-942667.html

The variable had '[  ]',  I replaced it like you mentioned, and now I got this in the logs (besides the other regular messages):

Code: [Select]
50 04/04/18 7:16:18.204 luup_log:635: BroadLink_Mk2 debug: Header to be sent follows (ex checksum):
50 04/04/18 7:16:18.208 luup_log:635: BroadLink_Mk2 debug: Payload to be sent follows (unencrypted):
50 04/04/18 7:16:18.532 luup_log:635: BroadLink_Mk2 debug: Sending:  Authorisation: txMsg length = 136 <0x2b596680>
50 04/04/18 7:16:18.711 luup_log:635: BroadLink_Mk2 debug: Broadlink device: 2787 replied with: 03e9 <0x2b596680>

And no child device,  nor any panel where I can operate the plugin.

Maybe my device isn't supported (yet)?


Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #49 on: April 04, 2018, 07:49:58 am »
Quote
Maybe my device isn't supported (yet)?

It is because "Broadlink device: 2787 replied with: 03e9"     2787hex which is 10119dec -- refer to "blDeviceType" in json code.

It appears that Vera is communicating with your device. You may find that the json code you placed in 'BroadLinkDevices' variable has now changed. eg "blInternalId": "? ? ? ?", probably no longer contains  ? ? ? ?   If the json code has changed please post it here.

Possibly just need to restart the Luup engine again and refresh the browser? Keep an eye on the log and all the messages.
« Last Edit: April 04, 2018, 08:48:18 am by a-lurker »

Offline rvendrame

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #50 on: April 04, 2018, 08:31:47 am »
@a-lurker,

My mistake, sorry!   The new devices were created at 'no room' ,  so I didn't seem them before...   Now I have both IR & Temp sensors!

The 'Control' tab at IR sensor is empty on both ALTUI & UI7, is this correct? .  I can go to 'Actions' tab and trigger 'LearnIRCode' action,  the broadlink lights up the yellow led (correctly),  I get a popup "response ok (200)" in ALTUI  but I can see the IR code anywhere.   Maybe another 'user error'?

Thanks again!

Code: [Select]
50 04/04/18 9:29:55.731 luup_log:635: BroadLink_Mk2 debug: Initialising plugin: BroadLink_Mk2 <0x2c1ac680>
50 04/04/18 9:29:55.732 luup_log:635: BroadLink_Mk2 debug: Using: Lua 5.1 <0x2c1ac680>
50 04/04/18 9:29:55.733 luup_log:635: BroadLink_Mk2 debug: 0.54 --> PluginVersion <0x2c1ac680>
50 04/04/18 9:29:55.751 luup_log:635: BroadLink_Mk2 debug: Using: dkjson <0x2c1ac680>
50 04/04/18 9:29:55.751 luup_log:635: BroadLink_Mk2 debug: 300 --> PollInterval <0x2c1ac680>
50 04/04/18 9:29:55.756 luup_log:635: BroadLink_Mk2 debug: Broadcasting discovery message <0x2c1ac680>
50 04/04/18 9:29:55.757 luup_log:635: BroadLink_Mk2 debug: 192.168.81.1 <0x2c1ac680>
50 04/04/18 9:29:55.760 luup_log:635: BroadLink_Mk2 debug: Rx'ed a discovery response: rxMsg length = 48
50 04/04/18 9:29:55.761 luup_log:635: BroadLink_Mk2 debug: Error: discovery msg - incorrect size <0x2c1ac680>
50 04/04/18 9:29:56.766 luup_log:635: BroadLink_Mk2 debug: Header to be sent follows (ex checksum):
50 04/04/18 9:29:56.770 luup_log:635: BroadLink_Mk2 debug: Payload to be sent follows (unencrypted):
50 04/04/18 9:29:56.822 luup_log:635: BroadLink_Mk2 debug: Sending:  Authorisation: txMsg length = 136 <0x2c1ac680>
50 04/04/18 9:29:56.841 luup_log:635: BroadLink_Mk2 debug: Broadlink device: 2787 replied with: 03e9 <0x2c1ac680>
50 04/04/18 9:29:56.842 luup_log:635: BroadLink_Mk2 debug: Error: errorMsg = fff9 <0x2c1ac680>
50 04/04/18 9:29:56.842 luup_log:635: BroadLink_Mk2 debug: This device is probably offline - mac address: 34:ea:34:88:f5:db <0x2c1ac680>
50 04/04/18 9:29:56.843 luup_log:635: BroadLink_Mk2 debug: k = rf433 <0x2c1ac680>
50 04/04/18 9:29:56.844 luup_log:635: BroadLink_Mk2 debug: k = rf433 has no associated code at this time <0x2c1ac680>
50 04/04/18 9:29:56.844 luup_log:635: BroadLink_Mk2 debug: k = ir <0x2c1ac680>
50 04/04/18 9:29:56.845 luup_log:635: BroadLink_Mk2 debug: 34:ea:34:88:f5:db_ir <0x2c1ac680>
50 04/04/18 9:29:56.845 luup_log:635: BroadLink_Mk2 debug: 34:ea:34:88:f5:db <0x2c1ac680>
50 04/04/18 9:29:56.856 luup_log:635: BroadLink_Mk2 debug: RM Pro - IR 1 <0x2c1ac680>
50 04/04/18 9:29:56.857 luup_log:635: BroadLink_Mk2 debug: urn:schemas-micasaverde-com:device:IrTransmitter:1 <0x2c1ac680>
50 04/04/18 9:29:56.857 luup_log:635: BroadLink_Mk2 debug: D_BroadLink_Mk2_IrRf_1.xml <0x2c1ac680>
50 04/04/18 9:29:56.858 luup_log:635: BroadLink_Mk2 debug: type = function, value = function: 0x1a7a7b8 <0x2c1ac680>
50 04/04/18 9:29:56.858 luup_log:635: BroadLink_Mk2 debug: k = rf315 <0x2c1ac680>
50 04/04/18 9:29:56.859 luup_log:635: BroadLink_Mk2 debug: k = rf315 has no associated code at this time <0x2c1ac680>
50 04/04/18 9:29:56.860 luup_log:635: BroadLink_Mk2 debug: k = temp <0x2c1ac680>
50 04/04/18 9:29:56.861 luup_log:635: BroadLink_Mk2 debug: 34:ea:34:88:f5:db_temp <0x2c1ac680>
50 04/04/18 9:29:56.861 luup_log:635: BroadLink_Mk2 debug: 34:ea:34:88:f5:db <0x2c1ac680>
50 04/04/18 9:29:56.862 luup_log:635: BroadLink_Mk2 debug: RM Pro - temperature 1 <0x2c1ac680>
50 04/04/18 9:29:56.862 luup_log:635: BroadLink_Mk2 debug: urn:schemas-micasaverde-com:device:TemperatureSensor:1 <0x2c1ac680>
50 04/04/18 9:29:56.863 luup_log:635: BroadLink_Mk2 debug: D_TemperatureSensor1.xml <0x2c1ac680>
50 04/04/18 9:29:56.863 luup_log:635: BroadLink_Mk2 debug: type = function, value = function: 0x144ee78 <0x2c1ac680>
50 04/04/18 9:29:56.865 luup_log:635: BroadLink_Mk2 debug: { "34:ea:34:88:f5:db": { "blInternalId": "00000003", "blKey": "c54a800bfcbdf67a32316d6a69a4e359", "blDeviceType": 10119, "blIp": "192.168.1.100", "blDesc": "RM Pro" } } --> BroadLinkDevices <0x2c1ac680>

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #51 on: April 04, 2018, 08:47:12 am »
Quote
The 'Control' tab at IR sensor is empty on both ALTUI & UI7, is this correct?
Yes.

Quote
I get a popup "response ok (200)"
  Not sure about this one but it sounds OK! A screen capture would be good.

Have a look in the parent variables for "LearntIRCode" and "LearntRFCode". The codes should also be seen in the log.

Offline rvendrame

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #52 on: April 04, 2018, 09:06:59 am »
@a-lurker,  alright,  thanks a lot for your support!

Offline Domoworking

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #53 on: April 06, 2018, 04:23:22 pm »
I wish to thank a-lurker for this awesome and incredible plugin! I was about to send my Vera Plus back to Amazon.
Let me just say that as a complete newbie (I got my Vera Plus yesterday) I had to struggle quite a bit to understand how the whole thing works (and I'm still sure I'm missing mosto of it). It would be great to had a guide for dummies :)

Anyway, thanx once more, I'm gonna buy my next Broadlink :)

Offline nrv

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: BroadLink Mark II plugin
« Reply #54 on: April 07, 2018, 12:55:07 am »
Hi All,

I am not a VERA expert and not an IT person. Does anyone have a step by step manual (with sort of screenshot) how to set up the Broadlink RM2 with the Vera app?

Thanks a lot.

Offline Buxton

  • Full Member
  • ***
  • Posts: 129
  • Karma: +9/-0
Re: BroadLink Mark II plugin
« Reply #55 on: April 16, 2018, 09:09:25 pm »
I'm getting an error installing to openLuup.  I downloaded the latest plugin files from Github:

Code: [Select]
2018-04-16 17:05:14.846   openLuup.http:: GET /data_request?id=action&output_format=json&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreateDevice&Description=Broadlink&UpnpDevFilename=D_BroadLink_Mk2_1.xml&UpnpImplFilename=I_BroadLink_Mk2_1.xml&RoomNum=0&Reload=1 HTTP/1.1 tcp{client}: 0x350c24a8
2018-04-16 17:05:14.848   luup.call_action:: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.CreateDevice
2018-04-16 17:05:14.862   luup.create_device:: ERROR [74] D_BroadLink_Mk2_1.xml / I_BroadLink_Mk2_1.xml /  : ./openLuup/loader.lua:330: bad argument #1 to 'ipairs' (table expected, got string)

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #56 on: April 16, 2018, 11:45:41 pm »
Looks like openLuup doesn't like empty action lists. So in the file  "S_BroadLink_Mk2_1.xml"  is this:

Code: [Select]
....
    <actionList>
        <action>
            <!-- <name>Test</name>
            <argumentList>
                <argument>
                    <name>Var1</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Var1</relatedStateVariable>
                </argument>
                <argument>
                    <name>Var2</name>
                    <direction>in</direction>
                    <relatedStateVariable>A_ARG_TYPE_Var2</relatedStateVariable>
                </argument>
            </argumentList> -->
        </action>
    </actionList>
....

First thing to try is to remove the xml comment, so that the code looks like the following; upload the modified file and restart the Luup Engine.

Code: [Select]
....
    <actionList>
        <action>
        </action>
    </actionList>
....

If that doesn't work try removing the actionList section completely. ie the code shown above. Then upload and restart. Be careful when editing not to remove anything else.

Offline akbooer

  • Master Member
  • *******
  • Posts: 6153
  • Karma: +275/-69
  • "Less is more"
Re: BroadLink Mark II plugin
« Reply #57 on: April 17, 2018, 08:04:25 am »
Looks like openLuup doesn't like empty action lists.

AFAIK, this is not the case.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 858
  • Karma: +63/-8
Re: BroadLink Mark II plugin
« Reply #58 on: April 17, 2018, 08:33:34 am »
Quote
Looks like openLuup doesn't like empty action lists.

Perhaps I should be more precise: doesn't like "xml comments" in empty action lists. Hope to see what @Buxton finds out.

Offline Domoworking

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +1/-0
Re: BroadLink Mark II plugin
« Reply #59 on: April 17, 2018, 07:33:17 pm »
Hi All,

I am not a VERA expert and not an IT person. Does anyone have a step by step manual (with sort of screenshot) how to set up the Broadlink RM2 with the Vera app?

Thanks a lot.
Let's see if I remember all the steps...
Go to github page (first post) and download the files (all the xml and Json).
Then go to Vera web page under Apps->Develop Apps and select Luup files
There you can upload all the files. Once finished select create device and add D_BroadLink_Mk2_1.xml as device_file and I_BroadLink_Mk2_1.xml as impl_file
Your physical broadlink should be then discovered.

Regards