AC Temperature with Broadlink

Hi

Using the broadlink native app making possible to send directly the desire “combination of codes” for example to start the AC in cooling mode with temperature 19 and medium fan.
In HA I figured how to configure temp up and down, fan up and down, different modes of the AC, but all in different commands.
Is it possible to combine somehow the mode I want to send using my Broadlink RM2/RM3 devices? Actually I’m not sure it directly related to broadlink device, it probably should be the same using generic IR blaster.

Screenshot from broadlink app

Hi, with the climate.mqtt PR, you can now create a climate control with broadlink through mqtt:

climate:
  - platform: mqtt
    name: Study
    modes:
      - off
      - cool
      - fan_only
    target_sensor: sensor.living_room_temperature
    mode_command_topic: "study/ac/update"
    temperature_command_topic: "study/ac/update"
    fan_mode_command_topic: "study/ac/update"
    swing_mode_command_topic: "study/ac/update"

and then hook up some automations that calls the send_packet service of your configured broadlink switch:

- id: study_ac_brdige_state
  alias: 'AC MQTT Bridge / State'
  trigger:
    platform: mqtt
    topic: study/ac/update
  action:
    - service: broadlink.send_packet_192_168_XX_XX
      data_template: !include ac_hitachi.yaml

Finally the ac code yaml looks like:

packet:
- >
  {% set room=trigger.topic.split('/')[0] %}
  {% set temperature=states.climate[room].attributes.temperature | round %}
  {% set swing=states.climate[room].attributes.swing_mode %}
  {% set fan=states.climate[room].attributes.fan_mode %}
  {{
    {"high": {
      18: {
        "on": "JgDWA...==",
        "off": "JgDWA...=="
      }
    },
    "medium": {
      18: {
        "on": "JgDWA...==",
        "off": "JgDWA...=="
    },
    "low": {
      18: {
        "on": "JgDWA...==",
        "off": "JgDWA...=="
      }
    }
    }[fan][temperature][swing]
  }}

you get the idea, you do have to learn all the combination from your control and put it into the ac yaml, or somehow programatically construct from the instructions.

HTH.

2 Likes

Isn’t it better to define separately fan, swing, temperature and on/off state, as separate hashes (dicts), instead of defining temperature as a nested hash of the fan mode?

This way one can create a template with the data in the appropriate order, e.g.: “{{temp}}{{fan}}{{mode}}” or “{{mode}}{{temp}}{{fan}}” and facilitate the configuration file.

you meant using concatenated string as key? sure, that works too.

Yes, that’s what I mean. I’m not sure whether this is possible and will probably vary from AC to AC make and mode, but the idea is to send just the specific command - e.g. only temperature.

You could create an input select for mode, temp, fan speed etc.

Then have a script that fires a set of commands based on those variables. You can use data templates to read the state of each input select each time you fire the script.

That’s my plan. The way currently the broadlink works is not very handy for controlling an ac unit.

Quick summary about the discussion, as there are two parts for setting this up:

  1. the device control UI.

You can use multiple input selects as @silvrr said, or the climate.mqtt component reuses the existing climate control UI.

  1. actually controlling ac through broadlink

Broadlink’s e-Control app sends IR codes representing complete state (mode,temperature,swing,fan) to the AC, hence the requirement for constructing a large table of IR codes. I don’t know if there’s AC controlled by broadlink can be done with temperature-only or mode-only command.

But if there is, you can also just setup climate.mqtt’s temperature_command_topic to a specific topic like “study/ac/temperature/set” (or a input state monitor) and configure corresponding send_packet action with automations.

This looks really interesting. When will this component be added to Home Assistant? I’m not sure if I completely understand the ac code yaml file. How can I add heating mode for example?

Please also check my custom Broadlink IR Climate component which “talks” directly to a Broadlink rm device.
Thank you.

1 Like