Bouni / abfallplus

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

Sensor state unknown #16

Closed codebude closed 9 months ago

codebude commented 10 months ago

I configured the component as described, but my sensors show state "Unbekannt" (unknown). There are not error notifications in HA. Is there a possibility to see some debug logs?

Screenshot_2023-10-29-10-43-59-712_io homeassistant companion android-edit

My config looks like:

- platform: abfallplus
  name: Gelber Sack
  key: e5543a3e190cb8d91c645660ad60965f
  municipality: 3707
  street: 241756
  trash_ids: "695"
  pattern: müll

I assume that my sensor configs are valid, because I just ran parts of your Python Code in visual studio and saw that the ICS file could be downloaded and contains the trash dates.

Bouni commented 9 months ago

Please share your municipality, ideally the URL from where you got the config values.

dtoenies commented 9 months ago

The same error happens on my side. I request Restmüll, Gelber Sack and Papier. All requests get a value except Papier. image

Here is my data:

Local waste disposal company: https://www.egst.de/de/abfallabholung/

Configuration:

- platform: abfallplus
  name: Restmuell
  key: e21758b9c711463552fb9c70ac7d4273
  municipality: 2593
  street: 495
  trash_ids: "50,161,53,31,169,50,161,53,31,169"
  pattern: Restm
- platform: abfallplus
  name: Gelber Sack
  key: e21758b9c711463552fb9c70ac7d4273
  municipality: 2593
  street: 495
  trash_ids: "50,161,53,31,169,50,161,53,31,169"
  pattern: Gelber Sack
- platform: abfallplus
  name: Papier
  key: e21758b9c711463552fb9c70ac7d4273
  municipality: 2593
  street: 495
  trash_ids: "50,161,53,31,169,50,161,53,31,169"
  pattern: Papier

API: https://api.abfall.io/?key=e21758b9c711463552fb9c70ac7d4273&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=auswahl_fraktionen_set

Response of the API:

9ab708b7393b9dbffb0929e78bcc2d81: 4f9a48b43048d722ea03162bd01699d6
f_id_kommune: 2593
f_posts_json[]: a:2:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";}
f_id_bezirk: 492,493
f_posts_json[]: a:4:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:0:{}s:11:"f_id_bezirk";s:7:"492,493";}
f_id_strasse: 2593bauernschaften
f_posts_json[]: a:5:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:1:{i:0;s:117:"a:2:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";}";}s:11:"f_id_bezirk";s:7:"492,493";s:12:"f_id_strasse";s:18:"2593bauernschaften";}
f_id_strasse_hnr: 495
f_posts_json[]: a:6:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:2:{i:0;s:117:"a:2:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";}";i:1;s:176:"a:4:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:0:{}s:11:"f_id_bezirk";s:7:"492,493";}";}s:11:"f_id_bezirk";s:7:"492,493";s:12:"f_id_strasse";s:18:"2593bauernschaften";s:16:"f_id_strasse_hnr";s:3:"495";}
f_id_abfalltyp_0: 50
f_id_abfalltyp_1: 161
f_id_abfalltyp_2: 53
f_abfallarten_index_max: 5
f_posts_json[]: a:14:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:3:{i:0;s:117:"a:2:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";}";i:1;s:176:"a:4:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:0:{}s:11:"f_id_bezirk";s:7:"492,493";}";i:2;s:352:"a:5:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";s:12:"f_posts_json";a:1:{i:0;s:117:"a:2:{s:32:"9ab708b7393b9dbffb0929e78bcc2d81";s:32:"4f9a48b43048d722ea03162bd01699d6";s:12:"f_id_kommune";s:4:"2593";}";}s:11:"f_id_bezirk";s:7:"492,493";s:12:"f_id_strasse";s:18:"2593bauernschaften";}";}s:11:"f_id_bezirk";s:7:"492,493";s:12:"f_id_strasse";s:18:"2593bauernschaften";s:16:"f_id_strasse_hnr";s:3:"495";s:16:"f_id_abfalltyp_0";s:2:"50";s:16:"f_id_abfalltyp_1";s:3:"161";s:16:"f_id_abfalltyp_2";s:2:"53";s:16:"f_id_abfalltyp_3";s:2:"31";s:23:"f_abfallarten_index_max";s:1:"5";s:13:"f_abfallarten";s:16:"50,161,53,31,169";s:10:"f_zeitraum";s:17:"20230101-20231231";s:12:"f_export_als";s:148:"{'action':'https://api.abfall.io/?key=e21758b9c711463552fb9c70ac7d4273&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_pdf','target':'_blank'}";}
f_abfallarten: 50,161,53,31
f_zeitraum: 20230101-20231231
f_export_als: {'action':'https://api.abfall.io/?key=e21758b9c711463552fb9c70ac7d4273&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_pdf','target':'_blank'}
Bouni commented 9 months ago

I think you got the street wrong.

grafik

Altenberge only gives two options for streets, "Innenbereich" -> 491 or "Aussenbereich" -> 492,493

Please try the right value for your street and test again.

Bouni commented 9 months ago

🤦🏽 It's quite a long time since I built this plugin and I forgot a lot since then. I need to check whats actuall yworng as you did everything according to the instructions

dtoenies commented 9 months ago

When I tried to insert "492,493" as street I got the error that an INT is expected. Unfortunately, the individual values do not lead me to success either.

If I leave out the pattern pattern: Papier in the setting for paper, I get values for the Gelber Sack or Restmüll.

Bouni commented 9 months ago

Ok, so I'm rather confident that its some kind of bug with recurring_ical_events

If I filter the event with it, all Papier entrys are gone for some reason.

I investigate this further ...

Bouni commented 9 months ago

So I think I figured it out. The ICS that is downloaded by the integration does only contain the current year!

If I filter the raw ICS I get this as result for Papier events:

Papier
2023-02-10
Papier
2023-04-06
Papier
2023-06-03
Papier
2023-07-28
Papier
2023-09-22
Papier
2023-11-17

So after November 17th you'll get Unbekannt because there's no event in the calendar.

I will see If i can download all calendar files and merge them befor parsing.

halli77 commented 9 months ago

Hi, I have the same issue with v0.3.0. Sensors with dates in 2024 are in state "unknown". I checked the ical for my city/street for 2024 (http://abfall-landkreis-waldshut.de), looks good. Reinstalled the abfallplus integration as well, with no effect. Any ideas?

my config: sensor:

Bouni commented 8 months ago

@halli77 I just doublechecked and it seems that Landkreis Waldshut does no longer use Abfall Plus as their provider. The seem to have hacked together somethng own

grafik

The bae URL even results in a Apache tomcat landing page 🤦🏽

grafik

As Landkreis Waldshut is my Landkreis as well, I think I need to create a new integartion to support that ...

Bouni commented 8 months ago

Its not self hacked but looks pretty shitty built by https://axians-athos.de/