Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daikin key error in 2023.7.2 #96530

Closed
mitch569 opened this issue Jul 14, 2023 · 28 comments · Fixed by #96575
Closed

Daikin key error in 2023.7.2 #96530

mitch569 opened this issue Jul 14, 2023 · 28 comments · Fixed by #96575

Comments

@mitch569
Copy link

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
Copy link

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
Copy link
Contributor

@mover85 can you please take a look at this?

@mover85
Copy link
Contributor

mover85 commented Jul 15, 2023

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

@tomlut
Copy link

tomlut commented Jul 15, 2023

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
Copy link
Contributor

mover85 commented Jul 15, 2023

Hopefully this will be solved with the above PR.

@meierthomas
Copy link

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
Copy link

tomlut commented Jul 22, 2023

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
Copy link

tomlut commented Jul 22, 2023

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
Copy link

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

@joostlek joostlek reopened this Jul 22, 2023
@MikeatLorne
Copy link

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
Copy link
Contributor

mover85 commented Jul 25, 2023

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

@joostlek joostlek changed the title Integration fails after update to 2023.7.2 Daikin fails after update to 2023.7.2 Jul 25, 2023
@MikeatLorne
Copy link

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

@kingy444
Copy link
Contributor

kingy444 commented Jul 26, 2023

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
Copy link
Contributor

mover85 commented Jul 27, 2023

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

@mover85
Copy link
Contributor

mover85 commented Jul 27, 2023

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
Copy link

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
Copy link

i am still stuck on 2023.7.1

@mover85
Copy link
Contributor

mover85 commented Aug 5, 2023

@sekotsmit Do you have a debug log?

@sekotsmit
Copy link

@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
Copy link
Contributor

mover85 commented Aug 6, 2023

@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
Copy link

JoachimC commented Aug 8, 2023

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
Copy link

d2kagw commented Aug 15, 2023

+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
Copy link

Maxwell2022 commented Aug 18, 2023

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

@fredrike
Copy link
Contributor

Is this a duplicate of #96809 ?

@kingy444
Copy link
Contributor

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
Copy link
Contributor

  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 #96575.

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

@fredrike
Copy link
Contributor

@home-assistant rename Daikin key error in 2023.7.2

@home-assistant home-assistant bot changed the title Daikin fails after update to 2023.7.2 Daikin key error in 2023.7.2 Aug 29, 2023
@fredrike
Copy link
Contributor

@home-assistant close

@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.