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

Integration doesn't start when Wibeee XML API does not respond #69

Open
joaopedros2 opened this issue Dec 13, 2023 · 9 comments
Open

Integration doesn't start when Wibeee XML API does not respond #69

joaopedros2 opened this issue Dec 13, 2023 · 9 comments
Labels
wibeee wtfs Wibeee device is hanging or returning nonsense from status.xml

Comments

@joaopedros2
Copy link

When I restart HA, the integration doesn't start, and to solve the issue, I have to reload the integration entries.

wibeee

wibeee_2

wibeee_3

LOGS

This error originated from a custom integration.

Logger: custom_components.wibeee.api
Source: custom_components/wibeee/api.py:73
Integration: wibeee (documentation, issues)
First occurred: 9:46:46 AM (28 occurrences)
Last logged: 12:36:10 PM

Error getting http://192.168.68.210/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b'AT+CIPSENDBUF=4,415'\n ^", url=URL('http://192.168.68.210/en/status.xml')
Error getting http://192.168.68.210/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b''\n ^", url=URL('http://192.168.68.210/en/status.xml')
Error getting http://192.168.68.210/en/status.xml after 3 retries: ServerDisconnectedError: Server disconnected
Error getting http://192.168.68.210/en/status.xml after 3 retries: TimeoutError:
Error getting http://192.168.68.210/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b'AT+CIPSENDBUF=4,412'\n ^", url=URL('http://192.168.68.210/en/status.xml')


Logger: homeassistant.components.sensor
Source: runner.py:188
Integration: Sensor (documentation, issues)
First occurred: 9:40:35 AM (1 occurrences)
Last logged: 9:40:35 AM

Setup of sensor platform wibeee is taking over 10 seconds.


Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:361
Integration: Sensor (documentation, issues)
First occurred: 9:40:31 AM (1 occurrences)
Last logged: 9:40:31 AM

Error while setting up wibeee platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/wibeee/sensor.py", line 207, in async_setup_entry
initial_status = await api.async_fetch_status(retries=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wibeee/api.py", line 27, in async_fetch_status
return status["response"]
~~~~~~^^^^^^^^^^^^
KeyError: 'response'

@luuuis luuuis added the wibeee wtfs Wibeee device is hanging or returning nonsense from status.xml label Dec 13, 2023
@luuuis
Copy link
Owner

luuuis commented Dec 13, 2023

Thanks for the report. I'm afraid this is caused by Wibeee not responding or responding with garbage. When this happens integration is unable to read data from the device and/or to discover what sensors to create in HA.

There are already 10 retries in place, I'm not sure that I can much more.

@luuuis
Copy link
Owner

luuuis commented Jan 15, 2024

Note to self: look at using RestoreEntity so that when the integration starts up the entities are restored (with unknown state) and available until such time as when the integration is able to fetch the new status.

@Mocheto
Copy link

Mocheto commented Jan 22, 2024

same here! sometimes don't report anything, I press the reload button and it works. But suddenly stops again. Normally if I repeat the process it works, but other times I will need press two or three times more delayed on the time until works

@diegodepablos
Copy link

same problem here

@luuuis
Copy link
Owner

luuuis commented Jan 22, 2024

The problem is known, as mentioned above. The device's HTTP API (status.xml) is notoriously unstable. It is quite solid once you configure Local Push, however.

"Me too" comments that do not add any information are not helpful, please refrain from commenting unless you have:

  • additional logs from a different case not mentioned,
  • proposed solutions,
  • a correction to make to something that's been said,
  • etc.

@diegodepablos

This comment was marked as off-topic.

@luuuis

This comment was marked as off-topic.

@Mocheto
Copy link

Mocheto commented Feb 12, 2024

first of all if my last message was considered waste i'm so sorry, I've posted +1, just for keep in track this issue and also, adding more people as affected to get more priority.

I've enabled debugging mode and I've retrieved a lot of times these logs:

`Logger: custom_components.wibeee.api
Source: custom_components/wibeee/api.py:111
Integration: wibeee (documentation, issues)
First occurred: 10:18:33 (485 occurrences)
Last logged: 13:35:02

Error getting http://192.168.0.11/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b'AT+CIPSENDBUF=4,312'\n ^", url=URL('http://192.168.0.11/en/status.xml')
Error getting http://192.168.0.11/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b''\n ^", url=URL('http://192.168.0.11/en/status.xml')
Error getting http://192.168.0.11/en/status.xml after 3 retries: ServerDisconnectedError: Server disconnected
Error getting http://192.168.0.11/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b'AT+CIPSENDBUF=4,305'\n ^", url=URL('http://192.168.0.11/en/status.xml')
Error getting http://192.168.0.11/en/status.xml after 3 retries: ClientResponseError: 400, message="Expected HTTP/:\n\n b''\n ^", url=URL('http://192.168.0.11/en/status.xml')`

Me home-assistant is a core version in docker but I already got those logs in supervisor with addons version.

the correct answer of this url is the next one:

image

but sometimes gets the other answer and the problem becomes here
image

It sound like is a timeout and don't show all response or something similiar

Can I help showing an extra info about the problem to init o keep connected the integration? I can handle it, but I need some clue to obtain that information to share with you

@luuuis
Copy link
Owner

luuuis commented Apr 2, 2024

Thanks @Mocheto but there is no further information required because the problem is well known. It's the same underlying cause as #52: Wibeee device returns garbage sometimes.

The only thing to do is work around the problem, if possible (using RestoreEntity or another approach to be determined).

@luuuis luuuis changed the title Sometimes the integration doesn't start Integration doesn't start when Wibeee XML API does not respond Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wibeee wtfs Wibeee device is hanging or returning nonsense from status.xml
Projects
None yet
Development

No branches or pull requests

4 participants