Broadlink integration - learning commands

Hi all.
I’m writing here after a try with the italian forum, but none could help me.
I got 4 broadlink devices (IR3Mini, IR4Mini,2x IR4Pro), and now I’m trying to make them work in HA.
By now I’m workin just with the IR3Mini. I successfully set the static IP address (binded to the MAC), then installed the Broadlink integration and set the IR3Mini in HA. I can see the integration in my list.
Unfortunately, the remotes I own are not already coded in the community, so I’ve to grab the IR codes manually. Unfortunately, Broadlink Manager is useless (“Writing compatible device not detected!”), so I should grab the IR codes through HA services.
This is what I did:

service: remote.learn_command
data:
  device: Clima_LG
  command: On_Off
  alternative: true
  timeout: 20
  command_type: ir
target:
  entity_id: remote.ir_batcave_remote

Then I press the command button to call the service, press the remote button, then I got the “check” mark; I suppose the service should have grabbed the IR code.
But at this point, (as written in many tutorials) I should find the grabbed IR code in a JSON file inside the .storage folder (inside the configuration folder)…
Well, I have no .storage folder.
Is it there something I’m missing?
Any suggestion?
Thanks

You should be able to use the remote send with the command name you just learned.

The .storage folder is hidden and can only be seen if that option is enabled (view hidden files and folders).

@Hellis81
Thank you very much for the suggestion.
Indeed, I have been really stupid…I didn’t though about the fact the .storage folders is an hidden one…
But even after unhidden the folder I don’t have the broadlink file.
I shoul have a file named such:

 broadlink_remote_MAC_ADDRESS_codes

but I have no file matching the name
Homestly, I’m really puzzled… The integration is there…the service is regurarly launched (otherwise I wouldn’t get the “check” mark, is it?)… Neveretheless, the broadlink named file with the IR codes isn’t there…
And I tried to send the commad just learned, but nothing…

But can you send a command that is learned?

I don’t know which Broadlink Manager you used (there are several versions around the net). As for Windows I did install Broadlink Manager according to this guide (and used the download link in there). Works flawlessly and learning IR commands is a breeze.

Note that I use Broadlink Manager on Windows (under Python) which is not on the same device HA is running on.

Edited on 22 June 2023: Above link is not valid anymore. The very same guide mentioned above can now be found here.

@Hellis81
nope, as i wrote, i tried but I couldn’t

@Tamsy
well, I’m using the standalone version. By the way, i tried to follow the guide you posted (thank you very much), and honestly now it seems working great!

Thankyou very much!!!

Now the next challange will be to grab all the codes and make HA make the magic!

I haven’t noticed that, I have only noticed the focus on the files.
In that case I don’t know what the issue is.

Well, using Broadlink manager as Tamsy told, is a piece of cake.
I’m grabbing the codes from my first clima remote, and even the send command works.
I hope, after that, HA won’t give me any problem (or at least problems I can manage…) with SmartIr component

Should not give you problems. You’ll find plenty of examples on how the JSON-files have to be written and structured here.

Depending on your AC model the resulting file can easily consist of a couple of hundred lines which makes it prone to typos and formatting errors (lately I did a IR codes file for a certain Daikin AC with swing mode that goes with nearly 800 lines). Best is to use a JSON Formatter and JSON Validator to check for format errors and validate the file you produced. I use this one.

The downside of using Broadlink IR’s is they only work one-way (IR sender → AC). Thus there is no chance for HA to sense changes which were done through the original Remote. I.e. whenever a unit was switched to ON/OFF or a simple mode change wont get reflected within HA.

To get around this disadvantage I have installed these inexpensive ZigBee Switch Electricity Energy Monitor Mini Modules between the electricity outlets and the indoor units of the ACs (I don’t like the esthetics of putting contact sensors on the AC flaps). They are small enough to fit anywhere behind the indoor units (great for energy monitoring within HA too).

Together with a temperature/humidity sensor and the actual power (wattage) usage taken from the ZigBee Switch Electricity Energy Monitor and coupled with HA’s Trend Sensor and some automations, and after some fine tuning I am getting pretty much the same results as with the expensive AC WLAN modules which are available for some brands/models with the added advantage that all is happening pureley local with no foreign cloud involved.

BTW, I’ve put the Broadlink RM4 minis also behind the cover of each indoor unit. Thus I have no remotes laying around someone can tamper with.

All in all the command center for handling AC units within HA using Lovelace simple thermostat cards and SmartIR is looking like i.e.:

Thanks for sharing your experience and strategy, I will use it of course.
What the purpoise of the Master Switch Module?

If you install a Sonoff POW or those Zigbee switches (or whatever switchable electricity energy monitor device) to sense whether an AC unit is in state ON/OFF those switches can also be controled through HA.
I added the power controls to their respective cards to be able to cut the main power to the ACs. Thus if the main power is set to OFF the ACs can not be switched to ON using the remotes. This comes in handy i.e. when living in a country with servants at home where they tend to switch the air conditioners all on if the masters are not present :money_mouth_face:

Uhmmmm interesting…
I’ve no servant, but not bad the idea to control an AC master switch

I’m playing with the simple-thermostat card, but getting puzzled.
Could you share your code, so to have some clues on how to customize it?
I’ll appreciate very much.

Sure. Here you go:

type: custom:stack-in-card
mode: vertical
cards:
  - type: custom:simple-thermostat
    show mode names: true
    card_mod: null
    style: |
      ha-card {
        background: WhiteSmoke;
        --keep-background: true;
      }
    entity: climate.server_room_ac
    header:
      name: AC Server Room
    control:
      _headings: false
      swing_modes: true
      hvac:
        'off':
          name: Aus
      fan:
        auto:
          name: Auto
          icon: mdi:fan-auto
        breeze:
          name: Breeze
          icon: mdi:waves-arrow-right
        level1:
          name: Low
          icon: mdi:fan-speed-1
        level3:
          name: Medium
          icon: mdi:fan-speed-2
        level5:
          name: High
          icon: mdi:fan-speed-3
        powerful:
          name: Powerful
          icon: mdi:fan-chevron-up
        night: false
        level2: false
        level4: false
      swing:
        'off':
          name: Aus
        'on':
          name: An
    hide:
      temperature: true
    icon:
      auto: mdi:autorenew
      cool: mdi:snowflake
      'off': mdi:power
    sensors:
      - entity: sensor.sonoff_snzb_02_temperature_sensor_server_room_temperature
        icon: mdi:home-thermometer-outline
      - entity: sensor.sonoff_snzb_02_temperature_sensor_server_room_humidity
        icon: mdi:water-percent
      - entity: sensor.temptrend_server_room
        icon: mdi:thermometer-lines
    step_size: '1'
    layout:
      mode:
        headings: false
  - type: entities
    card_mod: null
    style: |
      ha-card {
        background: WhiteSmoke;
        --keep-background: true;
      }
    entities:
      - entity: switch.pj_mini_zsw01_ac_server_room
        icon: mdi:lightning-bolt
        name: AC Server Room (Master Switch)
    state_color: true

Note: Those snippets for “swing mode” in the above code do nothing yet (therefore swing mode settings are not getting reflected with the card as you can see). I haven’t found the time to learn the commands for “swing” of the AC-model to add them into the respective *.json file.

1 Like

Thank you very much, I appreciate

1 Like

hi @Tamsy I’d like to follow the guide you recommended to use broadlink manager correctly because I’m not capable, only that the link you recommended is no longer active, could you help me in some way because I have exactly the same error listed in the post at the beginning of the discussion, thanks

Welcome to the forum, @2006ciro :wave:t3:

The link for installing and running BroadlinkManager on Windows has changed. You can now find the instructions at: