Code Monkey home page Code Monkey logo

aha_region's People

Contributors

dependabot[bot] avatar derolli1976 avatar dunklestoast avatar flabbamann avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

aha_region's Issues

TypeError: 'NoneType' object is not subscriptable in AhaWasteSensor class constructor

When attempting to use the aha_region in Home Assistant, I am encountering the following error message:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
tasks = [
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in <listcomp>
tasks = [
File "/config/custom_components/aha_region/sensor.py", line 73, in <genexpr>
AhaWasteSensor(coordinator, wastetype, baseid) for wastetype in ABFALLARTEN
File "/config/custom_components/aha_region/sensor.py", line 90, in __init__
native_value = self.coordinator.data[self._attr_name]
TypeError: 'NoneType' object is not subscriptable

This is how the definition in configuration.yaml looks like, I tried both my own address and the one used as an example in the README, with the same result (the error above):

- platform: aha_region
  gemeinde: "Hannover"
  strasse: "00152@Am Küchengarten / Linden-Mitte@Linden-Mitte" # value from dropdown
  hausnr: 11
  hausnraddon: "a" # optional, remove if not needed for your address!

Error when setting up, even with example data

I tried to setup with my address and failed. But even when entering the example data from the docu into my configurtation.yaml, I get the following error after restarting HA:

Logger: custom_components.aha_region
Source: helpers/update_coordinator.py:197
Integration: aha region ([documentation](https://github.com/flabbamann/aha_region), [issues](https://github.com/flabbamann/aha_region/issues))
First occurred: 06:32:15 (1 occurrences)
Last logged: 06:32:15
Timeout fetching aha Region data
Logger: homeassistant
Source: custom_components/aha_region/sensor.py:77
Integration: aha region ([documentation](https://github.com/flabbamann/aha_region), [issues](https://github.com/flabbamann/aha_region/issues))
First occurred: 06:32:25 (1 occurrences)
Last logged: 06:32:25
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in async_add_entities
    tasks = [
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in <listcomp>
    tasks = [
  File "/config/custom_components/aha_region/sensor.py", line 62, in <genexpr>
    AhaWasteSensor(coordinator, wastetype) for wastetype in ABFALLARTEN
  File "/config/custom_components/aha_region/sensor.py", line 77, in __init__
    self._attr_native_value = self.coordinator.data[self._name]
TypeError: 'NoneType' object is not subscriptable

Anything I am doing wrong?

Add unique IDs

Assign unique IDs so sensors can be managed via Home Assistant GUI.

Configuration via GUI

First of all, thank you so much for this! Please publish a way to express my gratitude as a small donation to show my appreciation!

Small suggestion: as HA moves towards fully in-GUI config, I was wondering if a method to implement an in-GUI config to enter the needed data now located in config.yaml is on your roadmap?

More Tests

Test sensor.py to ensure sensors are working as expected.

Support for "Abholplatz"

For some addresses you need to specify an Abholplatz where the waste gets picked up.

Example: Dragonerstr 35, Hannover

Days to collection Sensor

Hey!
First of all, thanks for this nice integration.

I've build a sensor in configuration for display how many days until colletion date.
Feel free to use it, too.

template:
  - sensor:
      - name: "Abholung Restmüll"
        unique_id: "abholung_restmuell"
        unit_of_measurement: "Days"
        icon: mdi:trash-can
        state: >
            {% set days_to = (((as_timestamp(strptime(states('sensor.restabfall'), "%Y-%m-%d")))  - as_timestamp(now())) / 86400) | round(0, "ceil", default)%}
            {% if days_to == 0 %}Heute{% elif days_to == 1 %}Morgen{% else %}in {{days_to}} Tagen{% endif %}

Greetings
torsti09

no Sensor

Hello flabbamann,
danke für eine intregation, leider funktioniert diese bei mir nicht. vielleicht kannst du mir helfen.

  • ordner unter custom_components ist erstellt.
  • unter intregationen findet man diese auch, aber man kann diese ja nicht hinzufügen. => normal
  • config angepasst mit einen werten... aber es wird kein neuer Sensor angelegt.

Hätte da eine Idee. Mein Stadtteil hat umlaute. Könnte das vielleicht der Grund sein?
Meine Strasse ist: "01923@Marthastr. / Wülfel@Wülfel"

Könntest du das vielleicht prüfen und mir Feedback geben.
Danke für deine Hilfe.
Moritz

Integration crashes if not all waste types listed

At some addresses not all waste types are collected, this leads to errors, as the integration expects all waste types to be listed.

Example config where only Papier and Leichtverpackungen are collected:

sensor:
  - platform: aha_region
    gemeinde: "Hannover"
    strasse: "00726@Dragonerstr. / Vahrenwald@Vahrenwald"
    hausnr: 35
    abholplatz: "00726-0037B" 

Error since latetst HA update: "Unexpected error fetching aha Region data: list index out of range"

Since the lateste HA update, I get the following errors on HA restart and the AHA sensors don't show up. Everything was running before with the same config.

Logger: custom_components.aha_region
Source: custom_components/aha_region/coordinator.py:47
Integration: aha region ([documentation](https://github.com/flabbamann/aha_region), [issues](https://github.com/flabbamann/aha_region/issues))
First occurred: 06:28:24 (1 occurrences)
Last logged: 06:28:24

Unexpected error fetching aha Region data: list index out of range 

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/aha_region/coordinator.py", line 77, in _async_update_data
    response = await self.api.get_data()
  File "/config/custom_components/aha_region/coordinator.py", line 47, in get_data
    table = soup.find_all("table")[0]
IndexError: list index out of range
Logger: homeassistant
Source: custom_components/aha_region/sensor.py:77
Integration: aha region ([documentation](https://github.com/flabbamann/aha_region), [issues](https://github.com/flabbamann/aha_region/issues))
First occurred: 06:28:41 (1 occurrences)
Last logged: 06:28:41

Error doing job: Task exception was never retrieved 

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 414, in async_add_entities
    tasks = [
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 414, in <listcomp>
    tasks = [
  File "/config/custom_components/aha_region/sensor.py", line 62, in <genexpr>
    AhaWasteSensor(coordinator, wastetype) for wastetype in ABFALLARTEN
  File "/config/custom_components/aha_region/sensor.py", line 77, in __init__
    self._attr_native_value = self.coordinator.data[self._name]
TypeError: 'NoneType' object is not subscriptable

sensor.restabfall not provided at my location

Hi,

first of all, thank you for this very cool integration!

Unfortunately I do not get the date for "Restabfall" collection at my location. Everything works fine with the example address provided. However I believe that aha seems to call the type of waste differently in Garbsen: "Restabfall 660/1.100 Liter". Would there be a way to use that information within the integration?

Thank you for your support!

Sensors gone since core 2024.1.6

All worked without problems but since the update the sensors were not available anymore.

I would be very thankful for any guidance

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.