Garbage pickup date (mijnafvalwijzer.nl) custom_component

Thanks a lot! I will have a look at the options you provided.

Hello everyone,

I am very new to HA (±2 months) and i am trying to learn everything by scratch.
How do you guys put the images in the www folder and use it with the integration?

I manage to upload the images, but i cant see the image in the folder and cant use it with the picto’s. When i use a seperate image card, i can see the image with the local path (/local/community/afvalwijzer/gft1.png), but when i edit the entity, the pico change to blank when i paste the path shown above.

Looking forward to your help

When i got this done, i want to work with the auto entities card.

I just saw the 2.0.0-update of HACS coming in on HA, and it mentions a few breaking changes.

Is the current version of this plug-in compatible with HACS 2.0.0, or will installing that break this?

I updated HACS and everything works fine

Great, but honestly also kind of confusing. One of the breaking changes is the removal of the sensor-platform. In my YAML (which I mostly copied from @xirixiz), there are quite a couple of sensor-declarations. Or is this something else entirely?

This is about a specific sensor that HACS used to provide, not your YAML sensors from other platforms.

1 Like

Ah, I see. Thanks!

Not getting good data from api.
I don’t think this is for all areas, but certainly in my area.
This also works on the mobile app, but not on the web version: browsing the actual web-site using Chrome also gives no data.

Example of API response:
,
“max_tips”: 10,
“period_timer”: 15,
“location”: {
“response”: “NOK”,
“data”: false,
“error”: “NOT ALLOWED”
},
“notifications”: {
“response”: “OK”,
“data”: true,
“error”: “”
},
“notificationsTimer”: {
“response”: “OK”,
“data”: [
“15:00”,
“09:00”
],
“error”: “”
},
“reportGarbage”: {
“response”: “NOK”,
“data”: false,
“error”: “NOT ALLOWED”
},
“reportGarbageList”: {
“response”: “NOK”,
“data”: ,
“error”: “Error. No exist a list of waste type for this customer”
},
“afvalshop”: {
“response”: “NOK”,
“data”: false,
“error”: “NOT ALLOWED”
},
“excludedList”: “”,
“excludedListPickups”: ,
“gripLocations”: ,
“gripTimes”: ,
“gripRoutes”:
},
“ophaaldagen”: {
“response”: “NOK”,
“data”: ,
“error”: “No dataa”
},
“ophaaldagenNext”: {
“response”: “NOK”,
“data”: ,
“error”: “No data”
},
“afroepData”: {
“response”: “NOK”,
“data”: {
“afroepEmail”: “”,
“afroepContainers”: ,
“afroep”:
},
“error”: “”
},
“mededelingen”: {
“response”: “NOK”,
“data”: ,
“error”: “Error. No mededelingen found in db”
},

Suspect there is something wrong on the host side - if someone perhaps knows some who has contact details to reach the developers - please help!

Thanks a lot for this custom_component. However, upon starting Home Assistant, I always get this error:

Template error: as_timestamp got invalid input ‘geen’ when rendering template ‘{{ as_timestamp(states(‘sensor.afvalwijzer_pmd’)) | timestamp_custom(’%A’) }}’ but no default was specified

Any suggestion on how to fix this?

yes, read the error and do as it suggests. add a default value

I understand, but I did not define the template. It is part of the custom_component and I don’t know where to look. Hence the question here.

how is the template part of a custom component? which is that, and where is the template defined?

btw try this format

{{states('sensor.afvalwijzer_gft')|as_timestamp | timestamp_custom('%A') }}

It is the custom component this thread belongs to in which a number of sensors are created and for some of them a template appears to be used without specified default.

yes but the templates are not made by the component. ha just provides data, and several sensors

the templates are made by the user, to the needs of the user.

which and where. please be specific so we can see your problem and help out

btw since these sensors are timestamps already you can do

{{(states('sensor.afvalwijzer_gft')|as_datetime).strftime('%A')}}

and

{{(states('sensor.afvalwijzer_gft')|as_datetime).day}}

or

{{states('sensor.afvalwijzer_gft')|as_timestamp | timestamp_custom('%A') }}
{{(states('sensor.afvalwijzer_gft')|as_datetime).strftime('%A')}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).day}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).second}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).minute}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).hour}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).month}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).weekday()}}
{{(states('sensor.afvalwijzer_gft')|as_datetime).isoweekday()}}
{{time_until(states('sensor.afvalwijzer_plastic')|as_datetime)}}

:wink:

Thanks a lot for your help @Mariusthvdb.

I understand the question and the location where these are defined is exactly what I have been looking for myself.

I checked my complete config and I am sure that I have not defined these templates myself and that they somehow are a native part of the custom component.

I’ve been trying to go through the code myself and it appears to be related to the default_label: that is used by the custom component to replace the sensor value in case of no trash pick-up required.

Hence my question here. I was hoping that the author of the custom component or someone else that use the custom component could point me in the right direction.

that is what I am trying to do…

the component does Not create templates.

you either have those in your backend, in yaml or via the UI templates helpers, or, in the Frontend using custom cards (well, or the core Markdown card)

there simply is no other option.

No they are not.

maybe copied them?

Thanks a lot @Mariusthvdb.

You were correct, my mistake and thanks for pointing me in the right direction. The errors originated from template helpers.

1 Like

Hey all, soon I will release a new version with some code improvements. Also I’ve added a config_flow to make things easier for you all. I expect to release it somewhere next week, I’m testing it myself currently. I’ll keep you informed.

2 Likes

it’s done, needed to delete the old sensors, a bit of renaming, but here we are :wink: Nice indeed, thanks for the work you did.
note the ‘next’ entities are Not translated?

but, to my shock, I learned that my provider Saver will no longer be using Afvalwijzer… (notice the TBA…)

Would be truly sorry to have to leave this integration after so many years, and be forced to go to the competition (copy)

And not only because it doesnt have the day after tomorrow sensor… the entities can not be edited, the time sensors are not timestamps, and a very silly image attribute. o dear coming from Afvalwijzer, the Afvalbeheer integration really is a let down that needs to do some catching up…

Bram, please have a look if you can keep the integration up for Saver too in 2025?

1 Like

Ofcourse I’ll try to keep the integration up for Saver for the biggest user/supporter/contributor for this component :+1:. I’ll do some research.

1 Like