DavidMStraub / homeassistant-homeconnect

Custom component for Home Assistant to connect appliances supporting the Home Connect standard
MIT License
118 stars 29 forks source link

Washdryer - washing programs and drying programs have the same name #119

Closed Krocko closed 3 years ago

Krocko commented 3 years ago

I have a Siemens washdryer (WD14U592) The integration generates the same names for the washing programs and the drying programs. I get the following error and no drying programs are added.

Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:490 
Integration: Schalter (documentation, issues) 
First occurred: 20:26:39 (4 occurrences) 
Last logged: 20:26:39

Platform home_connect_beta does not generate unique IDs. ID SIEMENS-WD14U592-68A40E36D132-Program Cotton already exists - ignoring switch.waschmaschine_program_cotton
Platform home_connect_beta does not generate unique IDs. ID SIEMENS-WD14U592-68A40E36D132-Program Mix already exists - ignoring switch.waschmaschine_program_mix
Platform home_connect_beta does not generate unique IDs. ID SIEMENS-WD14U592-68A40E36D132-Program Outdoor already exists - ignoring switch.waschmaschine_program_outdoor
Platform home_connect_beta does not generate unique IDs. ID SIEMENS-WD14U592-68A40E36D132-Program Towels already exists - ignoring switch.waschmaschine_program_towels
Krocko commented 3 years ago

@yusijs Have you the same problem?

yusijs commented 3 years ago

Yes, sort of; the problem is that HomeConnect doesnt expose the programs separately. I noticed it in my logs and was thinking of looking at resolving it, but I rarely, if ever use those toggles, so I couldnt be bothered

Krocko commented 3 years ago

Maybe in the homebridge repository is something useful?

https://github.com/thoukydides/homebridge-homeconnect

DavidMStraub commented 3 years ago

Sorry I never reacted to this. This is caused by this line

desc = " ".join(["Program", program_name.split(".")[-1]])

Only the last part of the program is used for the unique ID. Removing .split(".")[-1] should fix it. Do you want to submit a PR?

DavidMStraub commented 3 years ago

Ideally, after testing it since I don't have a WasherDryer :)

yusijs commented 3 years ago

I'll give it a spin! :)

yusijs commented 3 years ago

@DavidMStraub I just got a weird, new error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 249, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/home_connect_beta/__init__.py", line 222, in async_setup_entry
    hass.config_entries.async_setup_platform(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platform'

Any clue as to where I should look to solve this?

DavidMStraub commented 3 years ago

Are you sure you are using the latest version from master? The line looks different:

https://github.com/DavidMStraub/homeassistant-homeconnect/blob/master/custom_components/home_connect_beta/__init__.py#L222

yusijs commented 3 years ago

I am, and it is identical hass.config_entries.async_setup_platform(entry, PLATFORMS)

yusijs commented 3 years ago

Ok never mind, I upgraded my homeassistant installation and it worked now. The change seems to have worked.