Code Monkey home page Code Monkey logo

fkf-garbage-collection's People

Contributors

amaximus avatar elmerenges avatar kobrakobrakobra avatar nagyrobi avatar nemethloci avatar norbim1 avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fkf-garbage-collection's Issues

green garbage schedule does not work

I am using your integration for a long time, and now I have added the last two options to enable the green garbage schedule, but it seems unavailable, how ever it should be every Wednesday.
.
This is my config in my sensors.yaml

  • platform: fkf_garbage_collection
    name: 'fkf_my_schedule'
    zipcode: '1171'
    publicplace: 'xxx'
    housenr: 'xxx'
    green: true
    greencolor: 'lila'

And these attributes of the sensor.fkf_my_schedule are available:

current: current
next_communal_days: 1
next_green_days: null
next_selective_days: 19
calendar_lang: en
provider: Data provided by fkf.hu
items: 6
in0: 1
day0: Friday
date0: 2024.03.22
garbage0: communal
in1: 8
day1: Friday
date1: 2024.03.29
garbage1: communal
in2: 15
day2: Friday
date2: 2024.04.05
garbage2: communal
in3: 19
day3: Tuesday
date3: 2024.04.09
garbage3: selective
in4: 22
day4: Friday
date4: 2024.04.12
garbage4: communal
in5: 29
day5: Friday
date5: 2024.04.19
garbage5: communal
icon: mdi:trash-can-outline
friendly_name: fkf_my_schedule

If HA versions are needed:
Core 2024.3.1
Supervisor 2024.03.0
Operating System 12.1
Frontend 20240307.0

Green waste collection day parsing

There are districts, where the green waste collection day depends on the address location, the collection in those districts is distributed for the several weekdays:

9 https://www.fkf.hu/kerti-zoldhulladek-korzetek-iv-kerulet
10 https://www.fkf.hu/kerti-zoldhulladek-korzetek-x-kerulet
14 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xiv-kerulet
15 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xv-kerulet
16 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xvi-kerulet
17 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xvii-kerulet
18 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xviii-kerulet
19 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xix-kerulet
20 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xx-kerulet
21 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xxi-kerulet
22 https://www.fkf.hu/kerti-zoldhulladek-korzetek-xxiii-kerulet

Currently the first day of a district's list is displayed in HA.

The solution might be challenging, as the color squares near the days are stored in images, and the polygons for the day are colored on a custom google map layer.

Two solution ideas:

  1. Ask FKF for a better data/API...
  2. Merge the green waste collection maps (via kml export?) to a common map and query the regions using the address - if it is possible.

Log of sensor

Hi amaximus,

tried to implement your sensor and card...but log shows the following:
Log Details (WARNING)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:284
First occurred: 9:52:47 PM (1 occurrences)
Last logged: 9:52:47 PM

Updating state for sensor.fkf_my_schedule (<class 'custom_components.fkf_garbage_collection.sensor.FKFGarbageCollectionSensor'>) took 2.034 seconds. Please report it to the custom component author.

Card sadly doesn't even appear. Is there a way to solve this?
Would be glad for any help here.
Btw. looks beautiful, can't wait to make it work. :-)

Cannot change language to Hungarian

Hi amaximus,

I couldn't set the calendar language to Hungarian.
Please see below my config.

platform: fkf_garbage_collection
name: 'fkf'
zipcode: !secret fkf_zipcode
publicplace: !secret fkf_publicplace
housenr: !secret fkf_housenr
offsetdays: 1
calendar: false
calendar_lang: hu
green: true
greencolor: rozsaszin

fkf-garbage-collection-card shows weekdays in English.

Could you give me a hint how to resolve this issue?
Thank you,
varmik

Certificate verification error

I receive the following error message when setting up the sensor:

aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host www.fkf.hu:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)')]

fkf changed its SSL cert recently issued by e-Szigno, I am not sure if this has anything to do with the above issue though.

FKF site down at HA start -> integration does not load

Lately we experience that FKF's website becomes unavailable for various periods of time. If somebody starts/restarts HA during such a period, the component does not load at all and generates this error in the log:

2021-11-08 19:20:30 ERROR (MainThread) [homeassistant.components.sensor] fkf_garbage_collection: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 651, in async_device_update
    await task
  File "/config/custom_components/fkf_garbage_collection/sensor.py", line 349, in async_update
    fkfdata = await async_get_fkfdata(self)
  File "/config/custom_components/fkf_garbage_collection/sensor.py", line 197, in async_get_fkfdata
    async with self._session.post(url, data=payload, headers=headers) as response:
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

The situation can only be recovered by restarting HA when FKF website is available.

My suggestion is to avoid this, is to handle this error, and load the component with the sensors set to unavailable and not current (maybe reload the last values from recorder). The component should re-check periodically for the site becoming available and update the sensors accordingly after that.

New Calendar Data model usage from 0.5.0

Hello,

I really like your development and used it without issue until now.
With the help of Custom Button Card and templating, I created some indication/warning cards on my Dashboard, but this change resulted in my own card representation does not work any more...
To make it work again, I would need to understand the new concept of the data model, but from the entity states viewer I could not find out what to expect.

I can share the code of the card if that helps in understanding my problem.

Thanks in advance

2024.2.5 HA no data probléma

sensor:

  • platform: fkf_garbage_collection
    name: "kukat_kivinni"
    zipcode: "1141"
    publicplace: "Vágsellye utca"
    housenr: "4"

kártya
type: custom:fkf-garbage-collection-card
entity: sensor.kukat_kivinni
icon_size: 35px
items_number: 1
hide_wday: true
due_1_color: red
hide_before: 1

2021.12 error

2021-12-12 11:04:27 ERROR (MainThread) [homeassistant.components.sensor] fkf_garbage_collection: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 684, in async_device_update
    await task
  File "/config/custom_components/fkf_garbage_collection/sensor.py", line 369, in async_update
    fkfdata = await async_get_fkfdata(self)
  File "/config/custom_components/fkf_garbage_collection/sensor.py", line 271, in async_get_fkfdata
    _LOGGER.debug("Fetch info for %s/%s/%s: %s", self._zipcode, self._publicplace, self._housenr, s)
UnboundLocalError: local variable 's' referenced before assignment

card ok but no data

type: custom:fkf-garbage-collection-card
card_mod:
style: |
ha-card {
background: lightgrey;
box-shadow: none;
color: red
}
entity: sensor.fkf_my_schedule
title: Kuka
icon_size: 35px

The sensor state gets 'unknown'

I see the integration updates sensor once per hour. But if for some reason it could not update the sensor it stays as 'unknown' till the next refresh (actually, only two 'next' fields are at 'null', the rest are not updated, see below). Also, I could not find any error message in log for this unsuccessful update event. My router is usually off during night and I see corresponding connectivity issues in log for this period. But this issue occurred during day, when the internet is on and no log msg, maybe there is another bug?

items: 6 in0: 1 day0: Friday date0: 2022.01.07 garbage0: communal in1: 8 day1: Friday date1: 2022.01.14 garbage1: communal in2: 14 day2: Thursday date2: 2022.01.20 garbage2: selective in3: 15 day3: Friday date3: 2022.01.21 garbage3: communal in4: 22 day4: Friday date4: 2022.01.28 garbage4: communal in5: 29 day5: Friday date5: 2022.02.04 garbage5: communal current: current next_communal_days: null next_selective_days: null calendar_lang: en provider: Data provided by fkf.hu icon: mdi:trash-can-outline friendly_name: fkf_garbage_schedule

How 'green' item should be seen among the sensor data element?

I use this integration for a while with own UI card. But I have never seen the 'green' garbage schedule is appeared in the sensor, considering the green: true in my configuration.yaml of course. How can I catch it?
Below what I have at the moment, there are only communal or selective items:

items: 7
in0: 0
day0: Thursday
date0: 2023.07.06
garbage0: selective
in1: 1
day1: Friday
date1: 2023.07.07
garbage1: communal
in2: 8
day2: Friday
date2: 2023.07.14
garbage2: communal
in3: 15
day3: Friday
date3: 2023.07.21
garbage3: communal
in4: 22
day4: Friday
date4: 2023.07.28
garbage4: communal
in5: 28
day5: Thursday
date5: 2023.08.03
garbage5: selective
in6: 29
day6: Friday
date6: 2023.08.04
garbage6: communal
current: current
next_communal_days: 1
next_green_days: null
next_selective_days: 0
calendar_lang: en
provider: Data provided by fkf.hu
icon: mdi:recycle
friendly_name: fkf_garbage_schedule

Calendar integration

It would be good if garbage collection dates could be integrated into native HA calendar. I think you should inherit from CalendarEventDevice instead of Entity.

Compatibility with 2023.6

Szia Attila,

Nem tudom jelezte-e már valaki, de nekem úgy tunik, hogy a 2023.6-os update "eltörte" az integrációt, 5.4-re történö visszaállás után ismét muködik.

Köszönöm ha foglalkozol vele.

Udv.

Csaba

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.