Skip to content

Commit 304f51f

Browse files
authored
Update Broadlink binding README.md (openhab#18039)
Clarify some aspects and add context for less familiar users. Correct a few typos. Signed-off-by: Michael Fielding <[email protected]>
1 parent bbec3d5 commit 304f51f

File tree

1 file changed

+35
-20
lines changed

1 file changed

+35
-20
lines changed

bundles/org.openhab.binding.broadlink/README.md

+35-20
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Broadlink Binding
22

3-
This binding supports a range of home networking devices made by (and occasionally OEM licensed from) [Broadlink](https://www.ibroadlink.com/).
3+
This binding supports sending infrared (IR) and radio frequency (RF) commands using a range of devices for made by (and occasionally OEM licensed from) [Broadlink](https://www.ibroadlink.com/).
4+
5+
The highlevel overview is:
6+
1. learn codes from your existing IR (and RF) remote controls, associating each of them with a command that you choose such as `AC_OFF`;
7+
2. making openHAB rules that send the command e.g. `AC_OFF` to the device;
8+
3. the binding will look up the learned code associated with your command and then send it.
49

510
## Supported Things
611

7-
| Thing ID | Description |
12+
| Thing Type | Device |
813
|------------|-------------------------------------------------------------------------------|
914
| a1 | Broadlink A1 multi sensor |
1015
| mp1 | Broadlink MP1 WiFi Smart Power Strip (4 sockets) |
@@ -29,7 +34,7 @@ Devices in the above list that are set up and working in the Broadlink mobile ap
2934
3035
## Thing Configuration
3136

32-
| Name | Type | Default | description |
37+
| Name | Type | Default | Description |
3338
|---------------------|---------|---------------|-----------------------------------------------------------------------------------|
3439
| ipAddress | String | | Sets the IP address of the Broadlink device |
3540
| staticIp | Boolean | true | Enabled if your broadlink device has a Static IP set |
@@ -40,6 +45,8 @@ Devices in the above list that are set up and working in the Broadlink mobile ap
4045

4146
## Channels
4247

48+
These are the channels that are available, depending on the device.
49+
4350
| Channel | Supported Devices | Type | Description |
4451
|-------------------|--------------------------|----------------------|-------------------------------------------------|
4552
| power-on | MP2, all SPx | Switch | Power on/off for switches/strips |
@@ -59,26 +66,32 @@ Devices in the above list that are set up and working in the Broadlink mobile ap
5966
| rf-command | RM Pro, RM4 Pro | String | RF Command code to transmit
6067
| learning-control | all RMx | String | Learn mode command channel (see below) |
6168

69+
Note that there are different channels for sending IR and RF codes.
70+
6271
## Learning Remote Codes
6372

64-
To obtain the command codes, you can get this binding to put your Broadlink RMx device into "learn mode" and then ask it for the code it learnt.
73+
Associate remote codes with your commands, you can get this binding to put your Broadlink RMx device into "learn mode".
6574
Here are the steps:
6675

6776
0. In the openHAB web UI, navigate to your RMx Thing
68-
1. Set the *Name of IR/RF command to learn* property to the name of the command you want the device to learn
77+
1. Set the *Name of IR/RF command to learn* property to the command you want the device to learn. This can be any text that you want, but you will use it in your rules to send commands, so for example 'AC_OFF' or 'TV_VOLUME_UP' would be good commands.
6978
2. Click on its *Channels* tab
70-
3. For IR find the *Remote Learning Control* channel and create an Item for it, for RF use the *Remote RF Learning Control* channel instead.(Only needed the first time)
79+
3. For IR find the *Remote Learning Control* channel and create an Item for it, for RF use the *Remote RF Learning Control* channel instead. (Only needed the first time)
7180
4. Click the item, and click the rectangular area that is marked NULL
7281
5. In the pop-up menu that appears, select *Learn IR command* for IR or *Learn RF command* for RF
7382
6. *The LED on your RM device will illuminate solidly*
7483
7. Point your IR/RF remote control at your RM device and keep pressing the button you'd like to learn. For RF, this can take 10-30 seconds
7584
8. *The LED on your RM device will extinguish once it has identified the command*
7685
9. If the command has been identified succesfully, the channel will have changed it name to "Learn command" or *RF command learnt*
77-
10. If no succes, the channel will be named "NULL". Inspect the `openhab.log` file on your openHAB server for any issues
78-
11. Check and save the IR/RF command by clicking the item once more and select "Check and save command".
86+
10. If no success, the channel will be named "NULL". Look in the logs on your openHAB server for any issues - try under the Developer Tools section of Main UI.
87+
11. Check and save the IR/RF command by clicking the item once more and select "Check and save command"
7988
12. Keep pressing the remote control with the command to check and save
80-
13. If succesfull, the channel will change name to the command saved
81-
14. If no succes, the channel be named "NULL", restart from step 3.
89+
13. If successfull, the channel will change name to the command saved
90+
14. If no success, the channel be named "NULL", restart from step 3.
91+
92+
### Sending Remote Codes
93+
94+
In a rule, send your command to a String-type Item linked to the command (IR) or rf-command (RF) channel of your device. The binding will look up the learned IR or RF remote code you associated with that command and send it.
8295

8396
### Modify or Delete Remote Codes
8497

@@ -159,17 +172,15 @@ end
159172

160173
This rule file assumes you previously have learned the "AC_ON" and "AC_OFF" IR commands.
161174

162-
163175
## Migrating Legacy Map File
164176

165177
Up to openHAB version 3.3, there was a previous version of this binding that was not part of the openHAB distribution.
166178
It stored the IR/RF commands in a different place and a different format.
167179
If you want to mirgrate from those versions to this version of the binding, please read this section.
168180

169-
The Broadlink RM family of devices can transmit IR codes. The pro models add RF codes.
170-
The map file contains a list of IR/RF command codes to send via the device.
181+
The map file contains a list of IR command codes to send via the device; there is a separate map file for RF codes.
171182

172-
IR codes are store in `$OPENHAB_USERDATA/jsondb/broadlink_ir.json` and for the RM Pro series of devices the RF codes are store in `$OPENHAB_USERDATA/jsondb/broadlink_rf.json`
183+
### openHAB < 4.3.0
173184

174185
Before openHAB version 4.3.0, the file used the [Java Properties File format](https://en.wikipedia.org/wiki/.properties) and was stored in the `<OPENHAB_CONF>/transform` folder.
175186
By default, the file name was `broadlink.map` for the IR codes, but could be changed using the `mapFile` setting.
@@ -183,14 +194,16 @@ heatpump_off=2600760069380D0C0D0C0D290D0C0D290D0C0D0C0D0C0D290D290D0C0D0C0D0C0D2
183194
```
184195

185196
The above codes are power on/off for Samsung TVs and Power Off for a Fujitsu heat pump.
186-
To send either code, the string `TV_POWER` or `heatpump_off` must be sent to the `command` channel for the device.
197+
To send either code, the command string `TV_POWER` or `heatpump_off` must be sent to the `command` channel for the device.
187198
For RF, the `rf-command` channel is used.
188199

189-
Storage of codes is handled by openHAB. The map files are stored in the $OPENHAB_USERDATA/jsondb directory.
190-
As an advantage, the files are now backed up by openHAB, which is more practical for migrations, data robustness, etc. having the storage of the codes handled by openHAB also provides uniformity in where the files are stored.
200+
### openHAB >= 4.3.0
201+
202+
Since openHAB version 4.3.0, codes are stored stored in the $OPENHAB_USERDATA/jsondb directory. IR codes are stored in `$OPENHAB_USERDATA/jsondb/broadlink_ir.json`. For the RM Pro series of devices the RF codes are stored in `$OPENHAB_USERDATA/jsondb/broadlink_rf.json`
191203

192-
With the change of the storage mechanism, the files are also changing format, and codes are now stored in json.
193-
With the change of the storage mechanism, the files are also changing format, and codes are now stored in json.
204+
The advantage of this change is that the files are now backed up by openHAB, which is more practical for migrations, data robustness, etc. Having the storage of the codes handled by openHAB also provides uniformity with other openHAB configuration through Main UI.
205+
206+
With the change of the storage mechanism, the files are also changing format, and codes are now stored in json, like this:
194207

195208
```json
196209
{
@@ -203,7 +216,9 @@ With the change of the storage mechanism, the files are also changing format, an
203216
}
204217
```
205218

206-
The code shown below is a Python script that can be used to convert from the old format to the new one:
219+
### Migrating from openHAB < 4.3.0 to > 4.3.0
220+
221+
Below is a Python script that can be used to convert from the old format to the new one:
207222

208223
```python
209224
import csv

0 commit comments

Comments
 (0)