home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.72k stars 30.45k forks source link

Daikin key error in 2023.7.2 #96530

Closed mitch569 closed 1 year ago

mitch569 commented 1 year ago

The problem

Hi, I was having problems with the previous version that caused the zones not function. Didn't bother me too much but since I updated to the 2023.72, the intergration fails. I've tried to delete the intergration and install again but it fails to setup. Also tried moving the dongle to the main network, this also does not help.

Any help is appreciated. Cheers

What version of Home Assistant Core has the issue?

2023.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

dakin

Link to integration documentation on our website

https://www.home-assistant.io/integrations/daikin

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/daikin/__init__.py:142
First occurred: 5:48:34 pm (4 occurrences)
Last logged: 5:52:41 pm

Error setting up entry 192.168.5.225 for daikin
Error setting up entry Daikin for daikin
Error setting up entry 192.168.1.225 for daikin
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/daikin/__init__.py", line 56, in async_setup_entry
    await async_migrate_unique_id(hass, entry, daikin_api)
  File "/usr/src/homeassistant/homeassistant/components/daikin/__init__.py", line 142, in async_migrate_unique_id
    new_name = api.device.values["name"]
               ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydaikin/values.py", line 24, in __getitem__
    return self._data[key]
           ~~~~~~~~~~^^^^^
KeyError: 'name'

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @fredrike, mind taking a look at this issue as it has been labeled with an integration (daikin) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `daikin` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign daikin` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


daikin documentation daikin source (message by IssueLinks)

fredrike commented 1 year ago

@mover85 can you please take a look at this?

mover85 commented 1 year ago

I see the problem, it is one of the changes I was asked to make!

tomlut commented 1 year ago

Only one of my Daikin AC units failed after updating to 2023.7.2, my ducted unit. The other split system was ok.

Now that I have rolled back to 2023.7.1 both are working again but I have two devices listed for the ducted unit and there does not appear to be a way to delete the duplicate.

mover85 commented 1 year ago

Hopefully this will be solved with the above PR.

meierthomas commented 1 year ago

Same issue for me. After the upgrade to 2023.7.2 the climate entity is unavailable... rather than rolling back, I'll walk to the wall unit :)

tomlut commented 1 year ago

The update to 2023.7.3 did not fix this. I still have a duplicate device. My original device is unavailable and the duplicate appears to be working.

There does not appear to be a way to delete the older device so that I can rename the new entities.

tomlut commented 1 year ago

I managed to delete the unavailable entities of the original device and rename the the entities in the new device to match the original ones. So at least my automations are working again now.

Now how do I delete the defunct duplicate device?

EDIT: fixed by editing the core device registry. While I am comfortable editing json this is not a great user experience for others.

meierthomas commented 1 year ago

Yeah, continue to use the manual workaround with 2023.7.3 as I'm not comfortable editing the core device registry even though my automations don't work. I know this is OpenSource and understand that everyone working on this is using their spare time to support this great platform

MikeatLorne commented 1 year ago

2023.7.3 did not work for me either. I have reverted to 2023.7.1 again. thank you to those working to fix this.

mover85 commented 1 year ago

Would it be possible to give me a copy of the device and entity registry entries before and after the change?

MikeatLorne commented 1 year ago

happy to help but I am in uncharted waters. please be more specific about what is required and I will try.

kingy444 commented 1 year ago

The update to 2023.7.3 did not fix this. I still have a duplicate device. My original device is unavailable and the duplicate appears to be working.

There does not appear to be a way to delete the older device so that I can rename the new entities.

+1 for duplicate entries on 2023.7.3 - did the unique_id format change I assume ?

could maybe try disabling the old device, then perhaps I can delete it and rename the new one - but also be good (for you) to know whatever changes you make work or not

mover85 commented 1 year ago

The unique id was changed for airbase but should migrate automatically.

mover85 commented 1 year ago

happy to help but I am in uncharted waters. please be more specific about what is required and I will try.

The json files are in the .storage directory in your config directory.

sekotsmit commented 1 year ago

Problem still exists in 2023.8.0. I have 23 Daikin splits around my site and during an upgrade from 2023.7.1 it creates duplicates for all of them and none are accessible except 1 for some reason? Running 2023.7.1 till further notice...

MikeatLorne commented 1 year ago

i am still stuck on 2023.7.1

mover85 commented 1 year ago

@sekotsmit Do you have a debug log?

sekotsmit commented 1 year ago

@sekotsmit Do you have a debug log?

I've restored to a previous backup to get things working again, so unfortunately no. I should have saved it. I did notice however, that after restoring things back to a previous backup there are actually 2 devices for each split system in HA that must have been created during a previous update. See attachment. This might be part of the problem upgrading to higher than 2023.7.2?

image

mover85 commented 1 year ago

@sekotsmit I thought that 2023.7.1 caused the duplicates too. I am trying to find a way to remove the duplicates safely which should solve this issue.

JoachimC commented 1 year ago

This integration doesn't work for me in 2023.7.3 (and I assume 2023.8.0)

I'm sorry I didn't pay very close to attention to exactly what happened but a recent previous version (2023.7.2? 2023.7.1?) a duplicate device was created for my unit. I didn't think much about it but one of the entries worked and the other didn't. So I deleted (using the UI) the one that didn't and configured all my dashboards / automations to this remaining one that worked.

And then with the upgrade to 2023.7.3 the remaining device didn't work at all. I downgraded to 2023.7.1 and it's working fine again now.

This is a valuable integration for me so I'm happy to help diagnose what's going on here if somebody can guide me on what I might need to do? (I'm a developer but not done any work on HA before)

thanks

d2kagw commented 1 year ago

+1 for this issue. I also have two devices, a new one has been added after the update, and the original is no longer working.

Maxwell2022 commented 1 year ago

I just ran into this today after updating HA OS, I had to restore my last backup 2023.6.3

fredrike commented 1 year ago

Is this a duplicate of #96809 ?

kingy444 commented 1 year ago

Is this a duplicate of #96809 ?

Looks like they are the same, but I would say #96809 is the dupe of this one (this one was raised 2 months ago vs 1 month ago)

fredrike commented 1 year ago
  File "/usr/local/lib/python3.11/site-packages/pydaikin/values.py", line 24, in __getitem__
    return self._data[key]
           ~~~~~~~~~~^^^^^
KeyError: 'name'

This particular issue is fixed in https://github.com/home-assistant/core/pull/96575.

I'll close this and duplicate devices have to be discussed in #96809.

fredrike commented 1 year ago

@home-assistant rename Daikin key error in 2023.7.2

fredrike commented 1 year ago

@home-assistant close