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

0.6 beta errors after adding integration #33

Closed
u20p17 opened this issue Jan 20, 2022 · 17 comments
Closed

0.6 beta errors after adding integration #33

u20p17 opened this issue Jan 20, 2022 · 17 comments
Labels
bug Something isn't working

Comments

@u20p17
Copy link

u20p17 commented Jan 20, 2022

Version of the custom_component:

0.6 beta

Configuration

Describe the bug

Updated to 0.6 beta, restarted HA. Then removed the integration and added it again. After another restart I get the two errors. If I open the Konfigration of this integration it looks like this:
image

Debug log

Logger: homeassistant.config_entries
Source: custom_components/midea_dehumidifier_lan/hub.py:345
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 22:29:44 (1 occurrences)
Last logged: 22:29:44

Error setting up entry Midea Air Appliance for midea_dehumidifier_lan
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/midea_dehumidifier_lan/init.py", line 63, in async_setup_entry
await hub.async_setup()
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 449, in async_setup
await self._setup_discovery()
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 400, in _setup_discovery
self.discovery_helper.setup(self.data)
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 345, in setup
if device[CONF_DISCOVERY] != DISCOVERY_LAN:
KeyError: 'discovery'

Logger: custom_components.midea_dehumidifier_lan.hub
Source: custom_components/midea_dehumidifier_lan/api.py:52
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 22:29:44 (1 occurrences)
Last logged: 22:29:44

Error while setting appliance id=18691697883547 sn=000000P0000000Q1A0681CAD4B810000 ip=192.168.0.106: Missing cloud credentials
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 514, in _process_appliance
appliance = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/midea_dehumidifier_lan/api.py", line 52, in appliance_state
return midea_beautiful_api.appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/init.py", line 130, in appliance_state
return get_appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 943, in get_appliance_state
raise MideaError("Missing cloud credentials")
midea_beautiful.exceptions.MideaError: Missing cloud credentials

@nbogojevic
Copy link
Owner

hello @u20p17, do you have any other Midea devices on the network (e.g. air conditioner, fan)?

Meanwhile, I have updated v0.6.0-beta with some code which might try to solve the issue. Use same installation method as explained in #32

@nbogojevic nbogojevic added this to the v0.6 milestone Jan 22, 2022
@nbogojevic nbogojevic added the bug Something isn't working label Jan 22, 2022
@u20p17
Copy link
Author

u20p17 commented Jan 22, 2022

Hi,
no I only have one dehumidifier in my network.

I redownloaded an installed the custom component und after restart I get only one error again:

Logger: custom_components.midea_dehumidifier_lan.hub
Source: custom_components/midea_dehumidifier_lan/api.py:52
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 07:58:34 (4 occurrences)
Last logged: 07:59:09

Error while setting appliance id=18691697883547 sn=000000P0000000Q1A0681CAD4B810000 ip=192.168.0.106: Missing cloud credentials
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 515, in _process_appliance
appliance = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/midea_dehumidifier_lan/api.py", line 52, in appliance_state
return midea_beautiful_api.appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/init.py", line 130, in appliance_state
return get_appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 943, in get_appliance_state
raise MideaError("Missing cloud credentials")
midea_beautiful.exceptions.MideaError: Missing cloud credentials

Then I tried to delete the device and add it again in HA (so again log in with my cloud credentiald) and got again the same error.

BR

@nbogojevic
Copy link
Owner

I've published new release which should output more information on when this error occurs. I'm still at loss, as to why that happens in your installation. Could you retry with a re-install?

@u20p17
Copy link
Author

u20p17 commented Jan 22, 2022

Thanks for your effort! :)

Logger: homeassistant.config_entries
Source: custom_components/midea_dehumidifier_lan/hub.py:93
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 00:31:53 (1 occurrences)
Last logged: 00:31:53

Error setting up entry Midea Air Appliance for midea_dehumidifier_lan
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 540, in _process_appliance
redacted_conf(device),
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 93, in redacted_conf
if conf[CONF_USERNAME]:
KeyError: 'username'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/midea_dehumidifier_lan/init.py", line 63, in async_setup_entry
await hub.async_setup()
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 459, in async_setup
await self._process_appliance(device)
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 559, in _process_appliance
redacted_conf(device),
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 93, in redacted_conf
if conf[CONF_USERNAME]:
KeyError: 'username'

@nbogojevic
Copy link
Owner

😭 that was bug in bug... but at least got some info.

Updated with new version that should log things correctly. Thank you for testing, could you redownload again?

@u20p17
Copy link
Author

u20p17 commented Jan 22, 2022

I can not see the beta at the moment :(

DBCD8DDD-853D-4C79-A08B-F752A930490A

@nbogojevic
Copy link
Owner

I've republished it - seems it passed to draft instead beta.

@u20p17
Copy link
Author

u20p17 commented Jan 23, 2022

okay, up to now I only see the 0.5 for download - will try tomorrow again (Y)

@u20p17
Copy link
Author

u20p17 commented Jan 23, 2022

noe i was able to download 0.6 beta again. here is the log file:

Logger: homeassistant.config_entries
Source: custom_components/midea_dehumidifier_lan/hub.py:96
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 08:25:48 (1 occurrences)
Last logged: 08:25:48

Error setting up entry Midea Air Appliance for midea_dehumidifier_lan
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 541, in _process_appliance
redacted_conf(self.data),
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 96, in redacted_conf
conf[CONF_USERNAME][0] = old_username[0]
TypeError: 'str' object does not support item assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/midea_dehumidifier_lan/init.py", line 63, in async_setup_entry
await hub.async_setup()
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 459, in async_setup
await self._process_appliance(device)
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 560, in _process_appliance
redacted_conf(self.data),
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 96, in redacted_conf
conf[CONF_USERNAME][0] = old_username[0]
TypeError: 'str' object does not support item assignment

@nbogojevic
Copy link
Owner

I was too fast in writing code that scrubs credentials from logs.

I've added now some unit tests to check it before committing. Thanks a lot for testing. New beta should be better hopefully.

@u20p17
Copy link
Author

u20p17 commented Jan 23, 2022

Hi,
no problem - just let me know when the new beta is available for testing! And thank you very much for your efforts 👍

@nbogojevic
Copy link
Owner

nbogojevic commented Jan 23, 2022

I've published it. Should be showing now.

@u20p17
Copy link
Author

u20p17 commented Jan 23, 2022

Logger: custom_components.midea_dehumidifier_lan.hub
Source: custom_components/midea_dehumidifier_lan/hub.py:535
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 11:44:21 (5 occurrences)
Last logged: 11:45:46

Missing ip_address and cloud discovery not used: {'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '43D158934D9244E4B9FAF43129DDA84B5F7176CDFD6E4D448C312185674XXXX', 'token': '49F5465A220D85F8D3F15D2262143527F8F292F40772FCE78D8C6B15B7176818657EFCFED157B1140FF88032C135FCF324600BE832DAA6DF0BC71XXXXXXXXXXX', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}.Will fall-back to cloud discovery, full configuration {'username': '', 'password': '', 'appkey': '3742e9e5842d4ad59c2db887e1XXXXX', 'appid': 1017, 'broadcast_address': [], 'scan_interval': 15, 'include': ['0xa1'], 'devices': [{'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}]}
Missing ip_address and cloud discovery not used: {'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '
', 'token': '***********************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}.Will fall-back to cloud discovery, full configuration {'username': '', 'password': '', 'appkey': '3742e9e5842d4ad59c2db887e12XXXXX', 'appid': 1017, 'broadcast_address': [], 'scan_interval': 15, 'include': ['0xa1'], 'devices': [{'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '*************************************************', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}]}

Logger: custom_components.midea_dehumidifier_lan.hub
Source: custom_components/midea_dehumidifier_lan/api.py:52
Integration: Midea Air Appliances (LAN) (documentation, issues)
First occurred: 11:44:21 (5 occurrences)
Last logged: 11:45:46

Error while setting appliance {'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '43D158934D9244E4B9FAF43129DDA84B5F7176CDFD6E4D448C312185674XXXXX', 'token': '49F5465A220D85F8D3F15D2262143527F8F292F40772FCE78D8C6B15B7176818657EFCFED157B1140FF88032C135FCF324600BE832DAA6DF0BC71XXXXXXXXXXX', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}, full configuration {'username': '', 'password': '', 'appkey': '3742e9e5842d4ad59c2db887e12XXXXX', 'appid': 1017, 'broadcast_address': [], 'scan_interval': 15, 'include': ['0xa1'], 'devices': [{'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}]}, cause Missing cloud credentials
Error while setting appliance {'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '
', 'token': '***********************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}, full configuration {'username': '', 'password': '', 'appkey': '3742e9e5842d4ad59c2db887e12XXXXX', 'appid': 1017, 'broadcast_address': [], 'scan_interval': 15, 'include': ['0xa1'], 'devices': [{'api_version': 3, 'id': '186916978XXXXX', 'ip_address': '192.168.0.106', 'name': 'Luftentfeuchter', 'token_key': '*************************************************', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A0681CAD4B8XXXXX'}]}, cause Missing cloud credentials
Traceback (most recent call last):
File "/config/custom_components/midea_dehumidifier_lan/hub.py", line 542, in _process_appliance
appliance = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/midea_dehumidifier_lan/api.py", line 52, in appliance_state
return midea_beautiful_api.appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/init.py", line 130, in appliance_state
return get_appliance_state(
File "/usr/local/lib/python3.9/site-packages/midea_beautiful/lan.py", line 943, in get_appliance_state
raise MideaError("Missing cloud credentials")
midea_beautiful.exceptions.MideaError: Missing cloud credentials

@nbogojevic
Copy link
Owner

Thanks, I think I can try to reproduce it locally.

@nbogojevic
Copy link
Owner

hello @u20p17 I've updated beta with hopefully fix this time.

If it works, you should see something like this in logs:

2022-01-23 16:17:18 WARNING (MainThread) [custom_components.midea_dehumidifier_lan.hub] Updated discovery mode for device {'api_version': 3, 'id': '3141592653****', 'ip_address': '192.0.2.1', 'name': 'Midea', 'token_key': '****************************************************************', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1A2A3A4A5A********', 'discovery': 'LAN'}.

@u20p17
Copy link
Author

u20p17 commented Jan 23, 2022

Hi, with the latest version i am able to add the humidifier to HA. So it seems that you fixed the bug 👍

i get one another error which seems to be related to this custom component:

Logger: pyhap.characteristic
Source: /usr/local/lib/python3.9/site-packages/pyhap/characteristic.py:210
First occurred: 18:00:18 (1 occurrences)
Last logged: 18:00:18

TargetHumidifierDehumidifierState: value=0 is an invalid value.

@nbogojevic
Copy link
Owner

Thanks @u20p17 , good news.

Regarding error you've seen, that is a bug in HomeKit libary more info in #16 - can't fix it on my side. It should be fixed in one of upcoming releases of Home Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants