robertraaijmakers / com.trashchecker

Trashcan Reminder 2.0 is an app for Homey (Home Automation Hub) and gives you the ability to get notifications when your trash is being collected.
10 stars 32 forks source link

No plastic/paper/PMD dates found on Afvalwijzer #143

Closed Amelsfort closed 2 years ago

Amelsfort commented 2 years ago

I have been using this app for a long time now and it worked fine until a few weeks ago. The dates for GFT and rest are retrieved correctly and Homey is notifying me every other week. But for plastic/paper/PMD (the other weeks) no notification occurs. When I check the debug information in the app, I see no dates listed for these kinds of trash. It's not even listed in the information.

My configuration:

The debug information shows the following:

{
  "REST": [
    "2022-01-06",
    "2022-01-20",
    "2022-02-03",
    "2022-02-17",
    "2022-03-03",
    "2022-03-17",
    "2022-03-31",
    "2022-04-14",
    "2022-04-28",
    "2022-05-12",
    "2022-05-28",
    "2022-06-09",
    "2022-06-23",
    "2022-07-07",
    "2022-07-21",
    "2022-08-04",
    "2022-08-18",
    "2022-09-01",
    "2022-09-15",
    "2022-09-29",
    "2022-10-13",
    "2022-10-27",
    "2022-11-10",
    "2022-11-24",
    "2022-12-08",
    "2022-12-22"
  ],
  "GFT": [
    "2022-01-06",
    "2022-01-20",
    "2022-02-03",
    "2022-02-17",
    "2022-03-03",
    "2022-03-17",
    "2022-03-31",
    "2022-04-14",
    "2022-04-28",
    "2022-05-12",
    "2022-05-28",
    "2022-06-09",
    "2022-06-23",
    "2022-07-07",
    "2022-07-21",
    "2022-08-04",
    "2022-08-18",
    "2022-09-01",
    "2022-09-15",
    "2022-09-29",
    "2022-10-13",
    "2022-10-27",
    "2022-11-10",
    "2022-11-24",
    "2022-12-08",
    "2022-12-22"
  ],
  "KERSTBOOM": [
    "2022-01-13"
  ],
  "TEXTIEL": [],
  "GROF": [],
  "GLAS": []
}
robertraaijmakers commented 2 years ago

Hi @Amelsfort ,

Do you have a bit more information? Do you have an example postalcode + number so I can check the Afvalwijzer API and see the results in the Web API so I can also see what categories they are providing?

Amelsfort commented 2 years ago

For example zipcode 5046GC with house number 1 has the issue.

robertraaijmakers commented 2 years ago

Thanks. I figured out why you only get half of the info. For this zipcode they have added a category called "dhm". This category is used in other postalcodes for "Retourstoffen" , but for the specified postal code it is used for papier en PMD.

Still strange why you get that outcome that you posted, since the DHM is logged under the category "Textiel", so I would expect that you get that as well (although your settings suggest that you disabled the Textiel category).

You can try and see if you get more information when you set Textiel also to API. The only thing you need to do is make sure the label for Textiel tells you that you have to put the Paper and PMD outside.

It's the only solution I can think of right now, since I don't have any other information that I can extract that tells me where they are using the DHM code for.

Amelsfort commented 2 years ago

Hi,

thanks for the investigation. I checked the site of Afvalwijzer and you're right: it contains the 'wrong' class name for PMD. That also explains why I found this issue only recently: I disabled the unused types.

Maybe it's an option to check the texts? Although I agree checking the class names might be a bit less error prone.

For now I will just enable 'Textiel' and update the texts.

robertraaijmakers commented 2 years ago

It's been quite some time now, but I might have a possible fix for your issue. If you want, you can test the fix here: https://homey.app/a/com.trashchecker/test/

It is now parsing (for some of the classes) based on the text displayed. And this should fix the ambiguous DHM class.