I wrote a custom_component platform and a related custom Lovelace card for providing and displaying Budapest Department of Public (FKF) garbage collection schedule.
Enjoy!
I wrote a custom_component platform and a related custom Lovelace card for providing and displaying Budapest Department of Public (FKF) garbage collection schedule.
Enjoy!
Hi @amaximus!
First of allâŠItâs a great feature! Thanks!
âŠbut I have two error messageâŠand I didnât fix it.
Could you please help me?
Thanks in advance!
Balazs
Hi @balagev79,
thanks for the heads-up. Iâm aware of the warnings included by 0.109.0.
Once Iâll have some time, I will update the code to make it compliant.
regards, Atticus
I tested it with my address, but Iâve received this error (I keep the HA version on 109.0).
Logger: homeassistant.components.sensor
Source: custom_components/fkf_garbage_collection/sensor.py:118
Integration: Sensor (documentation, issues)
First occurred: 4:06:04 PM (1 occurrences)
Last logged: 4:06:04 PM
fkf_garbage_collection: Error on device update!
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/helpers/entity_platform.pyâ, line 322, in _async_add_entity
await entity.async_device_update(warning=False)
File â/usr/src/homeassistant/homeassistant/helpers/entity.pyâ, line 470, in async_device_update
await self.async_update()
File â/config/custom_components/fkf_garbage_collection/sensor.pyâ, line 166, in async_update
self._fkfdata = await async_get_fkfdata(self)
File â/config/custom_components/fkf_garbage_collection/sensor.pyâ, line 118, in async_get_fkfdata
gday = tr_elements[0].xpath(â//td[1]/text()â)
IndexError: list index out of range
After that I tried with the example address (Attila Ășt) and itâs worked! My address is street (utca), which is looks like âu.â in FKF database. After that I tested with tĂ©r, Ășt, köz, etcâŠand itâs worked as well.
Could you please share with me/us the correct street âsymbolâ what I need to use?
PS: I think â.â is the problem after the street name like: âPetĆfi u.â
Thanks!
Balazs
Could you please share your sensor config (at least the zip code and the publicplace.) to be able to investigate it.
Testing for 1196 PetĆfi u. 59 looks ok:
sensors $more test_fkf.yaml
platform: fkf_garbage_collection
name: 'test_fkf'
zipcode: '1196'
publicplace: 'PetĆfi u.'
housenr: '59'
sensors $
Here is my config:
sensor
Thanks!
Balazs
There was an issue with handling public place names with several items (e.g. Kiss IstvĂĄn u.) that has been fixed this morning.
Please update the sensor (and the associated card) and get back to me with results.
You may consider reporing issues at https://github.com/amaximus/fkf-garbage-collection/issues.
Perfect! Thanks it works!
Hi @amaximus
suddenly my sensor has a state of âunknownâ
My config is:
#FKF Garbage collection
platform: fkf_garbage_collection
name: âfkf_my_scheduleâ
zipcode: !secret zipcode
publicplace: !secret publicplace
housenr: !secret housenr
Zipcode is â1124â
publicplace is âBĂŒrök u.â
in secrets.yaml
Is it possible that I missed something in the config?
You may check to see under Developer Tools->States what is displayed for the sensor. You may also check if you have any error/warning related to the fkf_garbage_collection or to the sensor itself.
I presume it was working before and you did not change anything related.
Versions would be good to be known.
Iâm using latest hass version (0.111.4) with latest custom platform version (300acfb) and it works without issues.
The public place should be âBĂŒrök utcaâ as per fkf.hu/hulladeknaptar
Hi @amaximus âŠoh, hack⊠I missed that. It did the trick with âutcaâ instead of âu.â
In fact I recovered the last version from a snapshot and I copied my last faulty entry
Now Iâll make a âhealthyâ snapshot.
Thanks a million!
Hi @amaximus,
Iâve just discovered this cool integration and thought to ask for some help, since I got stuck with setting up the custom lovelace card. The best I could reach on the dashboard was a card with the name of the entity and the days until the next garbage collection. My custom cardâs location differs from the github example but not sure if this is the only reason why I cannot find it when editing the dashboard. â/hacsfiles/fkf-garbage-collection-card/fkf-garbage-collection-card.jsâ I have even tried to add the card to the dashboard with the configuration editor as a resource too with not much success.
I would appreciate any advice!
Cheers,
Csaba
Hi @csabatth,
first of all youâll have to have the custom platform e.g. installed from HACS or manually from [1].
Youâll then have to set the sensor up as per the example shown in [1]. Pay attention to how do you specify the address fields.
Then restart HACS to have the sensor in effect.
Once you see the sensor and its attributes under Developer Tools->States, specifying the sensor in the card configuration it should show the schedule.
Hi @amaximus,
Thanks for the quick response first of all! The sensor works fine and I can see all the upcoming garbage collection dates, my challenge is the proper card configuration apparently. When I try to add a new card to my dashboard then I cannot find the custom card downloaded from HACS, but I can of course add a new card manually based on the sensor entity. But it is nowhere near to your linked example i.e. there is only a single row and the remaining days is shown, thatâs it.
I have tried to add these lines to the configuration (with some minor modifications like sensor name, etc.) but it did not help either:
resources:
- {type: js, url: '/local/community/fkf-garbage-collection-card/fkf-garbage-collection-card.js'}
cards:
- type: custom:fkf-garbage-collection-card
entity: sensor.my_garbage_schedule
title: 'My garbage schedule'
icon_size: 35px
I assume that Iâm supposed to see the custom card when I try to add a new card to my lovelace dashboard, but this is not the case unfortunately. Did I miss something?
Cheers,
Csaba
Hi @csabatth,
please note that the resource definition should go into the configuration.yaml. The path should be /hacsfiles/fkf-garbage-collection-card/fkf-garbage-collection-card.js (I updated the Readme)
After adding/modifying it youâll have to restart HA in order to have it in effect.
Card definition should go into your Lovelace dashboard definition file (default: ui-lovelace.yaml).
Please also note that the card does not support configuration flow, thus youâll have to add the effective yaml-style definition.
Hi again amaximus,
I works as a charm, however the solution was somewhat different from that you had proposed.
I added the card configuration to my lovelace configuration (without the resurce part). Up until now I was trying to define the resource as part of the card configuration and I believe that this mistake was the root cause of my problem. However when I tried to add the resource part to the configuration.yaml I got an error message saying that integration called âresourceâ was not found or something. But it has turned out that this is not needed, maybe because my custom card is part of the resources already under the configuration-lovelace section.
Anyhow, it works now as expected, thanks for pointing me to the right direction and of course for creating this excellent integration!
Cheers,
Csaba
ps.:I could not attach yet another picture about the mentioned resource section under lovelace/resource
Iâm glad it got sorted out.
regards, Atticus
Oh this is excellent, thank you!
Do you accept feature requests?: https://www.fkf.hu/kerti-zoldhulladek-gyujtes