Broadlink IR Climate Component

Excellent job @gurbina93. It looks really nice!

Would you mind sharing your automations? I am interested in how you control your AC on/off with the door sensor and how you automate the FAN/AC with motion/presence detection.

Using the door sensor like this is genius!

Just configured this component, it is great! Using it for my dumb TVs.
Just a question: I exposed the domain media_player to google assistant, but in google home I see the TVs as switches, and can only turn them on and off. Is it impossible to control volume and channels via voice?

As easy as this one, they are all the same to turn on, just different entity or amount of minutes before turning it off.

Do note I face issues where the Broadlink IR codes just vanish in the air, they just do NOT make it to the AC so my automations used to fail, now I came up with a solution, basically I run the same sequence twice with a small delay in between to give my AC enough to close or open the louver (and my door sensor acts as the power state).
So for example the automation that turns off my AC sends the IR code but it does NOT make it, as per my automation below I just have a 15 second delay and run the same sequence again (which also checks for the power state before sending the IR signal).
For RF I don’t have any issues, which I use for the Broadlink TC2 switches which control lights and fans.
This is the AC switch with a Xiaomi Door Sensor for power state (open is On, closed is off)

This is the template switch(which as you can see uses the same IR code for on/off):

  livingroomairconditioner:
    value_template: "{{ is_state('binary_sensor.door_window_sensor_158d000288e2ed', 'on') }}"
    turn_on:
      - service: switch.broadlink_send_packet_192_168_0_102
        data:
          packet: 
            - "JgCWAAABQgABQQABQQABQZdSCw0MHwohCw0LIAsOCg0NCwsNDh0LDQsODB4LDA8LCiELDQ0LCwwPCwoOCg4KDgoOCw0KDg0LCyALDQsNDQsMDQwMCg4KDgoOCiALDQ4LCg4LDQoODAwLDQ0eCw4LDQoOCiALDgogCw4KDg0eCw0LDQsKEB4LIAsgCyALDgoOCg4KAAKcmAANBQAA="
    turn_off:
      - service: switch.broadlink_send_packet_192_168_0_102
        data:
          packet: 
            - "JgCWAAABQgABQQABQQABQZdSCw0MHwohCw0LIAsOCg0NCwsNDh0LDQsODB4LDA8LCiELDQ0LCwwPCwoOCg4KDgoOCw0KDg0LCyALDQsNDQsMDQwMCg4KDgoOCiALDQ4LCg4LDQoODAwLDQ0eCw4LDQoOCiALDgogCw4KDg0eCw0LDQsKEB4LIAsgCyALDgoOCg4KAAKcmAANBQAA="

Automations:
Please do note that for the bedroom I do not want the AC to turn off automatically when I am sleeping so I just set a time condition to avoid the AC turning off while I am asleep as there might not be any movement in the room to report to the Motion Sensors which trigger my automations.
The binary_sensor.motion_sensor_XXXX are my Xiaomi Aqara Motion sensors.


- alias: LivingRoomACOnPresence
    trigger:
      - platform: state
        entity_id: binary_sensor.motion_sensor_158d0001e0acf6 
        to: 'on'
    condition:
      - condition: state
        entity_id: switch.livingroomairconditioner
        state: 'off'
    action:
      - service: switch.turn_on
        entity_id: switch.livingroomairconditioner

  - alias: LivingRoomACOffIfAway
    trigger:
      - platform: state
        entity_id: binary_sensor.motion_sensor_158d0001e0acf6 
        from: 'on'
        to: 'off'
        for:
         minutes: 45
    action:
      - service: script.aclroff
      - delay: '00:00:15'
      - service: script.aclroff

  - alias: BedroomACOffIfAway
    trigger:
      - platform: state
        entity_id: binary_sensor.motion_sensor_158d0001e5cc4e
        from: 'on'
        to: 'off'
        for:
         minutes: 45
    condition:
      - condition: state
        entity_id: switch.bedroomairconditioner
        state: 'on'
      - condition: time
        after: '11:00:00'
        before: '09:00:00'
    action:
      - service: switch.turn_off
        entity_id: switch.bedroomairconditioner
      - delay: '00:00:45'
      - service: script.acbroff

As for the scripts:


  aclroff: 
        sequence:
          - condition: state
            entity_id: switch.livingroomairconditioner
            state: 'on'
          - service: switch.turn_off
            entity_id: switch.livingroomairconditioner
  acbroff: 
        sequence:
          - condition: state
            entity_id: switch.bedroomairconditioner
            state: 'on'
          - service: switch.turn_off
            entity_id: switch.bedroomairconditioner
1 Like

Hi,
I am using the climate component successfully for a while now, and i was wondering if I can use the same broadlink device with two different components (climate & media)?

Basically I have the climate and smart TV in the same room, and I am wondering if it is possible to use both components using the same IR Mini.

Yes you can. I’m already using it that way

it worked perfectly. I have actually configured 2 media components, 1 climate and multiple switches on the same IR Mini.

Great work really.

Hi, did you create the sanyo.ini file? I can’t find it on the components code list, I was wondering if you uploaded it somewhere? I also have a Sanyo.

I also have this kind of device from Sanyo. Did you ever find out how to do this?

Dear all,
I configured my IR fan (Panasonic F-60TAN) in hassio howerver, after replacing/ adding codes in the "ceiling_fan.ini" (replacing "low, medium, medium_hight, high, highest" by 1, 2, 3, 4, 5, 6, 7, 8, 9" with their ir codes) and my configuration.yaml codes below:

fan:

  • platform: broadlink
    name: Ceiling Fan
    host: 192.168.31.146
    mac: ‘B4:43:1D:A8:26:D9’
    rfcodes_ini: ‘custom_components/fan/broadlink_fan_codes/ceiling_fan.ini’
    default_speed: 5
    #defaut_direction: left
    customize:
    speeds:
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    Then I test but there are only speeds from 1-5 work (RM Pro fires and orange light lit), speed 6, 7, 8, and 9: There’s no indication shown that it works: No light shown.
    Anyone know the reasons and how to cure it???
    P/S: Attached is the configuration in the

ceiling_fan.ini

file
Thanks for your reading
Minh Chau

Hi,
Any idea why i cant load the custom component?
First time for me using a custom component and I’m running Hassio.

Log:
2018-12-11 20:46:33 ERROR (SyncWorker_1) [homeassistant.loader] Error loading custom_components.climate.broadlink. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/loader.py”, line 92, in get_component
module = importlib.import_module(path)
File “/usr/local/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/climate/broadlink.py”, line 14, in
from homeassistant.helpers.restore_state import RestoreEntity
ImportError: cannot import name ‘RestoreEntity’
2018-12-11 20:46:33 ERROR (SyncWorker_1) [homeassistant.loader] Unable to find component climate.broadlink
2018-12-11 20:47:28 ERROR (MainThread) [homeassistant.components.hassio] INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4
Testing configuration at /config
Failed config
General Errors:
- Platform not found: climate.broadlink

Hi, you are using the latest code which is compatible only with the upcoming version 0.84.X. Please use this code instead, but remember to update again when you install 0.84

1 Like

This is a great idea, I am going to implement this ASAP. Thanks

aha, thanks! I will give it a try :slight_smile:

For me it is broken in 0.84 (Docker/Hassio):

2018-12-12 23:47:24 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.climate.broadlink. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/loader.py", line 92, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/climate/broadlink.py", line 14, in <module>
    from homeassistant.helpers.restore_state import async_get_last_state
ImportError: cannot import name 'async_get_last_state'
2018-12-12 23:47:24 ERROR (MainThread) [homeassistant.loader] Unable to find component climate.broadlink

Yep. I’m getting the same error in 0.84.1 VENV.

Check the new version on Github, it worked for me.

“Restore states through a JSON store instead of recorder (HA 0.84)”

1 Like

Thanks mate. Working again. :+1:

Hi there,

Great work!

Anyone got this working with Toshiba air conditioners? I have a Toshiba RAS-13N3 split system and would like to control it via HA.

Cheers,
Pete

@Vassilis

Hi Vassilis,

I’ve updated to 84.1 and have and error with climate.broadlink. No info about breaking changes for broadlink. Do you have an ideia on what it could be?

image