Home-Assistant-Sensor-Afvalbeheer: RecycleApp results unknown - connection error
Hi, haven’t changed anything in my setup but get error notification and results are “unknown”
- platform: afvalbeheer
wastecollector: RecycleApp
resources:
- restafval
- papier
- pmd
- glas
postcode: 1700
streetnumber: 17
streetname: Libelstraat
upcomingsensor: 1
dateformat: '%d-%m-%Y'
dateonly: 1
dateobject: 0
name: ''
nameprefix: 1
builtinicons: 0
disableicons: 0
alwaysshowday: 1
dutch: 1
Logger: custom_components.afvalbeheer.sensor Source: custom_components/afvalbeheer/sensor.py:1244 Integration: afvalbeheer (documentation) First occurred: 14:34:39 (1 occurrences) Last logged: 14:34:39
Error occurred while fetching data: ConnectionError(MaxRetryError(“HTTPSConnectionPool(host=‘recycleapp.be’, port=443): Max retries exceeded with url: /api/app/v1/access-token (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0xa7b3bdf0>: Failed to establish a new connection: [Errno -3] Try again’))”))
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 47 (10 by maintainers)
I had exact same issue: all ‘unknown’ and ‘Error occurred while fetching data: ConnectionError(MaxRetryError("HTTPSConnectionPool(host=‘recycleapp.be’, port=443): Max retries exceeded with url: /api/app/v1/access-token (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7fad210bb0>: Failed to establish a new connection: [Errno -3] Try again’))"))’
After some debugging and analysis, I discovered that HA was not able to resolve the name recycleapp.be On my own computer, recycleapp.be was correctly resolved to an IP-address. Noticed that HA was able to resolve api.recycleapp.be
When I changed in /root/config/custom_components/afvalbeheer/sensor.py the main URL to the following:
self.main_url = ‘https://api.recycleapp.be/api/app/v1/’
restarted, it is working again.
I can confirm that the fix proposed by @compunix-be is working. I’ll make a PR so this is resolved as soon as possible.
I’ve just release v4.9.5 which sets the default interval to 12 hours.
i’ve contacted fost plus (owner of everything garbage collections) to ask for some aditional info. I saw that their digital calendar is offline since 2 days as well, so maybe they are changing things. Will keep you updated.
Line 1075 or 1152?
EDIT: Line 1152!
So change line 1152 in /root/config/custom_components/afvalbeheer/sensor.py from
self.main_url = 'https://recycleapp.be/api/app/v1/'
toself.main_url = 'https://api.recycleapp.be/api/app/v1/'
and restart HASS. Tnx @compunix-be!Same issue, tried rebooting, removing and re-adding the integration, but the error remains the same:
Logger: custom_components.afvalbeheer.sensor Source: custom_components/afvalbeheer/sensor.py:1244 Integration: afvalbeheer (documentation) First occurred: 18:39:50 (1 occurrences) Last logged: 18:39:50
Error occurred while fetching data: ConnectionError(MaxRetryError(“HTTPSConnectionPool(host=‘recycleapp.be’, port=443): Max retries exceeded with url: /api/app/v1/access-token (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f0402d00c70>: Failed to establish a new connection: [Errno -3] Try again’))”))
@sammyke007 If you update to the new version, the test code will be gone.