Daikin Component - no climate entities created - task exception

Your PR sets the temperature to 22°C when changing the fan_mode!

Edit: I see that you are on the issue on github :slight_smile:

Yes that’s another kind of issue, related to the daikin Python library used to comunicate with the device. Will work on that!

1 Like

Unfortunately, I still need to rely on the custom_components published above.

The new daikin component published with 0.81, not only doesn’t solve the old issues, but introduces new ones.

That is, of course, if I am not the only one with issues here.

I’ve reworked the underlying pydaikin (soon to be v0.7) module for the Daikin component.

This is supposed to fix the issues with temperature reset when changing fan mode. I’ve also taken a decision to make a change that reflect the OEM Daikin app too:

The new changes will set the temperature and humidity to the last setting for that mode. I.e. say that you have 22° for hot and 24° for cold, when you switch from hot to cold the temperature will be set to 24° too. (This is how the Daikin devices and applications works).

This means that when you are controlling from the climate component in Home Assistant, then the temperature will change when you change mode (as you are only able to change one parameter at time there). However, when changing mode from say an automation you can (should) set the operation_mode too.

Please let me know if this change is unacceptable, if it should be an opt out, or if the “previous” setting were better (where the temperature were “persistent” between modes).

1 Like

Can you also please make sure the new units (ending Bxx, instead of Axx) are working?

Sure, what makes them special? I.e. what kind of differences do I need to take into account?

Edit: Make sure that you can run pydaikin · PyPI and report all issues you have and we will try to fix that.

Is it possible to try the temperature fix already now? If yes, which files do I need to add to custom components?

I just updated to 0.82.1 and it broke Daikin integration for me. Previously had Daikin as a climate entry, and a sensor entry. Added it as its own component as per the new docs and it still didn’t work. Removed both the climate and sensor, and only the sensors worked.

I ended up having to add Daikin as its own component, AND as a climate component to get everything working again. Is this expected? Or should adding Daikin as its own component only be enough for sensors and the climate entity?

Apparently, upgrading to 0.82.1 will get you the latest changes.

There are no breaking changes in integration, what was your previous config and version?

This is my Daikin configuration and you are right, it should be enough with just the daikin entry.

climate:                                                                                                                                                                        
  - platform: daikin                                                                                                                                                            
    host: 192.168.1.15                                                                                                                                                          
                                                                                                                                                                                 
daikin:                                                                                                                                                                         
  hosts:                                                                                                                                                                        
  - 192.168.1.15                                                                                                                                                                

I’m going to rewrite the configuration parts (using configuration entities) once people have tested 0.82.1 and are happy with the current functions.

Hi @fredrike ,

I also have the Bxx module instead of Axx (BRP069B41) and with the following config:

daikin:
hosts:
- 192.168.1.133

It doesn’t start:
2018-11-17 18:26:45 ERROR (MainThread) [homeassistant.setup] Error during setup of component daikin
Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
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/daikin.py”, line 82, in setup
if daikin_api_setup(hass, host) is None:
File “/usr/src/app/homeassistant/components/daikin.py”, line 105, in daikin_api_setup
device = appliance.Appliance(host)
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 110, in init
self.values.update(self.get_resource(resource))
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 115, in get_resource
return self.parse_response(r.text)
File “/usr/local/lib/python3.6/site-packages/pydaikin/entity.py”, line 28, in parse_response
raise ValueError(“non-OK return on response”)
ValueError: non-OK return on response

2018-11-17 18:27:05 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
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/daikin.py”, line 72, in discovery_dispatch
if daikin_api_setup(hass, host) is None:
File “/usr/src/app/homeassistant/components/daikin.py”, line 105, in daikin_api_setup
device = appliance.Appliance(host)
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 110, in init
self.values.update(self.get_resource(resource))
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 115, in get_resource
return self.parse_response(r.text)
File “/usr/local/lib/python3.6/site-packages/pydaikin/entity.py”, line 28, in parse_response
raise ValueError(“non-OK return on response”)
ValueError: non-OK return on response

Any logs you need please tell me and I will collect.

Thanks!

I’ll take a look but the “non-OK on response” indicates that there might be something deeper that is not working.

Try to access http://192.168.1.133/common/basic_info

If that is successful we might have other deeper issues…

Can you also download and play with pydaikin from pypi (pip install pydaikin).

Edit: I’ll try to update the code in pydaikin but please try the endpoints listed here so we can track what is going wrong https://bitbucket.org/mustang51/pydaikin/src/bf142f9708a01e673d40b9bba1ad9ada09c5094f/pydaikin/appliance.py?at=master&fileviewer=file-view-default#appliance.py-21

Since we are gathering info from the field I just wanted to chime in and let you all know that I am running three BRP072A43 units and have had no issues since upgrading to 0.82.1.

1 Like

That’s great news! There is one more fix in the main lib that didn’t reach the 0.82.1 release but it will just fix a wired issue going to/from fan only mode.

Perhaps we need a list of models working and models that still are in progress…

I am still using the custom_component posted a while above.
The official one does NOT work with the Bxx units.

Could you please specify why it doesn’t work so we can figure out a fix.

@fredrike

I am running BRP072A42 on my ducted unit and the upgrade to 82.1 is functional. My unit does not support swing, nor does it support fan speed, although this appears to not be a configurable option with the BRP072A42

temperature value holds when switching off / on now and no longer resets to 22 as it did in the past (i was getting around this with scripts)

For those using lovelace, i have also been using the following card

with success. had an issue at the beginning with dark themes not being applied correctly which has been fixed with v82.x

1 Like

Sure the response from http://192.168.1.133/common/basic_info is:

ret=OK bla bla

I also tried some others mentioned above and these ones didn’t work:
[root@server ~]# curl http://192.168.1.133/aircon/get_timer
ret=PARAM NG,msg=404 Not Found
[root@server ~]# curl http://192.168.1.133/aircon/get_program
ret=PARAM NG,msg=404 Not Found
[root@server ~]# curl http://192.168.1.133/aircon/get_scdltimer
ret=PARAM NG,msg=404 Not Found

Regarding pydaikin:
[root@server bin]# pydaikin
Traceback (most recent call last):
File “/usr/bin/pydaikin”, line 3, in
import pydaikin.appliance as appliance
ImportError: No module named pydaikin.appliance

1 Like

Thank you for your tests. I’ve created a patch for you and it would be great if you could try this on your home-assistant, if you are running docker start with:

sudo docker exec -it home-assistant /bin/bash

Then just paste the code below:

cd /usr/local/lib/python3.6/site-packages/
cat <<EOF > /tmp/BRP069B41.patch
diff --git a/pydaikin/appliance.py b/pydaikin/appliance.py
index ee4a3ef..5ae0b53 100644
--- a/pydaikin/appliance.py
+++ b/pydaikin/appliance.py
@@ -132,8 +132,8 @@ class Appliance(entity.Entity):

     def get_resource(self, resource):
         r = self.session.get('http://%s/%s' % (self.ip, resource))
-
-        return self.parse_response(r.text)
+        if r.status_code == 200:
+            return self.parse_response(r.text)

     def update_status(self, resources=INFO_RESOURCES):
         for resource in resources:

EOF
patch -p1 < /tmp/BRP069B41.patch

ash-4.3# sudo docker exec -it 9774677cc7be /bin/bash
root@homeassistant:/usr/src/app#
root@homeassistant:/usr/src/app#
root@homeassistant:/usr/src/app# cd /usr/local/lib/python3.6/site-packages/
root@homeassistant:/usr/local/lib/python3.6/site-packages# cat < /tmp/BRP069B41.patch

diff --git a/pydaikin/appliance.py b/pydaikin/appliance.py
index ee4a3ef…5ae0b53 100644
— a/pydaikin/appliance.py
+++ b/pydaikin/appliance.py
@@ -132,8 +132,8 @@ class Appliance(entity.Entity):

 def get_resource(self, resource):
     r = self.session.get('http://%s/%s' % (self.ip, resource))
  •    return self.parse_response(r.text)
    
  •    if r.status_code == 200:
    
  •        return self.parse_response(r.text)
    

    def update_status(self, resources=INFO_RESOURCES):
    for resource in resources:

EOF
root@homeassistant:/usr/local/lib/python3.6/site-packages# patch -p1 < /tmp/BRP069B41.patch
patching file pydaikin/appliance.py
Hunk #1 succeeded at 111 with fuzz 2 (offset -21 lines).

But after HA restart still not working:

2018-11-18 09:59:45 ERROR (MainThread) [homeassistant.setup] Error during setup of component daikin
Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
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/daikin.py”, line 82, in setup
if daikin_api_setup(hass, host) is None:
File “/usr/src/app/homeassistant/components/daikin.py”, line 105, in daikin_api_setup
device = appliance.Appliance(host)
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 110, in init
self.values.update(self.get_resource(resource))
TypeError: ‘NoneType’ object is not iterable
2018-11-18 10:00:04 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
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/daikin.py”, line 72, in discovery_dispatch
if daikin_api_setup(hass, host) is None:
File “/usr/src/app/homeassistant/components/daikin.py”, line 105, in daikin_api_setup
device = appliance.Appliance(host)
File “/usr/local/lib/python3.6/site-packages/pydaikin/appliance.py”, line 110, in init
self.values.update(self.get_resource(resource))
TypeError: ‘NoneType’ object is not iterable

Also I was now able to run pydaikin from another server:

(daikin) [root@server daikin]# pydaikin 192.168.1.133
name: DaikinAP33170
mac: 80:C5:F2:90:4E:6E
mode: off
fan rate: silence
fan direction: 3d
inside temp: 21.0
outside temp: 14.0
target temp: 27.0
compressor demand: 0
away_mode: off
error code: 0

Please tell me if you need me to run with any specific parameter.

Thanks

1 Like

Me and @jonaspaulo have a fix for his unit (will reach HA soon).

I’ve started an attempt to document the devices we have and the documented issues with the units here please comment there if I’ve missed something and I’ll try to keep the list up to date.