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

Auto discovery setup not working (?) #22

Closed
maxime1992 opened this issue Aug 29, 2023 · 11 comments
Closed

Auto discovery setup not working (?) #22

maxime1992 opened this issue Aug 29, 2023 · 11 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@maxime1992
Copy link

Hello,

thanks for maintaining this fork!

I was trying to setup a device using the auto discovery but it doesn't seem to be working.

image

image

image

image

Looking at the logs:

image

Should I try to add manually or is there an issue with the auto setup?

Thanks

@mill1000
Copy link
Owner

Hi,

Does this issue persist if you try the auto config again?

I've seen this error before and thought it was just a transient error but another user has reported it too: mill1000/midea-msmart/issues/38

So looks like I've got a real problem to solve.

@mill1000 mill1000 self-assigned this Aug 29, 2023
@mill1000 mill1000 added the bug Something isn't working label Aug 29, 2023
@mill1000
Copy link
Owner

I think I've got a fix in the underlying library (mill1000/midea-msmart/pull/39). Once it's confirmed I'll generate a new release.

@mill1000
Copy link
Owner

Try the latest release (2023.9.1) and let me know if you still have problems.

@maxime1992
Copy link
Author

Hey, thanks for the quick reply!

Unfortunately there's now an error:

image

Logger: msmart.base_device
Source: lsiopy/lib/python3.11/site-packages/msmart/base_device.py:40
First occurred: 10:25:31 (2 occurrences)
Last logged: 10:26:43

Authentication failed. Error: Error packet received.
Logger: aiohttp.server
Source: lsiopy/lib/python3.11/site-packages/msmart/base_device.py:29
First occurred: 10:25:33 (2 occurrences)
Last logged: 10:26:45

Error handling request
Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/config/config_entries.py", line 181, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/data_entry_flow.py", line 296, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/data_entry_flow.py", line 392, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/midea_ac/config_flow.py", line 91, in async_step_pick_device
    if await Discover.connect(device):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/lsiopy/lib/python3.11/site-packages/msmart/discover.py", line 413, in connect
    await dev.refresh()
  File "/config/lsiopy/lib/python3.11/site-packages/msmart/base_device.py", line 29, in refresh
    raise NotImplementedError()
NotImplementedError

@mill1000
Copy link
Owner

mill1000 commented Aug 30, 2023

No problem. Glad to help!

Logger: msmart.base_device
Source: lsiopy/lib/python3.11/site-packages/msmart/base_device.py:40
First occurred: 10:25:31 (2 occurrences)
Last logged: 10:26:43

Authentication failed. Error: Error packet received.

This can actually be ignored. There's a bit of code that has to authenticate by trial and error. I'll work on suppressing this expected error.

File "/config/custom_components/midea_ac/config_flow.py", line 91, in async_step_pick_device
if await Discover.connect(device):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/lsiopy/lib/python3.11/site-packages/msmart/discover.py", line 413, in connect
await dev.refresh()
File "/config/lsiopy/lib/python3.11/site-packages/msmart/base_device.py", line 29, in refresh
raise NotImplementedError()
NotImplementedError

I'm guessing you have other devices besides air conditioners on your network, and I'm not handling that gracefully. EDIT: Clearly I can see that there's only one device found. It must be of a different "type" than this integration currently supports. Could you run midea-discover -d from a shell and supply that output here?

Thanks for your patience with these errors, nothing ever goes as easily as one would hope.

@maxime1992
Copy link
Author

Could you run midea-discover -d from a shell and supply that output here?

Do you have a docker somewhere ready where I could easily launch this?

@mill1000
Copy link
Owner

I don't, but that's a great idea so I'll work on one.

Based on your screenshots you appear to have a device of type "A1”, which I gather is a dehumidifier not an air conditioner. Is this correct?

@mill1000
Copy link
Owner

I'm going to hazard a guess and say your device is likely not supported.

FWIW, here's a docker image you can run midea-discover with:

docker run --network=host ghcr.io/mill1000/msmart-ng:edge -d

@maxime1992
Copy link
Author

Based on your screenshots you appear to have a device of type "A1”, which I gather is a dehumidifier not an air conditioner. Is this correct?

Correct.

docker run --network=host ghcr.io/mill1000/msmart-ng:edge -d

 ~  docker run --network=host ghcr.io/mill1000/msmart-ng:edge -d            ✔
DEBUG:asyncio:Using selector: EpollSelector
INFO:msmart.cli:msmart version: 2023.9.2.dev23+ga4f2b4d.d20230901
INFO:msmart.cli:Only supports AC devices. Only supports MSmartHome and 美的美居.
DEBUG:msmart.discover:Discovery sent to 255.255.255.255:6445.
DEBUG:msmart.discover:Discovery sent to 255.255.255.255:20086.
DEBUG:msmart.discover:Waiting 5 seconds for responses...
DEBUG:msmart.discover:Discovered 0 devices.
ERROR:msmart.cli:No devices found.

@mill1000
Copy link
Owner

mill1000 commented Sep 2, 2023

Ah well unfortunately this integration doesn't support dehumidifiers. You can try manual configuration and it might work but I suspect the message formats will differ.

You can try either of these integrations
https://github.com/georgezhao2010/midea_ac_lan/
https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan

@mill1000 mill1000 added wontfix This will not be worked on and removed bug Something isn't working labels Sep 2, 2023
@mill1000
Copy link
Owner

mill1000 commented Sep 2, 2023

I'm going to close this issue as I don't have plans to support dehumidifiers at this time. Best of luck!

@mill1000 mill1000 closed this as completed Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants