As I replied in a PM I noticed that the following example URL isn’t working for your postal code and house number. It seems like an issue at mijnafvalwijzer.nl, perhaps you can contact them that you can’t get json data from their website.
Also in version 2.0.0 (major rewrite), I added a lot of exception handling, so the component will give a nice message in the log that no data was received instead of the error posted by robertjanb.
Yeah I got the same issue unfortunately (NOK). I think my city changed something because the login screen says my address is not known (I am pretty sure it exists…). I’ll send them an email, but thanks anyway for developing the component!
…in the meantime mijnafvalwijzer.nl stated that the usage of json.mijnafvalwijzer.nl is only allowed for paying customers, great security .
Anyhow, I modified the sensor to make sure it’s futureproof in case mijnafvalwijzer is closing up the json url. I now created a scraper which can be tested. Be aware the date format has changed form %Y-%m-%d to %d-%m-%Y.
thanks for the nice custom component, was thinking of using ical inputs for the trash pickup dates. But this works so much better.
However, i can’t seem to get the custimization working…
i have all the correct icons with the correct trash type
i have the dates in the (almost) correct way (it’s stil in english… can’t seem to get it in dutch*)
Home assistant is set to dutch
tried a lot of templates for the sensors, but none of them are working. Do i need to have custom_ui installed for the templates to work? can’t seem to get it right…
do we set this up as usual or have to add _scraper in the sensor platform? I get a config error now…
EDIT_
nevermind, think I got it working, renamed the component to mijnafvalwijzer.py…
please let me ask this:
will the state for the plastic sensor be sensor.trash_plastic, or as it used to be plastic_verpakkingsmateriaal. And, related, will the trash_today and _tomorrow use plastic, or plastic_verpakkingsmateriaal.
I can’t find it in the inspector just yet, but your component seems to have changed that?
secondly, something is amiss with the dates, have a look. It seems to skip 2 dates and jumps to 14 februari for Papier:
Hi Marius, is the new cc version running fine now, or do you still have some issues? From now on I`ll make release notes with changes and breaking changes so there’s more info about what has actually changed.
Sensors are created based on the name of mijnafvalwijzer with the prefix “trash_”. For my region f.e. I have only “Papier, GFT, Restafval and Plastic”, so the sensors “trash_papier, trash_gft, trash_restafval and trash_plastic” are generated. trash_today, trash_tomorrow, trash_next will remain the same in upcoming releases.
I was thinking of creating one sensor with multiple attributes, but I`m not sure if that would be a better approach. Perhaps someone else at this topic knows ?
Thanks for sharing, I agree the automation I use is a bit outdated .
I don’t see what’s wrong actually. GFT is correct, plastic is correct, and restafval is correct, but I don’t see the next pickup date for papier in the app, is it really before 14 feb? The naming for plastic depends what you gemeente has provided to mijnafvalwijzer. It could be plastic_verpakkingsmateriaal in 2018, while in 2019 they changed it to just plastic.
I think I don’t understand what the problem is. The next pickup dates are matching on the website, app and mijnafvalwijzer component as far as I can see.
…or do you mean the list order on the lovelace card?
would you accept a feature request for an extra: to have the dates listed in order of next appearance? as on the website, maybe for the next month? If at all possible scraping the site of course.
Maybe, it is possible to create a weather-like component: 1 card where you can configure the trash types you want to show, and that orders them by date automatically. This is what my weather component looks like. I don’t have the time nor the photoshop skills to edit the image. But here’s a collection of sensors shown, and i guess it’s possible for the garbage component possible too, just showing trahs thypers ordered by date?
[Edit: started to develop this morning. I hope to post my progress today]