vincentwolsink / home_assistant_micronova_agua_iot

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

Connection error #67

Closed marc-cizeron closed 9 months ago

marc-cizeron commented 9 months ago

Hi, since version 0.2.2, I've had a lot of errors. Here are some logs:

Logger: homeassistant.helpers.script.aguaiot_switch
Source: helpers/script.py:468
First occurred: 09:11:46 (1 occurrences)
Last logged: 09:11:46

aguaiot_switch: Error executing script. Unexpected error for call_service at pos 1: name 'item' is not defined
Traceback (most recent call last):
  File "/config/custom_components/aguaiot/aguaiot.py", line 561, in set_register_value
    await self.__request_writing(key, values)
  File "/config/custom_components/aguaiot/aguaiot.py", line 489, in __request_writing
    raise AguaIOTError("Error while request device writing")
custom_components.aguaiot.aguaiot.AguaIOTError: Error while request device writing

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/aguaiot/climate.py", line 174, in async_turn_off
    await self._device.set_register_value_description(
  File "/config/custom_components/aguaiot/aguaiot.py", line 574, in set_register_value_description
    await self.set_register_value(key, value)
  File "/config/custom_components/aguaiot/aguaiot.py", line 563, in set_register_value
    raise AguaIOTError(f"Error while trying to set: {item}")
                                                     ^^^^
NameError: name 'item' is not defined

I actually get this error a lot.

vincentwolsink commented 9 months ago

Hi, there should also be an error log entry that starts with Webcall failed.. Can you please post that one too?

marc-cizeron commented 9 months ago

hmmm, in settings > systems > logs i didn't have any Webcall Failled.

Ha wait, may be it is this one:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/__init__.py", line 94, in async_update_data
    await agua.update()
  File "/config/custom_components/aguaiot/aguaiot.py", line 291, in update
    await dev.update()
  File "/config/custom_components/aguaiot/aguaiot.py", line 366, in update
    await self.__update_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 399, in __update_device_information
    res = await self.__aguaiot.handle_webcall("POST", url, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 304, in handle_webcall
    response = await client.post(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1848, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: All connection attempts failed
vincentwolsink commented 9 months ago

This basically means that the integration cannot connect to the API. Which brand stove do you have?

marc-cizeron commented 9 months ago

Hi, it is a jolly mec chrissie. I upgraded to 0.2.4 this morning. I don't see any error when reloading the integration. So, you can close this issue.

May be it was related to the issue #50.

vincentwolsink commented 9 months ago

There were several reports about connection issues, all involving jolly mec. It seems they have some backend issues lately.