home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

Steam online, API timeout and full shutdown after a period #95702

Open Mithrox opened 1 year ago

Mithrox commented 1 year ago

The problem

The last couple months (estimated) the Steam Online API integration has been working less than optimal. When you configure a set of accounts to check status on (for myself I have 25 accounts selected from my friend list), it will work okayish for a day or two, and then it will show unavailable more and more often, and over time just completely time out with a permanent unavailable.

If you leave the integration disabled for more than 24 hours, you can restart it and the cycle starts over again. I read somewhere that Steam API has 100.000 requests for day as limit, so my question he is; can we set a timer on when we check status for Steam? It would be sufficient with 1 time per minute, for a 24 hour period it would mean 36.000 API calls per day (if it require one call per account).

Last year this integration was "slower" in the sense that it had a 30 seconds update frequency, but I do think it's now quicker than 30 seconds, and maybe it should be reverted to keep the API session alive and not forcing it to timeout/close down.

What version of Home Assistant Core has the issue?

core-2023.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Steam Online

Link to integration documentation on our website

https://www.home-assistant.io/integrations/steam_online

Diagnostics information

Logger aiohttp.server.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

File "/usr/local/lib/python3.11/site-packages/steam/api.py", line 171, in download
    raise HTTPError("Server connection failed: {0} ({1})".format(reason, code))
steam.api.HTTPError: Server connection failed: Too Many Requests (429)

Logger: homeassistant.config_entries
Source: config_entries.py:429
First occurred: 12:07:45 (1 occurrences)
Last logged: 12:07:45

Config entry '<account-name>' for steam_online integration not ready yet: Server took too long to respond; Retrying in background

Additional information

No response