vincentwolsink / home_assistant_micronova_agua_iot

Home Assistant integration controlling heating devices connected via the Agua IOT platform of Micronova
Apache License 2.0
27 stars 15 forks source link

Failed to login - Piazzetta #55

Closed Donder24 closed 11 months ago

Donder24 commented 11 months ago

Hello,

Is it just me or are there other people who are not able to login anymore. I'm having a Piazzetta stove.

This is the log in HA when trying to add the integration.

afbeelding

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 16:14:20 (1 occurrences)
Last logged: 16:14:20

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/config_flow.py", line 87, in async_step_user
    await agua.connect()
  File "/config/custom_components/aguaiot/aguaiot.py", line 119, in connect
    await self.login()
  File "/config/custom_components/aguaiot/aguaiot.py", line 204, in login
    self.token = res["token"]
                 ~~~^^^^^^^^^
KeyError: 'token'
Moeros commented 11 months ago

Hi,

maybe somebody can help me. I,ve got the same problem, but i don't where the problem is. I know my username and password is correct. I tried different configurations.

Bild1 Bild2

Home Assistant 2023.10.2 Supervisor 2023.10.0 Operating System 10.5 Frontend 20231005.0 - latest Micronova Agua IOT v0.1.8

And I have a Piazzetta. Maybe the mistake is mine.

Thank you for your help.

bcornelissen1 commented 11 months ago

Same for me since this morning. Turning on debug log and starting the Micronova Agua IOT integration tells me my credentials are incorrect, but same credentials still work with the MyPiazetta app for controlling the Piazetta pellet stove.

2023-10-13 22:40:30.525 ERROR (MainThread) [custom_components.aguaiot] Wrong credentials for Agua IOT

eternalpolo commented 11 months ago

Hi,

I've install the upgrade just now but i've the same error: Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot Source: custom_components/aguaiot/init.py:82 Integration: Micronova Agua IOT (documentation, issues) First occurred: 10:04:31 (3 occurrences) Last logged: 10:17:15

Agua IOT Unauthorized: Failed to login, please check credentials

vincentwolsink commented 11 months ago

This seems an issue isolated to Piazetta. Maybe they changed something on their environment. Was there an Piazetta app update for mobile recently?

eternalpolo commented 11 months ago

This seems an issue isolated to Piazetta. Maybe they changed something on their environment. Was there an Piazetta app update for mobile recently?

Hi,

Last update of the app is the 08/31/2023. In my case, i had no problem with the previous stable version. Only since the upgrade to 0.2.0 this morning

vincentwolsink commented 11 months ago

Please install v0.2.1-beta1 and check the home assistant errors logs. There should be the response from the Piazetta API.

eternalpolo commented 11 months ago

Please install v0.2.1-beta1 and check the home assistant errors logs. There should be the response from the Piazetta API.

I've install the beta. In my logs i see: `Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot.aguaiot Source: custom_components/aguaiot/aguaiot.py:206 Integration: Micronova Agua IOT (documentation, issues) First occurred: 20:47:34 (3 occurrences) Last logged: 21:11:10

Failed to login. Code: 500, Response:`

and:

`Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot Source: custom_components/aguaiot/init.py:82 Integration: Micronova Agua IOT (documentation, issues) First occurred: 20:47:34 (3 occurrences) Last logged: 21:11:10

Agua IOT Unauthorized: Failed to login, please check credentials`

Moeros commented 11 months ago

Bildschirmfoto vom 2023-10-15 00-23-47

The configuration "program version" I tried 2.0.0 and 2.1.0

Log Viewer: 2023-10-15 00:20:34.363 ERROR (MainThread) [custom_components.aguaiot.aguaiot] Failed to login. Code: 500, Response:

I checked my password and username again and they are correct

vincentwolsink commented 11 months ago

Piazetta must have changed something to their custom login mechanism. It also stopped working with the older (v0.1.8) version. Sadly their login does not report any error, but just an empty response.

Trying to figure out what is happening, but since everything is closed source, it will take some time. If someone is good a decompiling android apps, help is appreciated.

jipem01 commented 11 months ago

Does somebody tried without indicating the login URL?

vincentwolsink commented 11 months ago

I created a Piazetta account (although I don’t have the stove) and did some testing. Couldn’t get it to work yet.

eternalpolo commented 11 months ago

Does somebody tried without indicating the login URL?

I've tried but not works better.

`Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot.aguaiot Source: custom_components/aguaiot/aguaiot.py:206 Integration: Micronova Agua IOT (documentation, issues) First occurred: 14 octobre 2023 à 20:47:34 (7 occurrences) Last logged: 13:24:00

Failed to login. Code: 500, Response: Failed to login. Code: 404, Response: {"Success":false,"Error":"1103","Text":"LOGIN_USER_NOT_FOUND"}`

Donder24 commented 11 months ago

Piazetta must have changed something to their custom login mechanism. It also stopped working with the older (v0.1.8) version. Sadly their login does not report any error, but just an empty response.

Trying to figure out what is happening, but since everything is closed source, it will take some time. If someone is good a decompiling android apps, help is appreciated.

App version is 1.9.5 since 31/8 ( also day of breakdown) The response is also empty here.

`Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.aguaiot.aguaiot Source: custom_components/aguaiot/aguaiot.py:209 Integration: aguaiot (documentation, issues) First occurred: 14:01:11 (15 occurrences) Last logged: 14:11:53

Failed to login. Code: 500, Response: Failed to login. Code: 404, Response: {"Success":false,"Error":"1103","Text":"LOGIN_USER_NOT_FOUND"}`

Does somebody tried without indicating the login URL?

Yes, I did, negative

vincentwolsink commented 11 months ago

Found a possible fix: #61

vincentwolsink commented 11 months ago

Please try v0.2.1-beta3 and make sure that Application version in the configuration is set to 1.9.5 (or at least higher than 1.9.0)

Donder24 commented 11 months ago

Problem solved! Vincent, you're the best! Thanks a lot!

dennibulgarelli commented 11 months ago

AMAZING. it works.

robkrause commented 11 months ago

Same changes make the homebridge plugin work again, thanks so much. I assumed these headers were optional and therefor didn't even consider adding them