Using BROADLINK RM2 on DOMOTICZ

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

hasan
Posts: 34
Joined: Saturday 31 October 2015 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by hasan »

Hi guys,

I`ve just found these two URLs:

OpenAPI_SDK - https://drive.google.com/file/d/0B65vYt ... 9sX00/view
SDK - https://drive.google.com/file/d/0B65vYt ... rcUl3/view

and this - http://rm-bridge.fun2code.de/

Do you think that it will be helpful for future integration?
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

hasan wrote:Hi guys,

I`ve just found these two URLs:

OpenAPI_SDK - https://drive.google.com/file/d/0B65vYt ... 9sX00/view
SDK - https://drive.google.com/file/d/0B65vYt ... rcUl3/view

and this - http://rm-bridge.fun2code.de/

Do you think that it will be helpful for future integration?
Hi hasan,

What integration ?

It's fully yet working on DOMOTICZ !

http://leffab.wix.com/domo-assist

I am one of the two co-developpers
dels
Posts: 3
Joined: Saturday 09 January 2016 2:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by dels »

Bonjour Fabrice,

I spent a good deal of time trying to find a way of doing what you guys are making possible, thanks a lot!

I got excited as I am now able to learn codes and such, specifically for IR so far... because unfortunately there is one limitation in the API that renders my RF communication useless:

{"code":2,"msg":"data error! length = 908, must be less then 900 bytes"}

What is weird is that it took me multiple times to even be able to record the code as it was giving me an error message most of the times, but it eventually registered after a few attempts.

As you can imagine, I cannot change the code that the remote is sending... is there a way we could fix the api to accept longer message length? That would be amazing as I am centering my RF/IR around the awesome (and awesomely cheap!) Broadlink RM2 Pro.

Thanks!

dels
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

dels wrote:Bonjour Fabrice,

I spent a good deal of time trying to find a way of doing what you guys are making possible, thanks a lot!

I got excited as I am now able to learn codes and such, specifically for IR so far... because unfortunately there is one limitation in the API that renders my RF communication useless:

{"code":2,"msg":"data error! length = 908, must be less then 900 bytes"}

What is weird is that it took me multiple times to even be able to record the code as it was giving me an error message most of the times, but it eventually registered after a few attempts.

As you can imagine, I cannot change the code that the remote is sending... is there a way we could fix the api to accept longer message length? That would be amazing as I am centering my RF/IR around the awesome (and awesomely cheap!) Broadlink RM2 Pro.

Thanks!

dels
Hello dels,

Which version off the tools are you using, the simple one with just the RM BRIDGE and API, or the more sophisticate version, for linux, or windows
Then Which codes are you try to record, simple remore, radio 433, radio 310/315

An to finnish are you using an android Smartphone, or an abdroid TV BOX to integrate the RM BRIDGE

I need fisrt those infos to help you

Bests regards
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

I want to say

Simple remote IR
dels
Posts: 3
Joined: Saturday 09 January 2016 2:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by dels »

forumfab wrote:
dels wrote:Bonjour Fabrice,

I spent a good deal of time trying to find a way of doing what you guys are making possible, thanks a lot!

I got excited as I am now able to learn codes and such, specifically for IR so far... because unfortunately there is one limitation in the API that renders my RF communication useless:

{"code":2,"msg":"data error! length = 908, must be less then 900 bytes"}

What is weird is that it took me multiple times to even be able to record the code as it was giving me an error message most of the times, but it eventually registered after a few attempts.

As you can imagine, I cannot change the code that the remote is sending... is there a way we could fix the api to accept longer message length? That would be amazing as I am centering my RF/IR around the awesome (and awesomely cheap!) Broadlink RM2 Pro.

Thanks!

dels
Hello dels,

Which version off the tools are you using, the simple one with just the RM BRIDGE and API, or the more sophisticate version, for linux, or windows
Then Which codes are you try to record, simple remore, radio 433, radio 310/315

An to finnish are you using an android Smartphone, or an abdroid TV BOX to integrate the RM BRIDGE

I need fisrt those infos to help you

Bests regards
Hi,

I am using RM Bridge 1.2 installed on an android smartphone that I do not use anymore, it is just there, always running. To learn the code I have used the RM Manage api which I downloaded and am running on an internal server. It is able to trigger the learn function of the RM2 Pro, no problem.

As mentioned, I would like to use the RM2 Pro to manage both RF and IR, and so far only IR is working. It seems like the RM Bridge is not able to run my RF codes (and has trouble recording them) because of a limitation in the bridge API in the length of the codes. {"code":2,"msg":"data error! length = 908, must be less then 900 bytes"}

I am able to record (and use!) the actual RF code directly to the RM2Pro if I go through the Broadlink e-Control app, so I know it is not a hardware problem.

I am also able to record and use the IR codes through the RM Bridge API, as they are a bit smaller.

For example, here is my Sharp TV IR code for on/off:

Code: Select all

http://rmbridge_ip:7474/?cmd=%7B%22api_id%22:1004,%22command%22:%22send_code%22,%22mac%22:%22b4:43:0d:aa:36:b5%22,%22data%22:%222600fe010b3a0b170a190a170a180a190a3b0a390a180a3c0a170a180a180b3a0a170a0005db0a3a0b170a180a180c180a3a0a170b170c3a09180a3b093c0a3a08190a3a0a0005960a3b09180b180a180a1909180a3c093a0b170a3a0a190a170c18093a0a180a0005db0a3a0a180a190a170a190b390a180a19093b0a19093b093a0a3b09180c390a0005960a3b09190b160b180a180a180a3a0a3b0a180a3a0b1809180b170b3b09180a0005db0a3a0b170a180b180b17093a0b1909180a3a0c18083b0a3a0a3a0a180a3b0a0005960b390a180b180a1809190b170a3a0b390a180a3b0b170b170b18093a0b180a0005db0a390a1a091909180a19093a0a19091a093a0a180a3b0a390a3b0b170a3a0a0005970a3a0a1909180a180a180b180a3b0a390b170b390b180b170a180b3a0a170b0005da0a3a0b1809190a180b170a3a0a180a180a3b0a180a3a0b3a093c0919093a0c0005940a3a0a1a09180b1809190b160a3b0b390a19093a0a1909190a180a3b0b18080005dc093a0a1909190a180b17093b0a180a190b390b170b390b390a3a0a180b3a0a0005970a390a180b1909180a180c17093a0b3b09180a3a0a180b1908190a3b0a18090005da0a3b0b170b170a190a170b3a0b170a180b390a180a3b0a3a0b390a180a3b0a000597093a0a190a1809190b1809180a3a0a3b0b18093a0b170a190a18093b0b170a000d050a19093b093a0a3b0918%22%7D
and here is two (that finally recorded after many attempts) of a couple of my RF electrical switches:

Code: Select all

http://rmbridge_ip:7474/?cmd=%7B%22api_id%22:1004,%22command%22:%22send_code%22,%22mac%22:%22b4:43:0d:aa:36:b5%22,%22data%22:%22e90284030612061213060612120705140512061411060612120805121207051312060612061313061107120612070513051306bd06120612071212060614110706110712061311060613120606121207071112070514051213061206120712060614051106bd08100712061212060713120605130612061312060612120804131206061311070613051312061206120713050613051306bc07120612061411060612120706120711061312060613120705121207051312060712051312061207120613060513051306bd06120614051212060613130704130514051311070514120506131206061312060612061214051207110712060612061305be07100712061213060613130505130613051312060612120705131207051411060612061312071107110712070513061305bd06120612071212060612130606120614051212060613120705131206061212070513061212071206120810070514061106bd06130612061214050612120706120711061311070612130506131206061312070512061312061207110712070514041306bc07120612071212060613120607110612061312060613120606121207051411070513071112071108110612080413061206bd07120612061213050712120606140512061213060612120705131206061312060612061312061207110811060613051306bd06120812051212060613120606120613061214060413120606121207061212060613061212071207110612070513061305bd06120712071113060612120606130613051213070611120705131306071112070513051313051207110712060712051307bc06120613061212060711140506130513061212060613120804131206061212070513061311071206120810070513061307bb06120811061214050612120705130612061213070512140506131205061312060612061411061207120612070513051504bd06120711081113050614110706120513061212070514120506131206061212070612071211071206120712060712051406bd06110612071113060614110606130611071311060712120606141007061212060613061212071206120713050513061305bd07120612061213060613110804140512061312070512130606121207051312060613061213061107120612070513061305bd061207120612130606131107051306120613120607111207061212070513120606130515041206130612061306120612060005dc00000000%22%7D

Code: Select all

http://rmbridge_ip:7474/?cmd=%7B%22api_id%22:1004,%22command%22:%22send_code%22,%22mac%22:%22b4:43:0d:aa:36:b5%22,%22data%22:%22e90284030612061213060612130606120613061212070513120606131206061313051207120605130613051405121207120606bd06130612061312060613130506120613061212060613120705131206071212061207110706130513051505131106120705be06120612071212070513120606130513061212070513120706121305061312061207120606130513061207121305120705be06120612071212070612120606130612061212070612120706121207051313061107120606130513061206141106140505c004120613061212070612120606130612061312060613120606121207051312071206120707110613051305131207110706bd06120712071113060612130605130612061312060613120606131107061213061206130605130612061307111306120607bd05130613061212060612130606130513051312070513120607121208041411061206120705130613071106121306130605bd07120612061411060612130606130513071112070514110705141205071212071107110706120712061305131207110607bd07110612081114040613130507120513061313050612120804131207061213071007120606130613051305131206120804be07120513071112060712120606130612061312060613120606121208041312081106120606130612061305131206130607bd05120712061411060612120705130612061312060712120607121206061212071207110804130613051306121207120606bd06120712061213060711130606120712061212070513130605131206061312061207130506120613071205131107120705be06120612071212060613120606140512061212070612140505131208041312061207120606130612061305131207110706bd07110613061313040613120705130614051212060613120607111207061312051207130506130612071205131207110706bd06130613051213070512120705130712051312070513120606141106061212081107110804130613051306121207120606bd07130512061312070514120506130612061212070513120606131207061212061306120606130513061404131206130605be06130512071212070513130507130512061313050613120606131107071211071206120705130613061206121207110706bd071107130512140506131206061206130613120605131206061313050613120805120514061205140512061207120612060005dc00000000%22%7D
I hope this helps clarify!

Thanks
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

Hi dels,

Ok, then you try to record RF command ?

You must first of all takink care not to have conflics with other RF command during the time that you are recording

For example if you have IR retransmitters which are workings on 310,315, or 433 mhz, you will have a lot of problems to record, you must stop them

Idem, if you have detecteurs on the same frequencies, and that someone is moving during the record

Them, you must know, that you must press the remote quicky, just for a short time, not a long time

By the way , which module, or remote do you try to record

X10, Chacon, or what esle ?

best regards
dels
Posts: 3
Joined: Saturday 09 January 2016 2:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by dels »

forumfab wrote:Hi dels,

Ok, then you try to record RF command ?

You must first of all takink care not to have conflics with other RF command during the time that you are recording

For example if you have IR retransmitters which are workings on 310,315, or 433 mhz, you will have a lot of problems to record, you must stop them

Idem, if you have detecteurs on the same frequencies, and that someone is moving during the record

Them, you must know, that you must press the remote quicky, just for a short time, not a long time

By the way , which module, or remote do you try to record

X10, Chacon, or what esle ?

best regards
Hi,

I retried tonight, by clicking REALLY fast, and you were right, it worked cutting on the size of the payload and was accepted. My apologies for the back and forth and thanks for the help!

dels
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

Hi dels,

Perfect !

Glad to help you

Enjoy yourself with this application

Best regards
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Zycker »

Hi,
I've received my RM2 pro a couple of days ago and I'm trying to make it work with domotic.
RM bridge is running on my Android tablet, curl and RM commander installed on my pc.
I've set my_tablet_ip:7474 on "identification on the network" but when I try to learn a code I get this error for every button I've tried with my IR remote :
Capture.PNG
Capture.PNG (2.99 KiB) Viewed 10621 times
I also tried the website http://rm-bridge.fun2code.de, set the ip running rm_bridge but it do not work, it shows Error learning code: rm2 enter study mode failed any time I try to learn a code.
I had no problem at all to learn a couple of remotes (IR and RF) with the Broadlink's app.

Do you have any idea ?
getafe83
Posts: 7
Joined: Friday 04 March 2016 14:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by getafe83 »

Zycker wrote:Hi,
I've received my RM2 pro a couple of days ago and I'm trying to make it work with domotic.
RM bridge is running on my Android tablet, curl and RM commander installed on my pc.
I've set my_tablet_ip:7474 on "identification on the network" but when I try to learn a code I get this error for every button I've tried with my IR remote :
Capture.PNG
I also tried the website http://rm-bridge.fun2code.de, set the ip running rm_bridge but it do not work, it shows Error learning code: rm2 enter study mode failed any time I try to learn a code.
I had no problem at all to learn a couple of remotes (IR and RF) with the Broadlink's app.

Do you have any idea ?

I have also received RM2 last week. And also I have the same error. it may be for the firmware version. I have updated to version 20022
getafe83
Posts: 7
Joined: Friday 04 March 2016 14:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by getafe83 »

Would anyone who has upgraded to version 20022 and it works?
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Zycker »

Hi,
How do you know your version or upgrade it ?

edit: Found it, it's actually using version v20020 and I can upgrade to v20022 which has been published 2016-01-29.
getafe83
Posts: 7
Joined: Friday 04 March 2016 14:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by getafe83 »

I have also received RM2 with 20020 version. But the version I have updated because it showed the incorrect temperature and updating has been fixed. if you have the same error with version 20020, maybe it is not firmware problem. I need to try rmbridge version 1.0.0 and rm commander
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Zycker »

I'm in touch with the dev from RM-Commander and the one from RM-Bridge, it seems there is a new version version of the RM with changes in the API and that's why those softwares don't work anymore.
I've given them control of my RM through internet so they can update the softwares.
getafe83
Posts: 7
Joined: Friday 04 March 2016 14:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by getafe83 »

I tried it with rmbridge version 1.0.0 and rm commander unsuccessfully.
As Zycker says; it seems there is a new version version of the RM with changes in the API.
When you know something let us know. Thank you
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Zycker »

They are still working with Broadlink to get access to the new API it seems.
You can also use RM tasker, it does the same thing, maybe easier to use but you have to pay for it.
It just has been updated and this is the changelog :

New RM Pro support!!! (a.k.a RM2+)
• API to get learn new code!!!!
• API to get temperature from RM
• API to get on/off status & current power reading from SP
• Brand new awesome web console!!!! (you need to enable HTTP Bridge to see this)

This can be used both as a plugin in Tasker or a standalone app.
I have this new RM pro aka rm2+. Don't ask me what are the differences [WHITE SMILING FACE]

Envoyé de mon Nexus 10 en utilisant Tapatalk
getafe83
Posts: 7
Joined: Friday 04 March 2016 14:04
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by getafe83 »

Hi zicker, Have you received news?
Rm tasker is a good choice but I'm using iPhone.
Do you know if you can run rm tasker on an android device and from any web browser running http request?
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Zycker »

Hi,
My contact with the devs has stopped due to a disaggrement.
Although I can answer for RM tasker plugin. It include indeed a http daemon just like RM brdige and you can send http request to it, as I do.
Here are the fonctionnalities of this :
RM Plugin API Server [Alpha]
Version: 1.1.7 (45)

This is a Json API server acting as a HTTP Bridge to enable access to your Broadlink devices via simple HTTP commands or URLs.

This release is pretty much in Alpha state, many things might break or does not work properly. But I hope you like the progress so far.
Do send your bug reports, feature requests, feedbacks, cheers, etc. to [email protected].
Recommended setup:
This was designed to work with only Broadlink devices in the same WiFi network. 3G Bridge will not be used.
This Web/API server always runs as a service in background, and it will drain your battery quickly. It is not recommended to use on your daily mobile phone. It was intended to run on Android boxes or other Android devices permanently connected to a power source at home.



Web Console
This is a big feature in the making. This will let you control all your devices, manage codes & learn new code via a web browswer.
Take a look at this awesome work-in-progress demo so far.
DEMO HERE



API Syntax
SEND A CODE
http://192.168.1.102:9876/send
This API let you send a code via a given Broadlink device.
Works with either GET or POST request.

Parameters:
deviceMac : The hardware MAC address of your Broadlink devices. You can use /devices API below to obtain this, or obtain it from RM Plugin app - under Device List. Acceptable MAC formats are (case insensitive):

codeId : The ID of the code to be sent. You can use /codes API below to obtain this, or obtain it from RM Plugin app - under Code List.
To control on/off devices such as SP2 or SPMini, use one of the following parameters:
on=true/false
off=true/false
codeId=0/1
repeat : (optional) Number of times to send the code. Values 0 or 1 will not repeat the code. Value 2 means send the code 2 times.
Examples:
http://192.168.1.102:9876/send?deviceMac=bb&codeId=25
http://192.168.1.102:9876/send?deviceMac=bb&codeId=25
http://192.168.1.102:9876/send?deviceMa ... 5&repeat=3
http://192.168.1.102:9876/send?deviceMa ... ff&on=true
http://192.168.1.102:9876/send?deviceMa ... f&on=false

Response:

{msg: "Code Fan • Mist successfully sent", status: "ok", codeId: "19", deviceMac: "b"}
LEARN A CODE
http://192.168.1.102:9876/study?deviceMac=b
Executing this command will put RM device into 'study mode' for at most 30 seconds.
Orange LED on RM device will lit up until a IR/RF code is detected. Use /get_code API to retrieve the learnt code.
Works with either GET or POST request.

RETRIEVE STUDIED CODE
http://192.168.1.102:9876/get_code?deviceMac=b&name=My new code
Retrieve the code that has just been learned in 'study mode' by previous API and save it as a new code.
Works with either GET or POST request.

Parameters:
deviceMac : The hardware MAC address of your Broadlink RM device.
name : Save the studied code with this name.

DEVICES LIST
http://192.168.1.102:9876/devices
Show the list of your configured Broadlink devices.
Works with either GET or POST request.

Response:
[{"name":" Smart Plug ","typecode":10026,"lanaddr":"192.168.1.","type":"RM2+","mac":"b"}]
CODES LIST
http://192.168.1.102:9876/codes
Show the list of your codes.
Works with either GET or POST request.

Response:

[{"all the code I've made my RM2+ learn}]

FIND A DEVICE
http://192.168.1.102:9876/devices?deviceMac=b
Find a device with the given MAC address.
Works with either GET or POST request.

FIND A CODE
http://192.168.1.102:9876/codes?codeName=tv
Find a code with the given name.
Works with either GET or POST request.

GET TEMPERATURE (ON RM)
http://192.168.1.102:9876/temperature?deviceMac=b
Retrieve current temperature reading on a RM device (RM2, RM Home, RM Pro).
Works with either GET or POST request.

Response:

{"status":"ok","temperature":"30.8","timestamp":"1455356271220","deviceMac":"b"}
GET ON/OFF STATUS
http://192.168.1.102:9876/status?device ... c:dd:ee:ff
Retrieve current on/off status on a SP device (SP2 or SPMini).
Works with either GET or POST request.

Response:

{"on_off_status":1,"status":"ok","timestamp":"1455356271220","deviceMac":"b"}
GET NIGHT LIGHT ON/OFF STATUS (CONTROS ONLY)
http://192.168.1.102:9876/contros_statu ... c:dd:ee:ff
Retrieve current on/off status of the night light on a Contros device (SP-CC).
Works with either GET or POST request.

Response:

{"led_status":0,"on_off_status":1,"status":"ok","timestamp":"1455356271220","deviceMac":"b"}
GET ENERGY READING (SP2 ONLY)
http://192.168.1.102:9876/current_power ... c:dd:ee:ff
Retrieve current energy reading on a SP2 device.
Works with either GET or POST request.

Response:

{"status":"ok","timestamp":"1455357197117","current_power":0.823000,"deviceMac":"b"}
DELETE A DEVICE
http://192.168.1.102:9876/delete?deviceMac=b
Delete a device from device list.
Note that deleted device will be automatically detect again if it is within LAN network.
Works with either GET or POST request.

DELETE A CODE
http://192.168.1.102:9876/delete?codeId=123
Delete a code from code list.
Works with either GET or POST request.

(RE)START WEB SERVER FROM TASKER
If you want to use Tasker to manage or re-start this web service in case it crashes or stopped, use the following parameters:
Category: Default
Package: us.originally.tasker
Class: us.originally.tasker.service.WebServerService
Target: Service
Leave the other parameters empty.



TODO
These features are currently planned to be released in future updates:

Proper support for Contros device (SPMini-CC)
Read sensor data from A1 device
More API endpoints
TBC: Pretty web-based interface to manage devices & codes
Drop me an email to [email protected] to let me know what do you want to see in future updates.


Proudly brought to you by the cool folks at Originally US.
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by forumfab »

Unread postby Zycker » Mon Apr 04, 2016 4:00 pm

I'll transmit this link to BROADLINK !

We will look the respect of the licences and so regarding the usage of the SDK, and so on ....!

Keep in mind that thoses tools are not under GNU ....!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest