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

Online a-lurker

  • Hero Member
  • *****
  • Posts: 765
  • Karma: +43/-8
BroadLink Mark II plugin
« on: January 09, 2018, 08:25:59 pm »
A BroadLink Mark II plugin to try out. Somewhat experimental at this stage (Jan 2018).

The code can be found on GitHub here:

      https://github.com/a-lurker

You can install the plugin from the 'Alternate App Store' (once I set it up), which works together with the 'ALTUI' plugin.

      http://forum.micasaverde.com/index.php/topic,38102.0.html

Note that 'ALTUI' is highly recommended to all users, together with openLuup.

Caveats:
Only tested on the RM3 Pro 2 device. While other devices may be discovered, they might not work. This plugin is based on information from here:

https://github.com/mjg59/python-broadlink
https://blog.ipsumdomus.com/broadlink-smart-home-devices-complete-protocol-hack-bc0b4b397af1
https://github.com/sayzard/BroadLinkESP/blob/master/BroadLinkESP.cpp

The reverse engineering is ongoing. Consequently it may not be possible to have all functionality operational until that process is complete.

If the IR Led on your device flashes when you transmit a code, the plugin is working. It's a different matter whether you have the correct code or not. Many learnt codes have excessive replication and some codes are not replicated enough. ie some TVs, etc require a code to be sent two or three time, in close succession, for them to work. I propose not to engage in discussions on why your codes work or not. See this link instead:

www.remotecentral.com

Logging can be enabled by setting the DebugEnabled flag to '1'. You can use AltUI plugin to look at the log file:

See Misc-->Os Command--> Tail Logs Tab   Note: you can change the 50 to say 500 to see more log info.

In openLuup use the console logs:

http://<openLuup_ip_address>:3480/console?page=log

Or use the infoviewer plugin. Please provide a log file with any bug reports, otherwise the report may not be responded to.

What the plugin will do:
1) BroadLink and ProntoCodes can be used.

2) The one instance of the plugin can (in theory) handle multiple BroadLink physical  devices. The plugin will produce child devices as necessary, based on the capabilities of each BroadLink device discovered. eg a Broadlink Rm Pro will have a temperature and IR child device  associated with it.

3) BroadLink WiFi operated switches such as the SP1 & SP2 & MP1 may work - I haven't been able to test this.

What the plugin will not do:
1) Wall switches will not provide on/off status (do any of them provide status?)
2) The plugin does not interact with the "e-Control" phone app in any way.
3) The plugin  doesn't store IR or RF codes - codes need to be applied to the IR child.
4) The plugin  doesn't learn codes.


Potential problems:
1) RF codes may or may not work. Haven't tried it.

2) Getting codes:  As I understand it you can down load codes held by the "e-Control" app  ie: in the file eControl-data.zip I haven't tried this. Presumably the "e-Control" app needs to be running on the phone and you get the codes by entering in your browser this link - note: insert the phone's ip address:

http://<PHONE_ip_address>:48815"

If some one can post the file proffered, that would be good, as I would like to review its contents - especially any file containing codes for 315 MHz, as well as 433 MHz, as I haven't be able to check RF code functionality.

3) Your router blocks UDP broadcast traffic - that will casuse problems - read your router manual!

4) The BroadLink devices are identified by their MAC addresses. If you change the IP address of a BroadLink device for any reason, you need to restart the Luup engine. The new ip address will be discovered and used.

5) After a Vera Luup engine restart, there is 90 second delay before the plugin starts polling, then it polls at minimum of every five minutes. So temperatures, etc are updated at this rate.

6) Some BroadLink devices can control remote devices on 315 MHz, as well as 433 MHz. Some just allow 433 MHz (country based). The box the unit is delivered in, says what it contains. I'm unsure how this can be detected programmatically.

Sending a ProntoCode:
luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = 'your code here'}, DeviceID)

Sending a BroadLink IR or RF code:
luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendCode', {Code = 'your code here'}, DeviceID)

Using AltUI;  codes can be cut & pasted into the actions for easy testing.


Ver 0.51
Initial release.

This plugin has been tested using the AltUI plugin and the Vera UI7 interface with Firefox 57.0.2. It works with openLuup and on a Vera 3. UI5 may work.
« Last Edit: January 10, 2018, 04:01:42 am by a-lurker »

Offline zedrally

  • Hero Member
  • *****
  • Posts: 944
  • Karma: +3/-1
  • Black Cat Controllers & Control Systems
    • Black Cat Control Systems
Re: BroadLink Mark II plugin
« Reply #1 on: January 09, 2018, 09:19:49 pm »
Thanks a-lurker for doing this, it will get a lot of people out of a hole that they have been stranded in.


I'll trial it with a spare RMPro2 and report back, although I don't use Alt UI, I hoping that it will use UI7?
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, Broadlink RMPro & Mini plus a Z-UNO or 2.