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

[BUG] Requests are blocked for xx seconds #362

Open
smarthomedesign opened this issue Sep 23, 2024 · 22 comments
Open

[BUG] Requests are blocked for xx seconds #362

smarthomedesign opened this issue Sep 23, 2024 · 22 comments
Assignees
Labels
bug Something isn't working

Comments

@smarthomedesign
Copy link

First of all please check my wikipage: https://github.com/fustom/ariston-remotethermo-home-assistant-v3/wiki and the previous issues (included the closed ones) before you create a new one.

Describe the bug
I m getting blocked by api because of an error

Expected behavior

Screenshots
This error originated from a custom integration.
Logger: custom_components.ariston.coordinator
Source: helpers/update_coordinator.py:312
integration: Ariston (documentation, issues)
First occurred: September 23, 2024 at 3:37:24 PM (130 occurrences)
Last logged: 12:11:37 AM

Unexpected error fetching ariston-WaterHeater-coordinator data
Unexpected error fetching ariston-WaterHeater-bus_errors_coordinator data
Unexpected error fetching ariston-WaterHeater-energy_coordinator data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/ariston/galevo_device.py", line 105, in async_update_state
(self.data, self.menu_items) = await asyncio.gather(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/ariston/ariston_api.py", line 637, in async_get_menu_items
items = await self._async_get(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/ariston/ariston_api.py", line 930, in _async_get
return await self.__async_request("GET", path, params, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/ariston/ariston_api.py", line 906, in __async_request
raise Exception(response.status, content)
Exception: (429, b'Requests are blocked for 66 seconds')

Environment (please complete the following information):

  • HA version: 2024.6.3
  • Version of the integration: 0.19.5
  • Ariston device type (check the integration Device info): Ariston Clas One WiFI

Additional context, debug log
Add any other context about the problem here.

@smarthomedesign smarthomedesign added the bug Something isn't working label Sep 23, 2024
@ZsBT
Copy link

ZsBT commented Sep 25, 2024

429, b'Requests are blocked for 66 seconds' - Ariston has blocked your IP address as they limit the request rate.
Already discussed: #332

@ilgio
Copy link

ilgio commented Oct 3, 2024

ariston answered me like this:

Gentile utente,

il problema è causato dall'utilizzo delle API per un software di terze parti. E' necessario evitare di utilizzarlo.

Cordialmente,

Support TEam

@Oneshotblu
Copy link

Same problem here ilgio.. did you find any solution? Also the mobile app is not working..

Ho lo stesso problema.. ma anche l'app da cellualare non va nonotante abbia disattivapo l'integrazione da giorni, ancora non si collega.

@ilgio
Copy link

ilgio commented Oct 13, 2024

turn off the boiler for an hour, then turn it back on

@ilgio
Copy link

ilgio commented Oct 14, 2024

Screenshot 2024-10-14 alle 13 54 23

@ilgio
Copy link

ilgio commented Oct 14, 2024

from what I understand it seems that they can see that the bees are requested by an unauthorized APP,
the authorized ones are apple homekit, google home and amazon alexa.
I tried to disable the integration for a week and then reactivate it with 400/60/800, the ariston app on the phone works, but the integration continues to skip
Screenshot 2024-10-14 alle 17 01 31

@volkans80
Copy link

Same problem. remote thermo web page is working but mobile app and homeassistant integration not working.

@tanganellilore
Copy link
Contributor

tanganellilore commented Nov 5, 2024

Someone try to use some specific user-agent o python request to "emulate" a browser o similar?

Probably in that way we can avoid to have ip blocked for non standard user agent.
(with python request is very easy to implementat it)

@shvirik
Copy link

shvirik commented Nov 9, 2024

Same (from Spain).
Failure date: 8 Nov 2024 (midnight)

@Meister1977
Copy link

I think, this issue should be raised to Ariston, becaus if they start to decline Home Assistant, then I will never buy again Ariston products.

@tanganellilore
Copy link
Contributor

Aristo not support today and will not support home Assistant, as already shared in all reply email present in this issue and other.
The only way to avoid 'ban' of ip is PR approve some third part application from ariston side or emulate the traffic create by website or google/home kit.

@jmlt
Copy link

jmlt commented Nov 10, 2024

Same (from Spain). Failure date: 8 Nov 2024 (midnight)

same here (portugal). My ariston app also says "device online but cannot retrieve info"

Edit: Ariston support was useless but I managed to get it working, I disabled ariston integration on HA, unplugged my Velis wifi from the wall, waited all night, turned on this morning, activated the integration and it's now working normally.

I belive my ip was indeed blocked due too many requests.

@santibolin
Copy link

It is not a blocked IP, it seems that it is a user block because if you change your public IP it does not work. You must stop the HA integration for a while and then start it again. I bought Ariston because I could integrate with HA but it is not compatible with Ariston... The support has a prototype answer... "only with official APP, Google, Alexa..."

@tanganellilore
Copy link
Contributor

If i change my ip at home and stop the integration, all thing Return to works as expected.

Now I'm testing a "custom" user agent inside the python library used by thin integration, manually change the python conde.
If all works, i will propose a PR on the library to allow us to use custom user agent and also a PR on this library to integrate the usage of custom user agent.

@tanganellilore
Copy link
Contributor

Changed user-agent locally into python library (with browser user agent) fix the issue on my home.
O error in last 2 weeks with 300 - 60 - 2400 settings

@nevadascout
Copy link

@tanganellilore Thanks for making that available to us all. What custom user agent did you use? Just some random string?

@tanganellilore
Copy link
Contributor

tanganellilore commented Jan 22, 2025

Hi @nevadascout,
One of the most recent browser, just to emulate it.
In that way we emulate a browser call so you should not be blocked.
Tested for 2 month and any block from my public ip (energy update every 60 minutes, thermostat update every 300 sec).

I want to reduce the seconds but is enought to me those infor

@Oneshotblu
Copy link

Oneshotblu commented Jan 22, 2025

Dear, GRAZIE!

At first thank you for making this possible.
I updated to latest 0.19.7 can you kindly give us more details about what we have to do exactly to "change the user agent"?

I found this section in const.py

DOMAIN: Final[str] = "ariston"
NAME: Final[str] = "Ariston"
COORDINATOR: Final[str] = "coordinator"
ENERGY_COORDINATOR: Final[str] = "energy_coordinator"
ENERGY_SCAN_INTERVAL: Final[str] = "energy_scan_interval"
BUS_ERRORS_COORDINATOR: Final[str] = "bus_errors_coordinator"
BUS_ERRORS_SCAN_INTERVAL: Final[str] = "bus_errors_scan_interval"
API_URL_SETTING: Final[str] = "api_url_setting"
API_USER_AGENT: Final[str] = "api_user_agent"

DEFAULT_SCAN_INTERVAL_SECONDS: Final[int] = 300
DEFAULT_ENERGY_SCAN_INTERVAL_MINUTES: Final[int] = 30
DEFAULT_BUS_ERRORS_SCAN_INTERVAL_SECONDS: Final[int] = 600

Should I change this line -> API_USER_AGENT: Final[str] = "api_user_agent" ?
If yes, how should I update it? (let's consider Chrome browser in case..)

Last but not least, are these scan / energy / errors scan intervals ok if set to 300 / 30 / 600 ?

Thank you again
Best Regards

@tanganellilore
Copy link
Contributor

@Oneshotblu reconfifuring integration will prompt you the Username, password and user agent. So change it from the form.

For params i used 300/60/2400 (no much important to me the error bus info).

@Oneshotblu
Copy link

@tanganellilore Thank you very much. it works now. Saluti

@Oneshotblu
Copy link

Good morning, I'm still stuck here. Despite having configured a browser as the agent and set the request interval parameters as suggested, the integration has stopped working. Even during the two days it was functioning, the data flow was choppy.
Am I perhaps doing something wrong? Thank you

Image

Image

Image

@tanganellilore
Copy link
Contributor

Hi,
Chirme is not a valid user agent.
You should use something like:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36

Use this site to retrieve your user agent: https://user-agent-generator-220418.netlify.app/
Or search in Google a site that generate user agent correctly.

Moreover, che ha logs, to see ifrequest go in timeout.
Remeber, if you have public ip address Thi solution can works well (also dynamic public ip). If you are under cgnat (so you have a private ip address and public is shared between other people) probably this will not solve your issue, because ariston not understand that 90% of internet connection (at least in Italy) now are behind cgnat.

This is a real problem that ariston don't wont resolve and this is why the Force us to use app, homekit or webapp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests