Daikin Component - no climate entities created - task exception

As stated to the others @dancwilliams u should remove those “custom” files and just try to use WITHOUT any code changes directly the dev branch.

That’s why I’ll say it again: don’t use custom files unless u know how to use them otherwise even after the release HA will always use ur “custom” files ignoring my fix :frowning_face:.

My fix includes two PR’s: https://github.com/home-assistant/home-assistant/pull/11840 and https://github.com/home-assistant/home-assistant/pull/11841 where BOTH FILES climate/daikin.py and climate/init.py have been modified. U probably modified only daikin.py file.

I (once again) encourage u guys to use the docs from https://home-assistant.io/docs/installation/updating/ for deploying the dev branch instead of modifying (wrong) files directly.

Let me know if u still have the any error.

Like I said in my post, I already deleted everything I had in custom components and was seeing the same error. Just waiting for the next release.

Thanks,

Dan W.

Thanks for the additional information.

I did have the new __init__.py from your PR, but from what I am seeing from the output above and the test I just ran, the __init__.py in the custom_components/climate/ directory is not being picked up when HASS restarts. But, the daikin.py file is being picked up. I am running HASSIO and am not familiar enough to troubleshoot why the init file is not recognized.

I just went ahead and removed all of the files again and restarted. I will just wait for the next release cycle and test then. Unless I get some free time later and decide to actually dive into it further :slight_smile:.

Again…thanks,

Dan W.

0.62 released guys. How is it on ur side, can u finally see the climate component @dancwilliams, @peterho, @brettjonesoz ?

Just waiting for the hassio update to come out and I will test and let you know. I expect it to be on the street tomorrow.

I upgraded to 0.62 and everything looks great! My BRP072A43 is now showing up as climate.office.

{
  "current_temperature": 61,
  "min_temp": 45,
  "max_temp": 95,
  "temperature": 70,
  "target_temp_step": 1,
  "operation_mode": "Off",
  "operation_list": [
    "Cool",
    "Fan",
    "Hot",
    "Auto",
    "Off",
    "Dry"
  ],
  "unit_of_measurement": "°F",
  "friendly_name": "Office",
  "supported_features": 129
}

Thanks!

Dan

Ok…

Even though it is showing up properly now, I am not able to set the temperature or mode. See errors below.

When trying to set temperature:

Sun Jan 28 2018 06:32:38 GMT-0600 (CST)

Error executing service <ServiceCall climate.set_temperature: temperature=71.0, entity_id=['climate.office']>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 336, in async_temperature_set_service
    yield from climate.async_set_temperature(**kwargs)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 217, in set_temperature
    self.set(kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 178, in set
    self._api.device.set(values)
  File "/usr/lib/python3.6/site-packages/pydaikin/appliance.py", line 166, in set
    fan   = self.values['f_rate']
KeyError: 'f_rate'

When trying to set mode:

Sun Jan 28 2018 06:25:10 GMT-0600 (CST)

Error executing service <ServiceCall climate.set_operation_mode: operation_mode=Cool, entity_id=['climate.office']>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 400, in async_operation_set_service
    yield from climate.async_set_operation_mode(operation_mode)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 231, in set_operation_mode
    self.set({ATTR_OPERATION_MODE: operation_mode})
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 178, in set
    self._api.device.set(values)
  File "/usr/lib/python3.6/site-packages/pydaikin/appliance.py", line 166, in set
    fan   = self.values['f_rate']
KeyError: 'f_rate'

Thoughts?

Dan

Damn…unofrtunatelly another small PR since the code still reaches points it should not since ur device doesn’t support fan speed (f_rate).
Sorry I missed that one :frowning:
I’ll do the PR tonights

I appreciate you sticking with this. I wish I knew why the device does not support fan rate even though the actual IR remote does. Feature disparities like that are so frustrating.

Again, thanks!

Dan

Hey @dancwilliams are you sure you’re getting those errors, because I’ve faked it locally to emulate that I also don’t have fan direction and speed and tried to set the temperature and operation mode as u did and it worked in both cases without any errors in my logs.

Can you please make sure you don’t have any custom file in your system ?

@brettjonesoz, @peterho can you please confirm me if it’s working or not for you guys ?

I just verified that I have no custom components installed and restarted HASS to perform another test and am receiving the same error.

When trying to set mode:

Sun Jan 28 2018 08:08:54 GMT-0600 (Central Standard Time)

Error executing service <ServiceCall climate.set_operation_mode: operation_mode=Hot, entity_id=['climate.office']>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 400, in async_operation_set_service
    yield from climate.async_set_operation_mode(operation_mode)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 231, in set_operation_mode
    self.set({ATTR_OPERATION_MODE: operation_mode})
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 178, in set
    self._api.device.set(values)
  File "/usr/lib/python3.6/site-packages/pydaikin/appliance.py", line 166, in set
    fan   = self.values['f_rate']
KeyError: 'f_rate'

When trying to set temp:

Sun Jan 28 2018 08:10:45 GMT-0600 (Central Standard Time)

Error executing service <ServiceCall climate.set_temperature: temperature=71.0, entity_id=['climate.office']>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 336, in async_temperature_set_service
    yield from climate.async_set_temperature(**kwargs)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 217, in set_temperature
    self.set(kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/daikin.py", line 178, in set
    self._api.device.set(values)
  File "/usr/lib/python3.6/site-packages/pydaikin/appliance.py", line 166, in set
    fan   = self.values['f_rate']
KeyError: 'f_rate'

My config is very straightforward:

climate:
  - platform: daikin
    host: 172.20.20.220

If there is anything additional you would like me to try just let me know.

Dan

I just found the problem and it seems to located inside the pydaikin external library (outside HA code) that we use. That library is not aware if all features (like fan rate and fan speed) are available and it always tries to read them. So you’re right about the problem:

File "/usr/lib/python3.6/site-packages/pydaikin/appliance.py", line 166, in set
    fan   = self.values['f_rate']

The good news is I also found a small hack that I hope that it will be accepted on the code review by HA maintainers. I’ll submit the PR shortly and I’ll keep you updated.
The fix I’m trying to implement is set some default correct values for those two params (f_rate and f_dir). My daikin accepts them because it knows about them. I just hope that your daikin will also accept them otherwise we’ll need a PR on that external library which is very old and is not even located in github, it’s in bitbucket.

Before I submit the PR can you tell me what’s the output of this URL in your browser:

http://[YOUR_DAIKIN_IP]/aircon/set_control_info?pow=0&mode=7&stemp=25&shum=0&f_rate=A&f_dir=0

This is to check if your device, even thought it doesn’t support f_dir and f_rate params, it still accepts them as valid.

Absolutely!

This is what I receive:

ret=OK,adv=

Perfect, then I’ll submit the PR shortly :slight_smile: !
I hope HA maintainers will accept this hack since that library seems old and unamintained for quite a while and it’s on bitbucket :frowning:

Thanks!

I was just checking out the pydaikin code and I see what you are saying. And yeah, it has not been touched in a while. Sure you don’t want to take over maintaining a pyhton package as well :slight_smile:.

Dan

PR https://github.com/home-assistant/home-assistant/pull/12000 created.
If anyone could test it in advance before it gets released it would be great so we don’t discover another issue since I can’t fully test it locally 'cause it’s already working on my two daikins.

Give me a minute…

Works great! I am able to set mode and temperture without issue. Great!

I have one additional question…

I am currently using this configuration:

When, or why, would we switch to this method:

Thanks! This is exciting stuff!

Dan

  1. Please make a post in my PR from above confirming that this fix works so we can get an extra trust point from the HA maintainers/code reviewers.

  2. I don’t get ur comments on docs, the only change I’ve perofrmed recently was to autodiscover both climate and sensors for Daikin. In rest there’s no change in the configs. Maybe u can pinpoint the exact texts that are confusing ?