hasl-sensor / integration

Swedish Public Transport Sensor (HASL). Formerly named HomeAssistant SL Sensor
https://hasl.sorlov.com
Apache License 2.0
36 stars 8 forks source link

[Traffic Status] SLAPI_API_Error 1007: Unknown API-response code encountered #38

Closed matfouc closed 2 years ago

matfouc commented 2 years ago

Hi,

I've had since a long time an issue and couldn't see any data in the Lovelace Traffic Status card. So i removed entirely the HASL Lovelace cards (i had also the Departure card) and the HASL integration. After a reboot of HA and a fresh install, i see the following error in the HA logs for the Traffic integration: 2022-03-17 18:30:07 DEBUG (MainThread) [custom_components.hasl3.slapi] Will call TL2 API 2022-03-17 18:30:09 DEBUG (MainThread) [custom_components.hasl3.slapi] SLAPI_API_Error 1007: Unknown API-response code encountered

I figured out by using directly SL TL2 API that error 1007 is "Too many requests per month".

Here is my configuration for the Traffic integration for info: image

I don't know why i still got this error 1007 since it should be below the 10k requests/month but maybe the counter also includes all the API requests falling in error. Anyhow i'll wait a couple of days (or a month) and see if i get the card again.

DSorlov commented 2 years ago

Request quotas are not dependent on how many boxes you check (it actually always fetches all data however discards the ones you elected not to have as a sensor). By default it should use one request every 300 seconds.

I have it running on my own machine and it seems to be working there when I look at the history. However I do see some 1007 errors occurring from time to time but recovering within a couple of minutes. I have reported this to SL but I am unable to troubleshoot.

I have done some work on the logging to make sure it "looks nicer" and so you wont need to dig into debug log to get the error codes etc. This will be available as soon as I have time to publish which most likely is today.. =)

DSorlov commented 2 years ago

Fixed in 3.0.6 in all essential regards.