xirixiz / homeassistant-afvalwijzer

Provides sensors for some Dutch waste collectors
MIT License
180 stars 69 forks source link

Double sensor name for gft #309

Closed Eraser127 closed 2 months ago

Eraser127 commented 2 months ago

The problem

When GFT is next for pickup, it shows 'gft, gft' on the status at 'afvalwijzer tomorrow'. Does this come from within the afvalwijzer code?

Knipsel

I found the code below, could that be the issue?:

Knipsel1

Version of afvalwijzer integration having the issue?

2024.06.02

Version of Home Assistant Core having the issue?

2024.8.2

Anything in the logs that might be useful for us?

No response

Additional information

No response

DynaSpan commented 2 months ago

What provider do you use? It might be different types of waste collection that gets renamed to the same new entity. For example: normal gft and things like tree branches etc.

It might be a good idea though to check the array with waste types and remove duplicates to prevent issues.

Eraser127 commented 2 months ago

I use Nijkerk as provider. With 'array with waste types' you mean the mapping of wastetypes as in the screenshot?

DynaSpan commented 2 months ago

Well, e.g. say your provider has a collection date for normal gft and things like branches from trees etc. The naming of those items might get renamed to the same gft if they're in waste_mapping array and point to the same name.

To prevent duplicates, there are 2 options:

  1. Make some edits to make sure it doesn't duplicate the value but keeps the original naming (so gft and takken or something like that)
  2. Or add some extra code which checks the waste types that will be retrieved tomorrow, and remove any duplicates from that array

Could you provide the raw response from your waste provider? Maybe we can see what's the issue there.

Eraser127 commented 2 months ago
  1. So that would best be done in the exclude-list of Afvalwijzer?
  2. Dont know how, but have to look into that.

The regular afval app only mentions 'Groeten- Fruit- en Tuinafval', so no others.

Eraser127 commented 2 months ago

Today was another pickup date, but now it says just gft.

Knipsel

If it'll happen again I'll look into the array.