flabbamann / aha_region Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for aha (Abfallwirtschaft Region Hannover)
License: MIT License
Home Assistant custom component for aha (Abfallwirtschaft Region Hannover)
License: MIT License
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!
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?
Assign unique IDs so sensors can be managed via Home Assistant 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?
Test sensor.py
to ensure sensors are working as expected.
For some addresses you need to specify an Abholplatz
where the waste gets picked up.
Example: Dragonerstr 35, Hannover
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
Hello flabbamann,
danke für eine intregation, leider funktioniert diese bei mir nicht. vielleicht kannst du mir helfen.
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
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"
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
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!
All worked without problems but since the update the sensors were not available anymore.
I would be very thankful for any guidance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.