albertogeniola / meross-homeassistant

Custom component that leverages the Meross IoT library to integrate with Homeassistant
MIT License
687 stars 76 forks source link

Error connecting to local broker #470

Closed deevus closed 7 months ago

deevus commented 8 months ago

Describe the bug An error occurs trying to configure a new device

image

Your environment HomeAssistant version: 2023.11.0 Hassio Version (if applicable): 11.1 Hardware environment:

Logs taken when the issue happened

2023-11-04 02:52:41.266923499 INFO:127.0.0.1 - - [04/Nov/2023 13:52:41] " POST /v1/Auth/signIn HTTP/1.0 " 500 -
2023-11-04 02:52:41.265981750 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-11-04 02:52:41.265977983 raise NotFound()
2023-11-04 02:52:41.265975378 File "/usr/local/lib/python3.7/dist-packages/werkzeug/routing.py", line 2047, in match
2023-11-04 02:52:41.265972242 result = self.url_adapter.match(return_rule=True) # type: ignore
2023-11-04 02:52:41.265969256 File "/usr/local/lib/python3.7/dist-packages/flask/ctx.py", line 397, in match_request
2023-11-04 02:52:41.265966110 raise request.routing_exception # type: ignore
2023-11-04 02:52:41.265963234 File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1481, in raise_routing_exception
2023-11-04 02:52:41.265959838 self.raise_routing_exception(req)
2023-11-04 02:52:41.265956892 File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
2023-11-04 02:52:41.265953245 rv = self.dispatch_request()
2023-11-04 02:52:41.265950190 File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1523, in full_dispatch_request
2023-11-04 02:52:41.265946212 Traceback (most recent call last):
2023-11-04 02:52:41.265940260 ERROR:Uncaught exception: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. 
deevus commented 8 months ago

Would the fact that I didn't enter a valid email address be causing this?

EDIT: I did a re-init and used an email address. Same problem

deevus commented 8 months ago

More info from another attempt but from HA logs


Logger: custom_components.meross_cloud.config_flow
Source: custom_components/meross_cloud/config_flow.py:271
Integration: Meross Cloud IoT
First occurred: 1:29:06 PM (27 occurrences)
Last logged: 3:03:33 PM
Unable to connect to Meross HTTP api, ex: Failed request to API. Response code: 500

Traceback (most recent call last):
  File "/config/custom_components/meross_cloud/config_flow.py", line 271, in async_step_configure_manager
    creds = await self._test_authorization(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/config_flow.py", line 360, in _test_authorization
    client = await MerossHttpClient.async_from_user_password(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/meross_iot/http_api.py", line 117, in async_from_user_password
    creds = await cls.async_login(email=email,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/meross_iot/http_api.py", line 246, in async_login
    response_data = await MerossHttpClient._async_authenticated_post(url=url,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/meross_iot/http_api.py", line 342, in _async_authenticated_post
    raise AuthenticatedPostException("Failed request to API. Response code: %s" % str(response.status))
meross_iot.model.http.exception.AuthenticatedPostException: Failed request to API. Response code: 500
deevus commented 7 months ago

This is working with the new version