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

Circulus collector not working #424

Closed KvE-dev closed 11 months ago

KvE-dev commented 11 months ago

Problem statement

The problem that I ran into seems to be only for the Circulus collector. I have tried several ways of configuring this collector but still the data does not seem to get loaded from the Circulus source.

I have added somewhat the same config for Twente Milieu and this seems to work fine.

Everything seems fine accept the loading of the data:

Screenshot 2023-12-01 192040

One small sidenode: I am fairly new to Home assistant.

Setup

Config

NOTE: Instead of secrets I have also tried putting in the adress.

afvalbeheer:
  - wastecollector: Circulus
    resources:
      - restafval
      - gft
      - papier
      - pmd
    postcode: !secret afvalbeheer_postcode_circulus
    streetnumber: !secret afvalbeheer_huisnummer_circulus
    # suffix: ""
    # upcomingsensor: 1
    # dateformat: "%d-%m-%Y"
    # dayofweek: 1
    # dayofweekonly: 1
    # dateonly: 0
    # name: ""
    nameprefix: 1
    builtinicons: 1
    builtiniconsnew: 1
    # dutch: 0
    # updateinterval: 12

  - wastecollector: TwenteMilieu
    resources:
      - restafval
      - gft
      - papier
      - pmd
    postcode: !secret afvalbeheer_postcode_twente
    streetnumber: !secret afvalbeheer_huisnummer_twente
    # suffix: a
    # upcomingsensor: 0
    # dateformat: '%d-%m-%Y'
    # dayofweek: 1
    # dayofweekonly: 1
    # dateonly: 0
    # name: ""
    nameprefix: 1
    builtinicons: 1
    builtiniconsnew: 1
    # dutch: 0
    # updateinterval: 12
BeeJee78 commented 11 months ago

I have the same issue. It was working fine for a couple of months but it stopped working recently. Maybe they changed the api at Circulus?

Edit: I went to the Circulus afvalkalender website for my address (which is also used in the code) and it's totally empty so i think it's a Circulus issue.

KvE-dev commented 11 months ago

I have also tried to enter my own adress into the https://mijn.circulus.nl/login and it came up with the calender. So I really think something in the API of their webside has changed.

BeeJee78 commented 11 months ago

I don't think they changed anything, they just don't show any data in the calendar anymore. So as soon as they show data again this should be solved.

KvE-dev commented 11 months ago

Screenshot_2023-12-05-20-27-16-408_com.android.chrome.jpg

I really have data in the calendar on their website.

BeeJee78 commented 11 months ago

Oh i'm sorry, I thought your calendar was empty as well.

My calendar also has data now. I restarted home assistant and now the card has data again! Hope this solves it for you too?

pippyn commented 11 months ago

Can you share an address that does work on the website, but not with this sensor? Then I'll have a look what's going on

KvE-dev commented 11 months ago

Alright. I figured it out.

Thanks for the conversation, this helped figuring it out!

I do not like sharing my adres on an open thread on the internet, so I tried to find another adress in my hometown which has the same problem. Turns out that adresses with appendixes (A, B, etc.) are the problem.

The circulus website does not ask for the appendix on input of the adres but instead gives a popup with options this adres postal code + house number has.

This popup is not handled correctly by the implementation you wrote.

So I put in the adres of a neighbour which does not have an appendix and now the data is fetched correctly and the implementation works just fine.

pippyn commented 11 months ago

The appendix handling is implemented in the sensor for Circulus with the sensor option suffix: a for example. You're saying that is not working anymore? Can you give me an address with a suffix so I can fix the implementation? I understand you don't want to share your own address, any address with a suffix will do.

KvE-dev commented 11 months ago

It was quite a search, but I found this adres which has the same problem.

Screenshot 2023-12-06 105014

When putting in the number without the suffix field enabled, the implementation does not work although Circulus recognizes this adres. This is also the case when an empty suffix is provided: suffix: "".

When filling in the suffix field with suffix: "a" the implementations works.

I hope I have provided enough information for you to work with. If not, let me know.

pippyn commented 11 months ago

I just released v5.2.9. Are you willing to test if this fixes the issue? It should now get data for an address with a suffix and without.

KvE-dev commented 11 months ago

I just tested it and it seems to work correctly now for adresses with and without suffix on the same number.

Thank you for fixing it!