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.8k stars 30.5k forks source link

Xiaomi deerma.humidifier.jsq2w Setup failed code 5001 message stuck #124068

Closed saschachina closed 2 months ago

saschachina commented 2 months ago

The problem

Cant add my deerma.humidifier.jsq2 to the integration, i double check the cloud sever, the ip address and try to set up manuell with the token, always the same message. Setup failed code 5001 message stuck

What version of Home Assistant Core has the issue?

2024.8.1

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

Xiaomi Miio

Link to integration documentation on our website

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

Diagnostics information

home-assistant_xiaomi_miio_2024-08-16T16-02-01.503Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

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

Code owner commands Code owners of `xiaomi_miio` 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 xiaomi_miio` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

saschachina commented 2 months ago

I just the check the network connection, seems like everything is fine, also i can control the humidifier via the Xiaomi Home app without any problems. I also just switch off/on the humidifier to double check it didnt hang on.

I have a fan in the same room, this one works with the integration as expect without problems.

tomoniu commented 2 months ago

Hello i have the exact same issue, tried resetting the device, it works fine from the xiaomi app, also i have a xiaomi Air Purifier that works without any problems. Please give us some hint on what else we can try, i don't think it is a problem with the device. Thank you

syssi commented 2 months ago

Just an idea for poking around: Could you try the custom component xiaomi_miio_airpurifier. Do you see the same error here? If not we have to identify the differences of both implementations.

saschachina commented 2 months ago

Just an idea for poking around: Could you try the custom component xiaomi_miio_airpurifier. Do you see the same error here? If not we have to identify the differences of both implementations.

Before I used the custom component Xiaomi, it works perfectly, but I delete it because want change to the official HA Integration.

syssi commented 2 months ago

Please give it a try nevertheless. Imagine it's a firmware issue which only happens if the availability of the Mi cloud is bad both integrations will be affected. We need a proof here to move on / have the chance for further analysis.

saschachina commented 2 months ago

Please give it a try nevertheless. Imagine it's a firmware issue which only happens if the availability of the Mi cloud is bad both integrations will be affected. We need a proof here to move on / have the chance for further analysis.

Ok no problem, I setup the custom component again try if it works or not. Just give me a bit time 🙂

saschachina commented 2 months ago

Aright back again, it works with xiaomi custom component.

Bildschirmfoto 2024-08-17 um 16 36 19
saschachina commented 2 months ago

Aright back again, it works with xiaomi custom component.

Bildschirmfoto 2024-08-17 um 16 36 19

I see in HA it shows deerma.humidifier.jsq5 and in the xiaomi cloud deerma.humidifier.jsq2w what i got with "Get Mi Home device token app"

syssi commented 2 months ago

Okay. Let's summarize: You are aware of the correct device token and IP address of your device and the device does respond in general.

If you try to setup the official integration using the some token & IP the setup fails with the mentioned error above?

saschachina commented 2 months ago

Okay. Let's summarize: You are aware of the correct device token and IP address of your device and the device does respond in general.

If you try to setup the official integration using the some token & IP the setup fails with the mentioned error above?

Exactly

syssi commented 2 months ago

Do you know how to increase the log level of the underlying library (miio) to DEBUG and provide some more logs of the official component?

saschachina commented 2 months ago

Do you know how to increase the log level of the underlying library (miio) to DEBUG and provide some more logs of the official component?

Unfortunately I do not know how to do this, I have activated the debug logging in the integration. When I deactivate it, it seems to download a log. Is that what you need?

saschachina commented 2 months ago

I just discovered a warning in the logs, may helpful.

Logger: miio.miioprotocol Quelle: /usr/local/lib/python3.12/site-packages/miio/miioprotocol.py:138 Erstmals aufgetreten: 14:44:29 (1 Vorkommnisse) Zuletzt protokolliert: 14:44:29

error while reading discover results: 'token'

syssi commented 2 months ago

I will provide some more instructions later the day.

syssi commented 2 months ago

Long story short: Your device isn't supported by the official component.

Did you see this log message?

2024-08-16 17:49:49.153 ERROR (MainThread) [homeassistant.components.xiaomi_miio] Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: deerma.humidifier.jsq5

You could enable the debug log of the xiaomi_miio component and give it another try:

debug-log

But I'm pretty sure you won't have luck because it's not supported yet.

saschachina commented 2 months ago

Long story short: Your device isn't supported by the official component.

Did you see this log message?

2024-08-16 17:49:49.153 ERROR (MainThread) [homeassistant.components.xiaomi_miio] Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: deerma.humidifier.jsq5

You could enable the debug log of the xiaomi_miio component and give it another try:

debug-log

But I'm pretty sure you won't have luck because it's not supported yet.

Alright, I didn’t see a log like „unsupported device“ even i enabled the debug log.

Anyway, that means I use my device with the custom component what works but I can’t use the official integration because there is my device not supported.

arunshekher commented 1 month ago

The problem

The Xiaomi Miio integration failed to set up my Xiaomi deerma.humidifier.jsq2w model humidifier.

Error message under the Xiaomi Miio integration:

Livingroom Humidifier No devices or entities Failed setup, will retry: {'code': -5001, 'message': 'stuck'}

Screen Shot 2024-09-12 at 7 08 50 PM

What version of Home Assistant Core has the issue?

2024.9.1

What was the last working version of Home Assistant Core?

No previous version has worked since I first bought this humidifier in May 2024.

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:942
First occurred: 5:52:32 PM (8 occurrences)
Last logged: 5:59:31 PM

Update for humidifier.deerma_humidifier_jsq2w fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/xiaomi_miio_humidifier/humidifier.py", line 316, in async_update
    if self._device_features & FEATURE_SET_POWER_MODE == 1 and state.mode:
                                                               ^^^^^^^^^^
  File "/config/custom_components/xiaomi_miio_humidifier/humidifier_miot.py", line 122, in mode
    return PowerMode_V1(self.data.get("mode")).name
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/enum.py", line 1171, in __new__
    raise ve_exc
ValueError: None is not a valid PowerMode_V1
Screen Shot 2024-09-12 at 6 02 22 PM

Additional information

The attached log provided by @saschachina contains error messages stating 'Unsupported device found!' if you review it again.

Screen Shot 2024-09-12 at 7 06 49 PM

I used to encounter these messages as well until the changes in August.

Currently, the Miio integration produces a different error, which is quoted in the logs section above.