maorcc / citymind_water_meter

Home Assistant Integration with cp.city-mind.com, an Israeli water meters reading service
Apache License 2.0
40 stars 2 forks source link

429 from citymind #81

Closed mikeage closed 3 weeks ago

mikeage commented 1 month ago
homeassistant-1  | 2024-07-29 07:59:21.193 INFO (MainThread) [homeassistant.setup] Setting up citymind_water_meter
homeassistant-1  | 2024-07-29 07:59:21.193 INFO (MainThread) [homeassistant.setup] Setup of domain citymind_water_meter took 0.00 seconds
homeassistant-1  | 2024-07-29 07:59:21.197 INFO (MainThread) [custom_components.citymind_water_meter.managers.config_manager] loaded: {'meters': {}, 'use-unique-device-names': True}
homeassistant-1  | 2024-07-29 07:59:21.198 INFO (MainThread) [custom_components.citymind_water_meter] Finished loading integration
homeassistant-1  | 2024-07-29 07:59:43.519 INFO (MainThread) [homeassistant.components.sensor] Setting up citymind_water_meter.sensor
homeassistant-1  | 2024-07-29 07:59:43.520 INFO (MainThread) [homeassistant.components.number] Setting up citymind_water_meter.number
homeassistant-1  | 2024-07-29 07:59:43.520 INFO (MainThread) [homeassistant.components.switch] Setting up citymind_water_meter.switch
homeassistant-1  | 2024-07-29 07:59:43.520 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up citymind_water_meter.binary_sensor
homeassistant-1  | 2024-07-29 07:59:43.520 INFO (MainThread) [custom_components.citymind_water_meter.managers.coordinator] Start loading citymind_water_meter integration, Entry ID: c561c369e885d4bd3cf858cd7d21c1e8
homeassistant-1  | 2024-07-29 07:59:43.521 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update None --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 07:59:44.285 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Connected to the API
homeassistant-1  | 2024-07-29 09:09:52.047 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Connected to the API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumption/last-read, Method: GET, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:10:52.049 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:10:52.759 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Connected to the API
homeassistant-1  | 2024-07-29 09:10:52.996 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Connected to the API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumer/myalerts, Method: GET, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:11:52.999 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:11:54.377 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Connected to the API
homeassistant-1  | 2024-07-29 09:29:53.041 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Connected to the API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumption/last-read, Method: GET, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:30:53.042 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:30:53.329 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumer/login, Method: POST, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:31:53.330 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:31:53.628 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumer/login, Method: POST, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:32:53.634 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:32:53.920 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumer/login, Method: POST, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:33:53.921 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:33:54.196 ERROR (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Failed to access API, Failed to send HTTP request, Endpoint: https://eu-customerportal-api.harmonyencoremdm.com/consumer/login, Method: POST, HTTP Status: Too Many Requests (429)
homeassistant-1  | 2024-07-29 09:34:54.197 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Failed to access API --> Establishing connection to API, Initializing API
homeassistant-1  | 2024-07-29 09:34:55.222 INFO (MainThread) [custom_components.citymind_water_meter.managers.rest_api] Status update Establishing connection to API --> Connected to the API

I did restart my HA instance a few times this morning, so I'm not sure if that's the root cause. Is anyone else seeing this?

mikeage commented 1 month ago

FWIW, I just tried logging in to the rym-pro web portal and it was fine.

elad-bar commented 3 weeks ago

When you are opening the web portal it is different than process runs and collects data, 429 error means that it tried too many time in small time window, Which version of the integration are you using?

mikeage commented 3 weeks ago

It resolved itself after a few hours, and I haven't seen it since, so this can probably be closed.

This was with 3.0.8.

I'm aware that the portal has a slightly different flow; my point in mentioning that was that when the website was calling the same APIs, it wasn't being rate limited, which suggested to me that perhaps there may be an issue with the sequence of calls, or something else.

elad-bar commented 3 weeks ago

that's was superfine to mention that it was working, but i tried to explain why the 429 appears, because the integration is doing polling of infromation and we don't know exactly what is the right timing to do that, so it's a fine tuining process to avoid abusing the server and ignoring it, thanks for the update

mikeage commented 3 weeks ago

no worries, I didn't take offense. I know what a 429 means, but I know that others might not.