cdpuk / ha-bestway

Home Assistant integration for Bestway / Lay-Z-Spa hot tubs
MIT License
59 stars 15 forks source link

Bestway no communication since restart Homeassistant #44

Closed 1990marco1990 closed 6 months ago

1990marco1990 commented 6 months ago

Version of the custom_component

Bestway device

Provide the model of your device. A link to the Bestway product page is sometimes useful.

Describe the bug

Logs

2024-01-02 12:25:48.084 ERROR (MainThread) [custom_components.bestway.coordinator] Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://euapi.gizwits.com/app/devdata/4kk34e6xKrlo29Ma3zjxoN/latest') 2024-01-02 12:25:53.426 ERROR (MainThread) [custom_components.bestway.coordinator] Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://euapi.gizwits.com/app/devdata/4kk34e6xKrlo29Ma3zjxoN/latest') 2024-01-02 12:26:01.416 ERROR (MainThread) [custom_components.bestway.coordinator] Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError(

Add your logs here.

nickpearce95 commented 6 months ago

I am getting similar errors too:

This error originated from a custom integration.

Logger: custom_components.bestway.coordinator Source: custom_components/bestway/coordinator.py:37 Integration: Bestway (documentation, issues) First occurred: 10:03:40 (36 occurrences) Last logged: 12:52:53

Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://euapi.gizwits.com/app/devdata/88ljLZKceVICNLEI4gv9Ol/latest')

NuttyNorm commented 6 months ago

I also have an issue today, control is fine in phone app.

Error-

Logger: custom_components.bestway.coordinator Source: custom_components/bestway/coordinator.py:37 Integration: Bestway (documentation, issues) First occurred: 15:02:26 (42 occurrences) Last logged: 15:18:02

Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://euapi.gizwits.com/app/devdata/NWWV1UoInRFqygAu5k5b8Q/latest')

Clicking the link reveals this - {"error_code":9003,"detail_message":null,"error_message":"appid invalid!"}

chrisuk-web commented 6 months ago

Same here.

nickpearce95 commented 6 months ago

tried a few ideas to try and get this working. (Note this is for AirJet Plus with WiFi - https://www.bestwaystore.co.uk/2021-airjet-plus-pump.html)

Same issue occurs as before '400 - Bad Request'

no0ner commented 6 months ago

I just replaced my custom restful yaml based config with this integration because it wasn't working anymore to find out this is not working aswell. So sadly the issue seems to be a change in the API, not the integration I guess?

jozk commented 6 months ago

Hello, same here since 2nd Jan:

This error originated from a custom integration.

Logger: custom_components.bestway.coordinator Source: custom_components/bestway/coordinator.py:37 Integration: Bestway (documentation, issues) First occurred: 2 January 2024 at 15:20:39 (1360 occurrences) Last logged: 20:29:43

Data update failed Traceback (most recent call last): File "/config/custom_components/bestway/coordinator.py", line 37, in _async_update_data return await self.api.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 166, in fetch_data latest_data = await self._do_get( ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bestway/bestway/api.py", line 418, in _do_get response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://euapi.gizwits.com/app/devdata/oDGovoNbpiJpXbsBDyv23d/latest')

Maxvil30 commented 6 months ago

Same here

400 bad request

hellfire151 commented 6 months ago

I was wondering if this was an EU server API technical issue. This morning I created a new Bestway account with the region set as United States and re-added my Layzspa. In HA added a new device with the locale set as US and it works again!

This possibly suggests that the EU server will be fixed and setting up on a US as a workaround for the time being.

nickpearce95 commented 6 months ago

Thanks @hellfire151 - setting up a US account as a workaround has fixed it for me too.

cdpuk commented 6 months ago

The EU server previous allowed anonymous requests for device status updates - almost certainly an oversight, and I'd expect the US server to go the same way sooner or later. I'm about to push an update to fix the integration.

chrisuk-web commented 6 months ago

The EU server previous allowed anonymous requests for device status updates - almost certainly an oversight, and I'd expect the US server to go the same way sooner or later. I'm about to push an update to fix the integration.

Thanks for quick fix. Downloaded your updated code and my hottub back online :-) Really appreciate your work with this Integration 😀

PaulEast commented 6 months ago

Back up and running, thank you for the quick update!