pippyn / Home-Assistant-Sensor-Afvalbeheer

Provides Home Assistant sensors for multiple Dutch and Belgium waste collectors
Apache License 2.0
287 stars 87 forks source link

RecycleApp no longer working? #229

Closed TheGroundZero closed 1 month ago

TheGroundZero commented 3 years ago

Hi

The RecycleApp source no longer seems to be working.

Since a week or two the sensors have become unavailable.

- platform: afvalbeheer
  wastecollector: RecycleApp
  resources:
    - restafval
    - papier
    - pmd
  postcode: 1234
  streetname: MyStreetName
  streetnumber: 69
  upcomingsensor: 0
  dateformat: '%Y-%m-%d'
  dateobject: 0
  dateonly: 1
  dayofweek: 0
  alwaysshowday: 0
  name: ''
  nameprefix: 0
  builtinicons: 1
  disableicons: 0
  dutch: 1

image

Ryckie commented 3 years ago

I have the same issue. I copiëd over the same exact street name and so over from the app to Home Assistant. And it's showing ''Unknown''. And eye icon instead of the icons from the example screenshot.

pippyn commented 3 years ago

The recycleapp API has issues at the moment. Are there any errors in the log?

TheGroundZero commented 3 years ago

The recycleapp API has issues at the moment. Are there any errors in the log?

For the moment it appears to be working again

For now, I'm only getting the typical warning

Logger: homeassistant.loader
Source: loader.py:791
First occurred: 18:48:28 (1 occurrences)
Last logged: 18:48:28
You are using a custom integration afvalbeheer which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
pippyn commented 3 years ago

Can this issue be closed?

Ryckie commented 3 years ago

Can this issue be closed?

For me it is still not showing correctly. image

Ryckie commented 3 years ago
2021-05-19 13:20:08 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/afvalbeheer/sensor.py", line 438, in async_update
    await self.collector.update()
  File "/config/custom_components/afvalbeheer/sensor.py", line 1138, in update
    await self.hass.async_add_executor_job(self.__get_location_ids)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/afvalbeheer/sensor.py", line 1107, in __get_location_ids
    self.postcode_id = response.json()['items'][0]['id']
IndexError: list index out of range
pippyn commented 3 years ago

@Ryckie What is your config?

Ryckie commented 3 years ago

@Ryckie What is your config?

This is my sensors.yaml

- platform: afvalbeheer
  wastecollector: RecycleApp
  printwastetypes: 1
  resources:
    - RESTAFVAL
    - gft
    - papier
    - pmd
  postcode: "0000 cityname"
  streetnumber: 5
  streetname: "my streetname"
  upcomingsensor: 1
  dateformat: "%d-%m-%Y"
  dayofweek: 1
  alwaysshowday: 1
  dateonly: 0
  dateobject: 0
  name: ""
  nameprefix: 1
  builtinicons: 0
  disableicons: 0
  dutch: 1
  updateinterval: 1
pippyn commented 3 years ago

Does your address work on the RecycleApp.be website? If so: Can you DM me your address on the HA forum?

Ryckie commented 3 years ago

Does your address work on the RecycleApp.be website?

Yes this works, only difference there from the android app is on that site I put my postcode "0000 - cityname" In the app it's "0000 cityname". Im now testing with the "-" inbetween. Is it supposed to update the sensors on a ha restart, or does it wait for the default update time of 1 hour?

If so: Can you DM me your address on the HA forum?

If the above doesn't solve it I will DM you there. Is this you? https://community.home-assistant.io/u/pippyn

Strange thing is that "today, tomorrow" show 'none' instead of 'unknown'. However that is also not correct and has never changed to something else then 'none'.

pippyn commented 3 years ago

It will update on restart (and every hour). You have an error in your config, the postcode and cityname are 2 separate entries. And for RecycleApp cityname is not required (streetname is though). example:

- platform: afvalbeheer
  wastecollector: RecycleApp
  printwastetypes: 1
  resources:
    - RESTAFVAL
    - gft
    - papier
    - pmd
  postcode: 0000
  streetnumber: 5
  streetname: "my streetname"
  upcomingsensor: 1
  dateformat: "%d-%m-%Y"
  dayofweek: 1
  alwaysshowday: 1
  dateonly: 0
  dateobject: 0
  name: ""
  nameprefix: 1
  builtinicons: 0
  disableicons: 0
  dutch: 1
  updateinterval: 1

Yes that's me.

The today and tomorrow sensors get their info from the other sensors and default to 'none'. So that's normal.

pippyn commented 3 years ago

@Ryckie I did some tests and found that the way your address code gets pulled is different than the normal recycleapp way. I'll have a look if I can add this in the next update.

Ryckie commented 3 years ago

@Ryckie I did some tests and found that the way your address code gets pulled is different than the normal recycleapp way. I'll have a look if I can add this in the next update.

Okay, thank you a lot. I hope you can get it to work. Also, please keep my adres private (foryoureyesonly) :).

Ryckie commented 3 years ago

Bump

JeroenTuinstra commented 1 year ago

I would like to add that the recycple App in Belgium no longer works. The engineers of the app have decided in their great wisdom that they don't provide the information anymore. Apparently there is some new scheduling (don't ask me why it would work) but normally the app would say what time the garbage would be collected. Now it says what time you should set the garbage at the street. The difference; collection would be on Monday morning, but garbage should be set to the street after 18:00 in the evening the previous day. I am not sure where this new schedule is published, but so far only on their website and no longer in the app.

IMG_1930

IMG_1931

The new calanders are only available through their website; https://www.arp-gan.be/en/calendar-rubbish-bags (nice and easy website to remember.

This is really Brussels at its dumbest. They have an agreement to provide all information transparently and open for all technicians and apps to freely use the information - however moving it over to a complete different website because of a technical detail (drop off instead of collection for whatever reason they think that is more useful for Brusselaers).

So Brussels is completely excluded from the Recycle App (something they setup themselves). I anyone is able to use the api of the new website to integrate again with Afvalbeheer - that would be greatly appreciated.

pippyn commented 1 year ago

@JeroenTuinstra do you have an address for me to test with?

JeroenTuinstra commented 1 year ago

@pippyn yes off course:

postcode: 1000
streetnumber: 61
streetname: "Minimenstraat"
JeroenTuinstra commented 1 year ago

This is the whole configuration:

afvalbeheer:
  wastecollector: RecycleApp
  resources:
    - restafval
    - papier
    - pmd
  postcode: 1000
  streetnumber: 61
  streetname: "Minimenstraat"
  printwastetypes: 0
  upcomingsensor: 1
  dateformat: '%d-%m-%Y'
  dateonly: 0
  dayofweek: 1
  name: ""
  nameprefix: 0
  builtinicons: 1
  dutch: 0

All states of the sensor are unavailable.

JeroenTuinstra commented 1 year ago

Unfortunately I cannot programme but I think this page might give some help: https://www.arp-gan.be/en/digital-solutions

pippyn commented 1 year ago

I have some sad news. I found the new API and was able to send the correct requests. However the response is just an image and I need a text response in order to process the data. So I'm not able to implement the new API in this sensor.

You could contact your municipality to request another response of the API or a move back to RecycleApp, but I don't think they will do either.

Example of the response: https://forms.arp-gan.eu/calendarv4/pdf/c3e84ad4-d955-4a29-bb20-98c2b170ecca.jpg

Robby-Swartenbroekx commented 7 months ago

Hello, 5.2.19 it does work perfectly, until this day (I downgraded back to this version and it works again) If I use 5.3.1 or 5.3.2, it doesn't work. It seems that 5.3.0 never really was released, not even as a beta, so I can't test that one.

So I don't think the issue is that the API changed it's response. This integration is dealing with it slightly different though.

Robby-Swartenbroekx commented 7 months ago

Maybe I'm experiencing a different issue then above. because it certainly isn't having an issue since 2021.

I now checked the API, if I follow everything, I do get a nice response if I query it manually through powershell: It's just that version 5.3.1 and 5.3.2 aren't giving me any responses anymore.

PS C:\Users\Thuis> $antwoord.items[2] | ConvertTo-Json

{
    "exception":  {
                      "reason":  {
                                     "name":  "@{nl=Feestdag; fr=Jour férié; de=Feiertag; en=Public holiday}",
                                     "createdAt":  "2020-02-03T11:06:44.291Z",
                                     "updatedAt":  "2020-03-03T16:17:29.678Z",
                                     "id":  "5d610b87162c063cc0400102"
                                 },
                      "replaces":  {
                                       "exception":  "@{replacedBy=65806826a420ef007db4c59b}",
                                       "type":  "collection",
                                       "isDeleted":  false,
                                       "timestamp":  "2024-04-01T00:00:00.000Z",
                                       "fraction":  "637df39212f71e003c096254",
                                       "group":  "6387477da19df8003c711637",
                                       "organisation":  "5e27908010cfeaa15c9ceeb8",
                                       "createdAt":  "2023-12-18T15:40:40.759Z",
                                       "updatedAt":  "2023-12-18T15:41:26.500Z",
                                       "id":  "658067f8a420ef007db4c584"
                                   }
                  },
    "type":  "collection",
    "timestamp":  "2024-04-02T00:00:00.000Z",
    "fraction":  {
                     "national":  false,
                     "nationalRef":  null,
                     "isDeleted":  false,
                     "name":  {
                                  "nl":  "GFT",
                                  "fr":  "GFT",
                                  "en":  "GFT",
                                  "de":  "GFT"
                              },
                     "logo":  {
                                  "regular":  "@{1x=public/defbe966-6ecd-4e73-95da-b63d12091791-gft@1x.png; 2x=public/235c9110-4f81-466c-8cc5-3b62732b88fc-gft@2x.png; 3x=public/0c517066-0f90-
43e9-ad39-945a25fc8ebb-gft@3x.png}",
                                  "reversed":  "@{1x=public/f5e35a0c-dbfa-4d7c-a506-dbf516fbf0b0-gft-reversed@1x.png; 2x=public/f4a6f0db-bef3-4713-89c8-f9c6dc15e1da-gft-reversed@2x.png; 3x=pu
blic/7dff44b1-599b-4afe-807a-64a2671eff79-gft-reversed@3x.png}",
                                  "isDeleted":  false,
                                  "_id":  "5d610b86162c063cc0400108",
                                  "name":  "@{nl=Groente-, fruit-, tuinafval; fr=Déchets biodégradables; de=Bioabfall; en=Biodegradable waste}",
                                  "createdAt":  "2020-02-20T13:08:25.591Z",
                                  "updatedAt":  "2020-06-24T14:46:14.173Z",
                                  "__v":  0,
                                  "id":  "5d610b86162c063cc0400108"
                              },
                     "color":  "#006D62",
                     "variations":  [

                                    ],
                     "organisation":  "5e27908010cfeaa15c9ceeb8",
                     "createdAt":  "2022-11-23T10:18:58.430Z",
                     "updatedAt":  "2023-04-03T12:26:04.553Z",
                     "id":  "637df39212f71e003c096254"
                 },
    "id":  "65806826a420ef007db4c59b"
}

PS C:\Users\Thuis> $antwoord.items[3] | ConvertTo-Json

{
    "exception":  {
                      "reason":  {
                                     "name":  "@{nl=Feestdag; fr=Jour férié; de=Feiertag; en=Public holiday}",
                                     "createdAt":  "2020-02-03T11:06:44.291Z",
                                     "updatedAt":  "2020-03-03T16:17:29.678Z",
                                     "id":  "5d610b87162c063cc0400102"
                                 },
                      "replaces":  {
                                       "exception":  "@{replacedBy=658068371d6e17007e8cb054}",
                                       "type":  "collection",
                                       "isDeleted":  false,
                                       "timestamp":  "2024-04-01T00:00:00.000Z",
                                       "fraction":  "5ece0d5f7125b403703d90bb",
                                       "group":  "6387477da19df8003c711637",
                                       "organisation":  "5e27908010cfeaa15c9ceeb8",
                                       "createdAt":  "2023-12-18T15:40:08.785Z",
                                       "updatedAt":  "2023-12-18T15:41:43.989Z",
                                       "id":  "658067d81d6e17007e8cb021"
                                   }
                  },
    "type":  "collection",
    "timestamp":  "2024-04-02T00:00:00.000Z",
    "fraction":  {
                     "national":  false,
                     "nationalRef":  null,
                     "isDeleted":  false,
                     "name":  {
                                  "nl":  "Restafval",
                                  "fr":  "Déchets résiduels",
                                  "en":  "Residual waste",
                                  "de":  "Restmüll"
                              },
                     "logo":  {
                                  "regular":  "@{1x=public/c1226d4d-7015-4f3c-b534-a578dc26a87e-householdBag@1x.png; 2x=public/d9251703-aaf7-49ef-a8f6-5b25d7b1f309-householdBag@2x.png; 3x=pub
lic/5f71892c-f96d-471e-8741-a123df1e0a8b-householdBag@3x.png}",
                                  "reversed":  "@{1x=public/4b6bfc6e-fa03-4fd5-9f81-07c5ecfbedcb-householdBag-reversed@1x.png; 2x=public/a0432869-09aa-44b3-a2b0-323667a2ba24-householdBag-reve
rsed@2x.png; 3x=public/0298bd59-e740-41b4-94fe-3c605622bc5b-householdBag-reversed@3x.png}",
                                  "isDeleted":  false,
                                  "_id":  "5d610b86162c063cc0400112",
                                  "name":  "@{nl=Restafval zak; fr=Déchets non recyclables sac; de=Restabfall tasche; en=Non-recyclable waste bag}",
                                  "createdAt":  "2020-02-20T13:08:25.556Z",
                                  "updatedAt":  "2020-06-24T14:46:14.409Z",
                                  "__v":  0,
                                  "id":  "5d610b86162c063cc0400112"
                              },
                     "color":  "#767676",
                     "variations":  [

                                    ],
                     "organisation":  "5e27908010cfeaa15c9ceeb8",
                     "createdAt":  "2020-05-27T06:49:03.449Z",
                     "updatedAt":  "2023-05-11T09:17:08.189Z",
                     "id":  "5ece0d5f7125b403703d90bb"
                 },
    "id":  "658068371d6e17007e8cb054"
}
Robby-Swartenbroekx commented 7 months ago

ok, I found the solution for me, It seems that since 5.3.1 it changed the names of my entities, most of them to an "_2" version.

afbeelding

strikeman342 commented 7 months ago

Since the last update I see this in my logfiles: 2024-04-08 23:00:06.827 ERROR (SyncWorker_3) [custom_components.afvalbeheer.API] Invalid response from server for street_id

I'm using afvalbeheer with RecycleApp. Nothing was changed in my configuration - I'm running the latest version.

After some fiddling around, I found that other streetnames in my town still work, but mine doesn't anymore; I doublechecked RecycleApp and I'm 100% certain the streetname is still correct.

For reference, the postalcode is 9190 and the streetname that does not work anymore is "Burgemeester Dr. Eugeen Roggemanlaan"

francisp2 commented 1 month ago

Does not work any more for me too. On the Recycleapp website my address works.

pippyn commented 1 month ago

@francisp2 not related to this issue. Update to v5.4.2