New Broadlink binding in OH3.4: using the RM mini and support for A1 sensor

I have been using for quite some time the broadlink add-on as described in the thread in the version provided by @themillhousegroup in its git repository.

I was able to send IR commands to my RM mini and read temperature values from my A1 device. The captured IR codes were contained in a file (broadlink.map) in my case.

In OH 3.4 the previous add-on no longer works, but there is a broadlink binding, that used to be called broadlinkthermostat, which now includes the RM mini devices, as it appears in the docs. There’s apparently no possibility to use a map file.

I figured out how to capture an IR code and to generate it, but I am unable to find where the captured codes are stored. The binding actually creates a directory broadlink/infrared_commands but it remains empty. Where are the codes stored? How can they be transferred to a different OH instance? Is it possible to retrieve the learned codes through the REST API? Once this is known, I could re-cycle the codes in my former broadlink.map file.

A second question concerns the support of the A1. Should I raise an Issue somewhere to ask for it?

Thank you for your attention,
Lionello

PS. Let me add in the following some details on how I figured out to make my RM mini work. At present I used the UI, but in principle I could try with a textual configuration, to be added to the docs.


The first step is to discover the RM Mini. The code of automatically discovered thing is
pretty simple

UID: broadlinkthermostat:rmuniversaldevice:Broadlink-Sogg
label: Broadlink-Sogg RM mini
thingTypeUID: broadlinkthermostat:rmuniversaldevice
configuration:
  host: 192.168.xx.xx
  macAddress: xx:xx:xx:xx:xx:xx
location: Soggiorno

Once the equipment is created from thing, three items appear. Here’s the output of the REST API query of the equipment item, showing the three items linked to the channels

{
  "members": [
    {
      "link": "http://192.168.27.82:8080/rest/items/BroadlinkSogg_RM_mini_Learning_Mode",
      "state": "OFF",
      "type": "Switch",
      "name": "BroadlinkSogg_RM_mini_Learning_Mode",
      "label": "Learning Mode",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "BroadlinkSogg_RM_mini"
      ]
    },
    {
      "link": "http://192.168.27.82:8080/rest/items/BroadlinkSogg_RM_mini_Save_Learned",
      "state": "AMPLITOGGLE",
      "stateDescription": {
        "pattern": "%s",
        "readOnly": false,
        "options": []
      },
      "type": "String",
      "name": "BroadlinkSogg_RM_mini_Save_Learned",
      "label": "Save Learned",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "BroadlinkSogg_RM_mini"
      ]
    },
    {
      "link": "http://192.168.27.82:8080/rest/items/BroadlinkSogg_RM_mini_Send_Learned",
      "state": "AMPLITOGGLE",
      "stateDescription": {
        "pattern": "%s",
        "readOnly": false,
        "options": []
      },
      "type": "String",
      "name": "BroadlinkSogg_RM_mini_Send_Learned",
      "label": "Send Learned",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "BroadlinkSogg_RM_mini"
      ]
    }
  ],
  "link": "http://192.168.27.82:8080/rest/items/BroadlinkSogg_RM_mini",
  "state": "NULL",
  "editable": true,
  "type": "Group",
  "name": "BroadlinkSogg_RM_mini",
  "label": "RM mini",
  "category": "",
  "tags": [
    "RemoteControl"
  ],
  "groupNames": [
    "gLoc_Soggiorno"
  ]
}

In order to enter the name of the command I modified the standalone widget, following the suggestion of this post, adding a standalone widget of oh-input-card.

value: oh-input-card
config:
  outline: true
  inputmode: text
  footer: =items.BroadlinkSogg_RM_mini_Save_Learned.state
  title: Learned Command Name
  type: text
  sendButton: true
  validate: true

The sequence to learn a code is as follows:

  1. toggle the BroadlinkSogg_RM_mini_Learning_Mode to ON
    The RM mini white LED is lit
  2. send the IR command from the remote to the mini
    The RM mini white LED switches off when the IR command is learnt
  3. set the name of the command in the BroadlinkSogg_RM_mini_Save_Learned
    The captured IR command is stored somewhere

When I set BroadlinkSogg_RM_mini_Send_Learned item to the name of the command, the RM mini sends the IR command.

Thanks for this info. As to the location of the codes, when I installed the binding, I saw this in the log:

infrared_commands dir created /var/lib/openhab/broadlink/infrared_commands

and testing it, it creates a file in this directory, but it doesn’t seem to be readable…

I was able to get it to write visible files into that folder. That said, it would ONLY work for IR codes, not RF (433Mhz) - the latter of which it completely ignored sadly (and is what I need it for).

To record an IR code, I largely followed your guide, but for clarity:

  1. Install the Binding and connect to the RM Mini 3 I have. It would not auto-discover for me, I had to put in it’s IP address directly - I have some VLAN madness going on which is likely the issue here.
  2. I created Items for each of the channels
Switch Rmmini3_Kids1_Learning_mode  "Learning mode [%s]"        {channel="broadlinkthermostat:rmuniversaldevice:rmmini_arlo:learningmode"}
String Rmmini3_Kids1_Save_learned   "Save learned to key: [%s]" {channel="broadlinkthermostat:rmuniversaldevice:rmmini_arlo:savelearned"}
String Rmmini3_Kids1_Send_learned   "Send learned key: [%s]"    {channel="broadlinkthermostat:rmuniversaldevice:rmmini_arlo:sendlearned"}
  1. I’m still using Sitemaps, so I created entries in the Sitemap for the items
			Text label="Broadlink" {
				Switch item=Rmmini3_Kids1_Learning_mode
				Selection item=Rmmini3_Kids1_Save_learned mappings=["Arlo_Fan_Off"="Arlo_Fan_Off", "Arlo_Fan_Speed_1"="Arlo_Fan_Speed_1", "Arlo_Fan_Speed_2"="Arlo_Fan_Speed_2", "Arlo_Fan_Speed_3"="Arlo_Fan_Speed_3" ]
			    Selection item=Rmmini3_Kids1_Send_learned mappings=["Arlo_Fan_Off"="Arlo_Fan_Off", "Arlo_Fan_Speed_1"="Arlo_Fan_Speed_1", "Arlo_Fan_Speed_2"="Arlo_Fan_Speed_2", "Arlo_Fan_Speed_3"="Arlo_Fan_Speed_3" ]
			}
  1. From the Sitemap, I turned on Learning Mode
  2. Press the button on the remote
  3. Choose the key to save to, in my case, the Rmmini3_Kids1_Save_learned item in the Sitemap.

After following above, in the /var/lib/openhab/broadlink/infrared_commands/ folder, I have a file named Arlo_Fan_Off that appears to contain some binary data.

Unfortunately - while helpful, this ignores RF codes completely which the @themillhousegroup binding previously did :cry:

I think you can try to raise an issue on github for that.

To be fair, the docs say that the channel is for IR only. :wink:

I’d agree with looking at GitHub. It’s possible that the developer is already planning RF for a future release.

Is it no longer working for you? I saw a post in the ongoing thread that it still works in 3.4. It’s fine for me, but I’m only on 3.3.

So it does (sorta). But yes, I’ll log an issue.

tbh - I haven’t reinstalled it. Considering the author seems to have gone AWOL and it wasn’t designed for 3.x I wanted to see if there is a more supported option so it’s more sustainable into the future.

Note: The last Millhouse version (org.openhab.binding.broadlink-3.2.0-SNAPSHOT.jar)still works on OH 3.4.2