Broadlink IR Climate Component

You can create an automation to achieve that without much effort if needed.

For me personally it wouldn’t work, when the aircon turns on the rooms with vents warm up very quickly but the area between the vents and return duct are ice cold. The air needs to circulate fully through the house before the aircon switches off. Only the aircon with the temperature sensor in the return duct can fairly accurately measure this.

If I used HA to control the aircon on/off, it would turn on and off every 30 seconds rather than every 10 (or there abouts) minutes when the aircon controls it.

Yeah, I see why you think this.

Firstly, you would place a thermostat where it makes sense. So in your case, maybe you would rather place a sensor near the aircon return - much as I have. Therefore, you’re sampling the temperature at the furthest distance from the air-con return vents.

As for the frequency of the on/off action of the air-con - that is where min_cycle_duration and the tolerance settings come into play. min_cycle_duration ensures that your air-con will be on for at least this amount of time before assessing the need to turn off. Hot and cold `tolerance’ settings allow you to set a “extra” amount that your thermostat can report before the air-con will be kicked into acting. Say, during heating with a goal of 22c, and a tolerance of 1c, your thermostat may run until 23c if you wish it.

Both these settings combined create the perfect option for yourself…

Any fix for the mentioned issues above? Or do we need to revert?

@monkey-house What date did you revert file to? https://github.com/vpnmaster/homeassistant-custom-components/commits/master/custom_components/climate

@its: The old .py from begining of March (downloaded March 5ft) that was working for me before.

I’m sorry but I can’t reproduce your problem. Is the broadlink switch component works ok?

@Vassilis I think the issue is happening to people who are using docker install ?

Nothing works in broadlink due to the error… I will revert the file as mentioned by @monkey-house and see…

First try to delete pycache and broadlink.py from custom_components\climate folder. Download the file from github again https://raw.githubusercontent.com/vpnmaster/homeassistant-custom-components/master/custom_components/climate/broadlink.py

If you are using the broadlink switch platform, try to comment it in your configuration and restart HA. Please post your results

So I got the latest file… Commented out climate and switch referring to broadlink… deleted pycache folder…

Startup no errors

I have two broadlink devices

Removed the comment from the following code

switch:
  - platform: broadlink
    host: XXX.XXX.XXX.XXX
    mac: 'XX:XX:XX:XX:XX'
    switches:
      tv_lg:
        friendly_name: "LG TV"
        command_on: 'JgBYAAABKZMSExITEjgSExITEhMRFBETEjgSOBITEjgROBI4EjgSOBEUERMSExI4EhMSExITERQROBI4EjgSExI3EjgSOBI4EgAFKQABKUoSAAxcAAEpShIADQU='
        command_off: 'JgBYAAABKZMSExITEjgSExITERQRExITEjgSOBITETgSOBI4EjgROBITEhMSExI4EhMSExEUERMSOBI4EjgSExE4EjgSOBI3EgAFKgABKUkSAAxdAAEoShIADQU='

Got the error

2018-06-27 08:43:38 INFO (MainThread) [homeassistant.components.switch] Setting up switch.broadlink
2018-06-27 08:43:38 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
TypeError: init() takes 3 positional arguments but 4 were given

The commented that line out and uncommented another block

  - platform: broadlink
    host: XXX.XXX.XXX.XXX
    mac: 'XX:XX:XX:XX:XX'

Error

2018-06-27 08:48:37 INFO (MainThread) [homeassistant.components.switch] Setting up switch.broadlink
2018-06-27 08:48:37 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):

Commented that out… no errors…

removed comment from the last block of code I have

climate:
  - platform: broadlink
    name: Living Room AC
    host: XXX:XXX:XXX:XXX
    mac: 'XX:XX:XX:XX:XX'
    ircodes_ini: 'custom_components/broadlink_climate_codes/fujitsu.ini'
    min_temp: 16
    max_temp: 30
    target_temp: 20
    temp_sensor: sensor.temperature_158d0001fa985e
    default_operation: off
    default_fan_mode: mid
    customize:
      operations:
        - 'off'
        - idle
        - cool
        - heat
      fan_modes:
        - low
        - mid
        - high
        - auto

Get the error

2018-06-27 08:53:19 INFO (MainThread) [homeassistant.components.climate] Setting up climate.broadlink
2018-06-27 08:53:19 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform broadlink
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 212, in coro
res = func(*args, **kw)
File “/config/custom_components/climate/broadlink.py”, line 92, in async_setup_platform
broadlink_device = broadlink.rm((ip_addr, 80), mac_addr, None)
TypeError: init() takes 3 positional arguments but 4 were given

So something wrong with any of the configs??

Are you using venv?

Sorry what’s that? New to this stuff… Using docker to run HA…

@Vassilis: I can confirm I went through all of the steps and cannot get the broadlink (media + climate) custom_components, except when downgrading to a pre-March 5th version.

I’m running v70.1 & v72.0 in docker containers.

Updated my venv instance of HA 0.72 and have not had any issues. Maybe a docker issue?

Yeah it’s definitely affecting docker users like me it seems!!!

In case anyone needed control codes for LG Standard AC S12EQ
The format is a bit different as I’ve done it as separate scripts for broadlink device, so you’ll have to convert it a bit. But it is better than getting the codes on your own.

And if you want a dedicated component for this AC unit, you can use my code, which I’ve written before getting to know that @Vassilis already made his component :wink:
My component supports by default 3 operation modes that @Vassilis’s component doesn’t - Dehumidifier, Fan only and Jet mode.
Here’s the code:

1 Like

Dear Vassils,
I am using this components since i started using my aircon with homeassistant.
i am thankfull to you that, you make it work,

Are there any chance of feaure addons
line swing, turbomode, sleepmode, etc?

Hi, I was able to make it function somehow great work! I have a question, Is it possible to use button to set operation_mode instead of the dropdown menu?

thanks

Thank for you component, works like a charm.

If anyone’s interested I posted my .ini file fo a Vaillant climaVair unit in my github

Still have error with updated broadlink.py and 0.74.2 in docker

2018-07-28 08:40:36 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/switch/broadlink.py”, line 143, in setup_platform
broadlink_device = broadlink.rm((ip_addr, 80), mac_addr, None)
TypeError: init() takes 3 positional arguments but 4 were given

I get this error after updating from 0.63. I have broad link 0.9 installed and home assistant updated to 0.74.2. Seems like all broad link, including climate is broken. Its the same 3 arguments expected but 4 were given error.

2018-07-31 16:06:00 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 143, in setup_platform
broadlink_device = broadlink.rm((ip_addr, 80), mac_addr, None)
TypeError: init() takes 3 positional arguments but 4 were given

I found a solution to the ‘3 positional arguments but 4 were given’ error.

I uninstalled broad link 0.9 and installed 0.8. Then edited the custom component to look for 0,8 instead of 0.9. Then it all worked normally, even with friendly names. :slight_smile: