pippyn / Home-Assistant-Sensor-Afvalbeheer

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

Deafvalapp api #479

Closed JaySea77 closed 3 months ago

JaySea77 commented 4 months ago

Deadvalapp api verandert de waarde van morgen en vandaag meerdere keren per dag. Doordat dit steeds gebeurt, kun je de waarde hiervan niet meer afvangen. Zo was het eerst 'pmd, gft' en nu ineens 'GFT, PMD'. Vorige week was het 'Restafval, Gft' en enkele uren later 'Restafval, GFT' De volgorde en het hoofdletter gebruik wijzigt steeds.

pippyn commented 4 months ago

What is your config?

JaySea77 commented 4 months ago
afvalbeheer:
  wastecollector: DeAfvalApp
  resources:
    - restafval
    - gft
    - pmd
  postcode: XXXX99 {this is my actual postalcode}
  streetnumber: 99 {this is my actual home number}
  upcomingsensor: 1
  dateformat: "%d-%m-%Y"
  dateonly: 1
  alwaysshowday: 0
  printwastetypes: 0
  dateobject: 0
  name: ""
  nameprefix: 1
  builtinicons: 0
  disableicons: 0
  dutch: 1
pippyn commented 3 months ago

Change your resources to the capitalization you want to make it consistent. I would recommend this:

afvalbeheer:
  wastecollector: DeAfvalApp
  resources:
    - Restafval
    - GFT
    - PMD
  postcode: XXXX99 {this is my actual postalcode}
  streetnumber: 99 {this is my actual home number}
  upcomingsensor: 1
  dateformat: "%d-%m-%Y"
  dateonly: 1
  alwaysshowday: 0
  printwastetypes: 0
  dateobject: 0
  name: ""
  nameprefix: 1
  builtinicons: 0
  disableicons: 0
  dutch: 1

Warming: This could change the unique entity id's in some cases

JaySea77 commented 3 months ago

Would this prevent GFT showing up as gft. Might it be better to change Restafval to RESTAFVAL then too?

pippyn commented 3 months ago

Yes GFT will be displayed correctly and no; capitalize the fractions as you would write them

JaySea77 commented 3 months ago

But having gft changed to GFT. If I set it to Restafval, it might change to RESTAFVAL by the api and break it again.

pippyn commented 3 months ago

No it won't. The API doesn't capitalize any fractions. The sensor does.

JaySea77 commented 3 months ago

That is weird since I didn't change gft to GFT and the sensor.status became GFT which broke my dashboard view.

pippyn commented 3 months ago

Because the sensor does capitalize the fractions in places it can.

JaySea77 commented 3 months ago

But I am sure it is something new because it didn’t always do that.

pippyn commented 3 months ago

Yes version v5.3.1

JaySea77 commented 3 months ago

That explains it :)