Author Topic: PLUGIN: Broadlink RM Interface  (Read 1829 times)

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +105/-5
PLUGIN: Broadlink RM Interface
« on: October 28, 2017, 06:08:31 am »
Broadlink RM2 Interface
------------------------

Learn (IR only) and send (IR/RF codes) remote codes using your Vera.

No RM-Bridge required!!


Supported Devices
-------------------

All Broadlink RM/RM2/RM3 devices.


Features:
------------
Automatic detection of Broadlink devices
Management of IR codes from the code management page.
Manual send of codes from the code management page.
Send code using UPNP action, lua call_action or from a scene

Version History:
---------------------

v1.13   (Version ID: 35006) November 14, 2017
-- fixed - timestamp issue caused plugin crash on certain firmware versions
-- fixed - unsupported devices appear in discovered device list

v1.10   (Version ID: 34952) November 7, 2017
-- added - device discovery through device probing when discovery mechanism fails to discover devices
-- added - device discovery via import of e-Control configuration
-- changed - prevent re-import of IR/RF codes when processing additional e-Control imports
-- changed - plugin excessively chatty when debug mode is disabled

v1.8     (Version ID: 34906) November 3, 2017
-- fixed - json handling caused configuration page to fail to load under certain circumstances
-- added - better device determination - support for more device variants

v1.6     (Version ID: 34892) October 30, 2017
-- fixed - UPnP SendCode action causes plugin crash

v1.5     (Version ID: 34886) October 30, 2017
-- fixed - code corruption when importing Pronto/e-Control codes
-- fixed - code verification regected valid code under certain conditions
-- added - update code name from code management page

v1.4     (Version ID: 34871) October 29, 2017
-- added - Ability to manually import a code in the code management page
-- added - Ability to manually import a PRONTO format code in the code management page
-- added - Ability to import IR Code configuration from the Broadlink e-Controll mobile app (Android or IOS)
NOTE* - To import code from e-Control, you must
  1) know the IP Address of your device
  2) have the e-Control application running and select the "more functions" page (stacked bars icon in upper left corner of the "Control" page
  3) Select "share", then select "Share to other phones in WLAN"
  4) On the plugin code management page, in the "Add code from network connected device running e-Control." box, enter the IP address of the phone and click "Add"

v1.3     (Version ID: 34862) October 29, 2017
-- fixed - typo prevented sending non-RF codes to non-pro devices

v1.2     (Version ID: 34856) October 29, 2017
-- fixed - Broadlink device initial discovery did not occur
-- added - option on device page to rescan for devices

v1.1     (Version ID: 34846) October 28, 2017
-- Initial release.
-- NOTE: This version will display in the UI as "v1.0"




Automatic installation:
----------------------------
You can install the plugin via the App Store from you Vera under the Apps/Install Apps menu.

You can update to the latest approved version in the App Store by going to Apps/My Apps, selecting the plugin and enabling "Auto Update"

You can force your Vera to update to a specific release before it is approved in the App Store by entering the following URL into your browser:
Code: [Select]
http://<your ip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8996&Version=<Version ID>
Make sure to replace <your ip> with the IP Address of your Vera, and <Version ID> with the Version ID provided in the release post/ revision history.



Configuration
--------------

Once the plugin is installed, allow the LuaUPnP engine to finish loading and REFRESH YOUR BROWSER.

Open the device setup page, and click on the "Device" tab. The plugin will list all the Broadlink devices found on the network. Click on the "select" button next to the device you want to use for sending/learning IR codes.

You can then click on the "Codes" tab. The Codes page will show a summary of the existing learned codes (which will initially be empty). You can the click on the "Learn IR" button. The plugin will ask for the name you wish to give to the learned code. Once you enter the name and click on "ok", the plugin will place the selected Broadlink device into learn mode (an amber led will light on the Broadlink device). You then have 30 seconds to point the remote at the broadlink device and press the button you wish to learn. Once the code is learned, the broadlink device will return to normal mode, and the code page will be updated with the new code. Once a code is learned, you can then test the code by clicking the "Send" button next to the code. Unneeded or unwanted codes can be removed by clicking on the "Remove" button.


To have the Broadlink device send an IR code, you can:

1) Use a UPNP action to cause a stored code to be sent.

ie:
Code: [Select]
http://vera.ip.add.ress:3480/data_request?id=action&DeviceNum=<DeviceNumber>&serviceId=urn:micasaverde-com:serviceId:Broadlink1&action=SendCode&CodeData=<stored code identifier>

Where:
    vera.ip.add.ress = The IP Address of your Vera
    <DeviceNumber> = The Vera Device ID of the Broadlink RM device
    <stored code identifier> = the unique identifier of the stored code (see below for details)

or

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:Broadlink1", "SendCode", {CodeData = "<stored code identifier>"}, <DeviceNumber>)

Where:
    <DeviceNumber> = The Vera Device ID of the Broadlink RM device
    <stored code identifier> = the unique identifier of the stored code (see below for details)




2) Use the Vera Scene Advanced editor, to send a code from a Vera Scene.

In the Vera Scene Editor, to to the advanced editor and select "Add Action", select the Broadlink RM Interface device, Select the "SendCode" action, and enter the stored code identifier into the CodeData text box, and click on "Add".



Stored Code Identifiers
===============

Each learned code must be identified with a unique identifier. The unique identifier can be either the name of the stored code or the ID shown on the code management page.

Please note that, at this time, if you use more that a single word for the name of a code, you *MUST* use the ID to identify the code.

NOTE: Although the plugin identifies the IP address of the device that learned a code, the codes are *NOT* specific to individual Broadlink devices. You *CAN* learn code with one device and send them with another device.



Import IR/RF codes or Devices from e-Control
==============================

  1) Determine the IP Address of the IOS/Android device running e-Control.
  2) have the e-Control application running and select the "more functions" page (stacked bars icon in upper left corner of the "Control" page
  3) Select "share", then select "Share to other phones in WLAN"
  4) On the plugin code management page, in the "Add code from network connected device running e-Control." box, enter the IP address of the phone and click "Add"

Note: Devices included in the e-Control data are not directly imported into the plugin. The device identifier is used to locate the device, if the device is located, it is added to the discovered device list. The device(s) are NOT automatically selected.


**** PLEASE NOTE ****

If you have problems, and expect any support.... you MUST post LuaUPnP logs showing the operation of the plugin (with the plugin debug mode enabled).
« Last Edit: November 15, 2017, 01:41:41 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9729
  • Karma: +737/-136
    • RTS Services Plugins
Re: PLUGIN: Broadlink RM Interface
« Reply #1 on: October 28, 2017, 10:24:39 am »
Great ... you beat me to be to it ...  I will still probably release mine as well ... integrated with voice control.

« Last Edit: October 28, 2017, 10:30:51 am by RichardTSchaefer »

Offline zedrally

  • Hero Member
  • *****
  • Posts: 857
  • Karma: +1/-0
  • Black Cat Controllers & Control Systems
    • Black Cat Control Systems
Re: PLUGIN: Broadlink RM Interface
« Reply #2 on: October 28, 2017, 04:43:34 pm »
mmm, I'm waiting on my two to arrive (Pro & Mini) so I can test. Now I can't wait!
I had been wanting to buy a Goggle Home so having voice available would be a plus, so I'm still waiting on your your version richard!
Thanks guy's ( both of you), making devices compatible with Vera is really state of art, just need to get Vera to sort out it's own bugs and the world will be a better place.



Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, then some  Black Cat Cat's Eye PIR's & Door-Window Sensors plus a Z-UNO or 2.

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #3 on: October 28, 2017, 07:36:46 pm »
weird, it does not show up in the available apps...

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9729
  • Karma: +737/-136
    • RTS Services Plugins
Re: PLUGIN: Broadlink RM Interface
« Reply #4 on: October 28, 2017, 07:43:54 pm »
Did you notice:

Quote

You can force your Vera to update to a specific release before it is approved in the App Store by entering the following URL into your browser:
http://<your ip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8996&Version=<Version ID>


Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #5 on: October 28, 2017, 07:59:48 pm »
Did you notice:

Quote

You can force your Vera to update to a specific release before it is approved in the App Store by entering the following URL into your browser:
http://<your ip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8996&Version=<Version ID>


yup, just don't know what to put in for the version...  any entry gets me this error:

Code: [Select]
ERROR: Failed to retrieve plugins
EDIT: never mind, i'm a dumbass...

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #6 on: October 29, 2017, 09:58:35 am »
Auto-discovery does not seem to work.  I've installed the plugin and it shows "no selected device" on the devices list.  I uninstalled and re-installed the UPnP proxy and verified it is running by going to http://<IP OF VERA>:2529/version.   that returns the running version.  Not sure what else to try.
« Last Edit: October 29, 2017, 10:19:33 am by sebby »

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +105/-5
Re: PLUGIN: Broadlink RM Interface
« Reply #7 on: October 29, 2017, 12:26:56 pm »
Auto-discovery does not seem to work.

My fault... Fixed in latest version...


weird, it does not show up in the available apps...

With the rate that Vera/Mios reviews and approves plugins, It should be available on the app store in 3 to 6 weeks. (ok... A little exagerated... but not much... I have seen approvals take over two weeks at some points... Some of my plugins have had 6 or seven updates pending approval at one time...)


« Last Edit: October 29, 2017, 12:33:26 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #8 on: October 29, 2017, 08:09:30 pm »
Thank you!!! this is awesome... I really wish there was a way to import all the codes i have already learned on the iphone app.   Guess i'll spend some time churning through the 'motes.

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +105/-5
Re: PLUGIN: Broadlink RM Interface
« Reply #9 on: October 30, 2017, 01:48:56 am »
I really wish there was a way to import all the codes i have already learned on the iphone app.

I depends on which app you are refering to... there are Two... e-control and IHC...

If you are using e-control, i have figured out how to retrieve the IR Codes from an Android or IOS device... The tricky part is parsing the data and adding it... which will take a little time...

EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - Broadlink RM - MyQGateway

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #10 on: October 30, 2017, 09:14:31 am »
If you are using e-control, i have figured out how to retrieve the IR Codes from an Android or IOS device... The tricky part is parsing the data and adding it... which will take a little time...

I am using e-control.  If there is anyway i can help, let me know...

Offline hvazana

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: PLUGIN: Broadlink RM Interface
« Reply #11 on: October 30, 2017, 02:50:13 pm »
Guys. could you tell how did you succeed to download the plugin. The command for forcing the Vera to retrieve it did not work for me. Maybe I?m doing something wrong .  Any tip you can share ?? 


Sent from my iPhone using Tapatalk

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #12 on: October 30, 2017, 02:59:43 pm »
Guys. could you tell how did you succeed to download the plugin. The command for forcing the Vera to retrieve it did not work for me. Maybe I?m doing something wrong .  Any tip you can share ?? 


Sent from my iPhone using Tapatalk

Did you try this?  replace <your ip> with the ip of your vera...

Code: [Select]
http://<your ip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8996&Version=34871

Offline hvazana

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: PLUGIN: Broadlink RM Interface
« Reply #13 on: October 30, 2017, 03:24:59 pm »
 Worked !!! Thanks


Sent from my iPhone using Tapatalk

Offline sebby

  • Full Member
  • ***
  • Posts: 195
  • Karma: +6/-3
Re: PLUGIN: Broadlink RM Interface
« Reply #14 on: October 30, 2017, 03:40:30 pm »
I really wish there was a way to import all the codes i have already learned on the iphone app.

I depends on which app you are refering to... there are Two... e-control and IHC...

If you are using e-control, i have figured out how to retrieve the IR Codes from an Android or IOS device... The tricky part is parsing the data and adding it... which will take a little time...

Import worked like a charm,but it seems the codes do not work when triggered from the vera.    I was watching the logs when i sent the command via a web request (http://my.vera.ip.addr:3480/data_request?id=action&DeviceNum=178&serviceId=urn:micasaverde-com:serviceId:Broadlink1&action=SendCode&CodeData=1509390321) and this is what showed:

Code: [Select]
08 10/30/17 16:06:42.893 JobHandler_LuaUPnP::HandleActionRequest device: 178 service: urn:micasaverde-com:serviceId:Broadlink1 action: SendCode <0x715c7520>
08 10/30/17 16:06:42.893 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=178 <0x715c7520>
08 10/30/17 16:06:42.893 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Broadlink1 <0x715c7520>
08 10/30/17 16:06:42.893 JobHandler_LuaUPnP::HandleActionRequest argument action=SendCode <0x715c7520>
08 10/30/17 16:06:42.893 JobHandler_LuaUPnP::HandleActionRequest argument CodeData=1509390321 <0x715c7520>
02 10/30/17 16:06:42.894 luup_log:178: (BroadLink::UPNP::SendCode) Called. <0x715c7520>
01 10/30/17 16:06:42.895 LuaInterface::CallFunction_Job device 178 function SBroadlink_Broadlink1_SendCode_run failed [string "VERSION = "v1.4"..."]:1596: attempt to index local 'sCommand' (a number value) <0x715c7520>


If i send the code from the send button on the codes page in the plugin i get the following, but still no response from the TV:

Code: [Select]
08 10/30/17 16:30:02.955 JobHandler_LuaUPnP::HandleActionRequest device: 178 service: urn:micasaverde-com:serviceId:Broadlink1 action: SendCode <0x713c7520>
08 10/30/17 16:30:02.956 JobHandler_LuaUPnP::HandleActionRequest argument action=SendCode <0x713c7520>
08 10/30/17 16:30:02.956 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=178 <0x713c7520>
08 10/30/17 16:30:02.956 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Broadlink1 <0x713c7520>
08 10/30/17 16:30:02.956 JobHandler_LuaUPnP::HandleActionRequest argument CodeData={"Name":"TV_BTN_34","Timestamp":1509390321,"Source":"e-Control","Code":"32363030353830303030303132363934313431313131313431323337313231343132313231313134313131333133313231323338313233373132313331343336313133383132333731643264313233383133313131313134313231333133333631333132313131343133313231323133313133383131333831323338313531303131333831323338313333363134333631323030303464353030303132373462313230303063353230303031323634623132303030643035"} <0x713c7520>
02 10/30/17 16:30:02.957 luup_log:178: (BroadLink::UPNP::SendCode) Called. <0x713c7520>
02 10/30/17 16:30:03.446 luup_log:178: (BroadLink::UPNP::SendCode) Sent code data. <0x713c7520>

ALSO: One suggestion for a future version (as if you hadn't done enough), it would be nice to add the ability to give the imported codes a friendly name.  I can prpbably edit them in the advanced variable tab,but it would be nice to be able to do it from the UI.
« Last Edit: October 30, 2017, 04:33:41 pm by sebby »