AC Temperature with Broadlink

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