Daikin airbase - testing new version of pydaikin

Unsure if you have pushed some changes, but I’m getting the mac address reported correctly and the climate devices have been created with the correct names; climate.upstairs and climate.downstairs.

Things started to work after the upgrade to Supervisor, but I couldn’t see anything relevant:

Success. :rocket:

2023-06-23 16:35:09.193 DEBUG (MainThread) [custom_components.daikin.config_flow] Creating device with host: 192.168.86.34, key: None, password: None
2023-06-23 16:35:09.194 DEBUG (MainThread) [pydaikin.daikin_base] Updating ['common/basic_info']
2023-06-23 16:35:09.833 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,sta=2,cur=2023/6/23 16:35:10,reg=au,dst=0,zone=54
2023-06-23 16:35:09.834 DEBUG (MainThread) [pydaikin.daikin_base] Updating ['common/basic_info', 'aircon/get_control_info', 'aircon/get_model_info', 'aircon/get_sensor_info', 'aircon/get_zone_setting']
2023-06-23 16:35:09.944 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,type=aircon,reg=au,dst=0,ver=1_1_8,rev=1F,pow=0,err=0,location=0,name=%55%70%73%74%61%69%72%73,icon=15,method=home only,port=30050,id=,pw=,lpw_flag=0,adp_kind=3,led=1,en_setzone=1,mac=48E7DA01943A,adp_mode=run,ssid=DaikinAP46401,err_type=0,err_code=0,en_ch=1,holiday=0,en_hol=0,sync_time=0
2023-06-23 16:35:10.063 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,pow=0,mode=1,operate=1,bk_auto=1,stemp=21,dt1=21,dt2=24,f_rate=5,dfr1=5,dfr2=5,f_airside=0,airside1=0,airside2=0,f_auto=0,auto1=0,auto2=0,f_dir=0,dfd1=0,dfd2=0,filter_sign_info=0,cent=0,en_cent=0,remo=2
2023-06-23 16:35:10.174 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,err=0,model=NOTSUPPORT,type=N,humd=0,s_humd=7,en_zone=0,en_linear_zone=0,en_filter_sign=1,acled=1,land=0,elec=0,temp=1,m_dtct=0,ac_dst=au,dmnd=0,en_temp_setting=1,en_frate=1,en_fdir=0,en_rtemp_a=0,en_spmode=0,en_ipw_sep=0,en_scdltmr=0,en_mompow=0,en_patrol=0,en_airside=0,en_quick_timer=1,en_auto=0,en_dry=1,en_common_zone=0,cool_l=16,cool_h=32,heat_l=16,heat_h=32,frate_steps=2,en_frate_auto=0
2023-06-23 16:35:10.285 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,err=0,htemp=-,otemp=-
2023-06-23 16:35:10.410 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,zone_name=%2d%3b%2d%3b%2d%3b%2d%3b%2d%3b%2d%3b%2d%3b%2d,zone_onoff=0%3b0%3b0%3b0%3b0%3b0%3b0%3b0
2023-06-23 16:35:10.411 DEBUG (MainThread) [custom_components.daikin.config_flow] ** MAC address obtained from device Appliance.factory(): 48E7DA01943A
2023-06-23 16:35:10.411 DEBUG (MainThread) [custom_components.daikin.config_flow] Creating entry with host: 192.168.86.34, mac: 48E7DA01943A, key: None, uuid: None, password: None
2023-06-23 16:35:10.411 DEBUG (MainThread) [custom_components.daikin] Setting up Daikin platform with configuration: {'host': '192.168.86.34', 'mac': '48E7DA01943A', 'api_key': None, 'uuid': None, 'password': None}
2023-06-23 16:35:10.411 DEBUG (MainThread) [pydaikin.daikin_base] Updating ['common/basic_info']
2023-06-23 16:35:10.637 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,sta=2,cur=2023/6/23 16:35:11,reg=au,dst=0,zone=54
2023-06-23 16:35:10.637 DEBUG (MainThread) [pydaikin.daikin_base] Updating ['common/basic_info', 'aircon/get_control_info', 'aircon/get_model_info', 'aircon/get_sensor_info', 'aircon/get_zone_setting']
2023-06-23 16:35:10.749 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,type=aircon,reg=au,dst=0,ver=1_1_8,rev=1F,pow=0,err=0,location=0,name=%55%70%73%74%61%69%72%73,icon=15,method=home only,port=30050,id=,pw=,lpw_flag=0,adp_kind=3,led=1,en_setzone=1,mac=48E7DA01943A,adp_mode=run,ssid=DaikinAP46401,err_type=0,err_code=0,en_ch=1,holiday=0,en_hol=0,sync_time=0
2023-06-23 16:35:10.861 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,pow=0,mode=1,operate=1,bk_auto=1,stemp=21,dt1=21,dt2=24,f_rate=5,dfr1=5,dfr2=5,f_airside=0,airside1=0,airside2=0,f_auto=0,auto1=0,auto2=0,f_dir=0,dfd1=0,dfd2=0,filter_sign_info=0,cent=0,en_cent=0,remo=2
2023-06-23 16:35:10.973 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,err=0,model=NOTSUPPORT,type=N,humd=0,s_humd=7,en_zone=0,en_linear_zone=0,en_filter_sign=1,acled=1,land=0,elec=0,temp=1,m_dtct=0,ac_dst=au,dmnd=0,en_temp_setting=1,en_frate=1,en_fdir=0,en_rtemp_a=0,en_spmode=0,en_ipw_sep=0,en_scdltmr=0,en_mompow=0,en_patrol=0,en_airside=0,en_quick_timer=1,en_auto=0,en_dry=1,en_common_zone=0,cool_l=16,cool_h=32,heat_l=16,heat_h=32,frate_steps=2,en_frate_auto=0
2023-06-23 16:35:11.087 DEBUG (MainThread) [pydaikin.daikin_airbase] Parsing ret=OK,err=0,htemp=-,otemp=-

That’s great to hear!

You can download the updated component here daikin.zip - Google Drive

@mover85 – Thanks for all your hard work on this. I tested your latest updated component using HA 2023.6.2 and a BRP15B61. Fixes #94046, #94648 and #94372 for me. Super awesome!

1 Like

I’m just waiting on @fredrike to merge the changes into pydaikin.

1 Like

Are you referring to: Bitbucket

I can’t recall the flow of the different init methods but if i remember correctly the __init__ is called directly when the object is created and then in Bitbucket we call each specifict init(). So, moving self.values.update({"htemp": "-", "otemp": "-", "shum": "--"}) from __init__() to init() should not have any side effects.

I’m happy to merge once you changed the for loop to something else, @mover85

1 Like

I am now getting a unique id migration method ready to avoid duplicate entities with this change.

1 Like

@mover85 – Nice. Happy to help test when you’ve got a new custom component ready.

I changed the manifest to

{
  "domain": "daikin",
  "name": "Daikin AC",
  "codeowners": ["@fredrike"], 
  "version": "2.10.4",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/daikin",
  "iot_class": "local_polling",
  "loggers": ["pydaikin"],
  "quality_scale": "platinum",
  "requirements": ["pydaikin==2.10.4"],
  "zeroconf": ["_dkapi._tcp.local."]
}

And now i’m getting this error.

2023-06-29 08:13:44.686 ERROR (MainThread) [homeassistant.components.climate] daikin: Error on device update!
Traceback (most recent call last):
  File "/workspaces/core/homeassistant/helpers/entity_platform.py", line 546, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/workspaces/core/homeassistant/helpers/entity.py", line 887, in async_device_update
    await self.async_update()
  File "/workspaces/core/homeassistant/components/daikin/climate.py", line 303, in async_update
    await self._api.async_update()
  File "/workspaces/core/homeassistant/components/daikin/__init__.py", line 123, in async_update
    await self.device.update_status()
  File "/home/vscode/.local/lib/python3.10/site-packages/pydaikin/daikin_base.py", line 186, in update_status
    resources = [
  File "/home/vscode/.local/lib/python3.10/site-packages/pydaikin/daikin_base.py", line 189, in <listcomp>
    if self.values.should_resource_be_updated(resource)
AttributeError: 'dict' object has no attribute 'should_resource_be_updated'

@mover85 – Just chiming in that I’m having the same error message as you. HA 2023.6.3, Daikin as a custom component, manifest changed to be like yours.

I’ve pushed a fix to my branch on bitbucket.

@mover85 – You’re a legend! That works for me: HA 2023.6.3, BRP15B61, manifest back to pulling git+https://bitbucket.org/mymover85/pydaikin.git@init-fix#pydaikin==2.10.4.

1 Like

New version is available on pypi…

1 Like

Thanks @fredrike and @mover85. Happy to confirm that this works for me using HA 2023.6.3, BRP15B61, and the Daikin integration as a custom component with manifest changed to pull pydaikin==2.10.5. This once again fixes #94046 , #94648 and #94372 for me. Looking forward to this making it to the next point release of Home Assistant. :crossed_fingers:t4:

1 Like

Great to hear!

@mover85 can you create a PR to add this to HA?

I have created a PR for this. Bump pydaikin 2.10.5 by mover85 · Pull Request #95656 · home-assistant/core (github.com)

2 Likes

Can we confirm that the fix hasnt made it to 2023.07.1 regarding zone switches?
(The error still exists for me)

Logger: homeassistant.components.websocket_api.http.connection
Source: components/daikin/switch.py:97
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:50:13 (1 occurrences)
Last logged: 10:50:13

[139937892386640] DaikinAirBase.set_zone() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1957, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1997, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 833, in entity_service_call
    response_data = task.result()  # pop exception if have
                    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1191, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 877, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/daikin/switch.py", line 97, in async_turn_off
    await self._api.device.set_zone(self._zone_id, "zone_onoff", "0")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DaikinAirBase.set_zone() takes 3 positional arguments but 4 were given

Looks like it’ll make it into 2023.7.2

Home Assistant 2023.7.2 has been released and I’m happy to confirm that it works for me! Awesome work getting this across the line @mover85 and @fredrike! Thank you.

1 Like

This latest update messed up my config. Now I have two devices, the old one and the new one created after the update. The old one is climate.daikin_ac while the new one is climate.daikinap48782
Perfect