11# Troubleshooting
22
3- ## Cloud vs local connectivity
4-
5- - Cloud servers require internet access and valid vendor credentials.
6- - Local servers require direct access to the gateway on your LAN.
7-
8- ## SSL and .local hostnames
9-
10- If the gateway uses a self-signed certificate, pass ` verify_ssl=False ` when creating ` OverkizClient ` for local access.
11-
123## Authentication failures
134
14- - Confirm the server matches your vendor region.
5+ - Confirm the server matches your vendor and region.
156- Re-run ` login() ` and retry the call.
7+ - On ` NotAuthenticatedError ` , re-authenticate before retrying.
168
179## Rate limits and concurrency
1810
1911- Reduce polling frequency.
2012- Back off on ` TooManyRequestsError ` or ` TooManyConcurrentRequestsError ` .
13+ - Use short, jittered delays for transient errors.
14+
15+ ``` python
16+ import asyncio
17+
18+ from pyoverkiz.auth.credentials import UsernamePasswordCredentials
19+ from pyoverkiz.client import OverkizClient
20+ from pyoverkiz.enums import Server
21+ from pyoverkiz.exceptions import (
22+ NotAuthenticatedError,
23+ TooManyConcurrentRequestsError,
24+ TooManyRequestsError,
25+ )
26+
27+
28+ async def fetch_devices_with_retry () -> None :
29+ async with OverkizClient(
30+ server = Server.SOMFY_EUROPE ,
31+ credentials = UsernamePasswordCredentials(" you@example.com" , " password" ),
32+ ) as client:
33+ await client.login()
34+ for attempt in range (5 ):
35+ try :
36+ devices = await client.get_devices()
37+ print (devices)
38+ return
39+ except (TooManyRequestsError, TooManyConcurrentRequestsError):
40+ await asyncio.sleep(0.5 * (attempt + 1 ))
41+ except NotAuthenticatedError:
42+ await client.login()
43+
44+
45+ asyncio.run(fetch_devices_with_retry())
46+ ```
47+
48+ ## Common errors
49+
50+ - ` NotAuthenticatedError `
51+ - ` BadCredentialsError `
52+ - ` TooManyRequestsError `
53+ - ` TooManyConcurrentRequestsError `
54+ - ` TooManyExecutionsError `
55+ - ` MaintenanceError `
56+ - ` AccessDeniedToGatewayError `
57+
58+ ## SSL and local certificates
59+
60+ - Cloud servers require internet access and valid vendor credentials.
61+ - Local servers require direct access to the gateway on your LAN.
62+ - If the gateway uses a self-signed certificate, pass ` verify_ssl=False ` when creating ` OverkizClient ` for local access.
2163
2264## Listener drops
2365
@@ -29,7 +71,11 @@ If the gateway uses a self-signed certificate, pass `verify_ssl=False` when crea
2971- Refresh setup with ` get_setup() ` and re-fetch devices.
3072- Confirm you are using the correct gateway and server.
3173
32- ## Logging tips
74+ ## Timeouts
75+
76+ For long-running operations, prefer shorter request timeouts with retries rather than a single long timeout.
77+
78+ ## Logging
3379
3480Enable debug logging in your application to inspect request/response details.
3581
0 commit comments