Bouni / abfallplus

AbfallPlus component for Home Assistant
MIT License
14 stars 1 forks source link

Only one Trash entry allowed? #7

Closed stockklauser closed 2 years ago

stockklauser commented 2 years ago

Hay,

how could I create multiple entries? I have Bio Waste, Paper, ...

Next ist how can I find the filter Patterns?

Thx

Bouni commented 2 years ago

Hi, Yes, you can have multipe entities like this for example:

- platform: abfallplus
  name: Bio Tonne
  key: 5b0384147b5bc055c30fee1fb6db6f76
  municipality: 270
  street: 15720
  trash_ids: "51, 17, 48, 31, 43, 20, 321"
  pattern: Biotonne

- platform: abfallplus
  name: Blaue Tonne
  key: 5b0384147b5bc055c30fee1fb6db6f76
  municipality: 270
  street: 15720
  trash_ids: "51, 17, 48, 31, 43, 20, 321"
  pattern: Blaue Tonne

- platform: abfallplus
  name: Restmüll
  key: 5b0384147b5bc055c30fee1fb6db6f76
  municipality: 270
  street: 15720
  trash_ids: "51, 17, 48, 31, 43, 20, 321"
  pattern: Restmüll

- platform: abfallplus
  name: Gelber Sack
  key: 5b0384147b5bc055c30fee1fb6db6f76
  municipality: 270
  street: 15720
  trash_ids: "51, 17, 48, 31, 43, 20, 321"
  pattern: Gelber Sack

The best way to get your filters is that you go to your municipality's waste management website and download the ICS via the webinterface. There is usually a dropdown which lets you select the fileformat you want to export.

When you open the ICS in a texteditor you get a lot of VEVENTs like this:

BEGIN:VEVENT
DTSTART;VALUE=DATE:20220112
DTEND;VALUE=DATE:20220113
DTSTAMP:20220324T061608Z
UID:da009cc9d7f465bb08be88b8be8bd7a9
CREATED:20220101T090000Z
DESCRIPTION:Gelber Sack nicht vergessen!
LAST-MODIFIED:20220101T090000Z
LOCATION:Gemeinde
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Gelber Sack
TRANSP:TRANSPARENT
END:VEVENT

The integration trys to match the SUMMARY key with what you gibe it as a pattern. This can be a regex but the exact words work as well.

So for the above snippet with SUMMARY:Gelber Sack you can set your pattern to Gelber Sack

stockklauser commented 2 years ago

thx it worked fine for me