Coder Social home page Coder Social logo

homeassistant-recycleapp's Introduction

Home Assistant RecycleApp Integration

hacs_badge Quality Gate Status

Integrate RecycleApp into your Home Assistant.

Installation

  • Install HACS Repository:

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

  • Restart Home Assistant
  • Install the Integration:

Open your Home Assistant instance and start setting up a new integration.

  • Complete the setup process:

image

Date Format

By default, dates are in Home Assistant date format: %Y-%m-%d

You can customize the format in the configure of the device:

image

The formatting is based on Python date formatting.

You can also set the Date Format as TIMESTAMP to display relative dates, such as "in 2 days" or "next week". This option uses Home Assistant's built-in timestamp formatting and localization features.

Usage Samples

Dashboard with next pickups

With entity-filter: entity-filter

type: entity-filter
entities:
  - sensor.pmc
  - sensor.papier
  - sensor.dechets_non_recyclables_sac
  - sensor.dechets_biodegradables
state_filter:
  - operator: <=
    value: 1
    attribute: days
card:
  type: entities

Templates

templates

Tomorrow's Pickup(s)

Template helper

tomorrows

Code:

{% set tomorrow_pickups = namespace(entities=[]) %}
{% set collect_types = ['sensor.dechets_non_recyclables_sac', 'sensor.pmc', 'sensor.papier'] %}
{% for collect_type in collect_types %}
  {% if state_attr(collect_type, 'days') == 1 %}
    {% set tomorrow_pickups.entities = tomorrow_pickups.entities + [state_attr(collect_type, 'friendly_name')] %}
  {% endif %}
{% endfor %}
{{ tomorrow_pickups.entities |join(' - ') }}

Notification

alias: Waste collection
description: ""
trigger:
  - platform: time
    at: "19:00:00"
condition:
  - condition: template
    value_template: >-
      {% if is_state('sensor.tomorrow_s_pickup_s', '') %}false{% else %}true{%
      endif %}
action:
  - service: notify.mobile_app_poco_f5
    data:
      message: Tomorrow waste collection of {{states('sensor.tomorrow_s_pickup_s')}}
mode: single

Thanks to @MathiasVandePol for the sample.

Bug, ideas?

If some collections are missing, you find a bug or have enhancement ideas don't hesitate to open an issue.

homeassistant-recycleapp's People

Contributors

dependabot[bot] avatar misa1515 avatar olibos avatar

Stargazers

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

Watchers

 avatar

homeassistant-recycleapp's Issues

coroutine was never awaited

This error originated from a custom integration.

Logger: py.warnings
Source: custom_components/recycle_app/calendar.py:173
integration: RecycleApp (documentation, issues)
First occurred: 18:38:36 (1 occurrences)
Last logged: 18:38:36

/config/custom_components/recycle_app/calendar.py:173: RuntimeWarning: coroutine 'CalendarEntity.async_will_remove_from_hass' was never awaited super().async_will_remove_from_hass()

Some Collections are missing

Hi!
Thanks for this nice integration.

With my address in Quaregnon (post code 7390), I only have two entities : "paper & cardboard" (papier et cartons) and "glass" (verre).

I don't get info or entities about PMC and regular wastes (ordures ménagères).

Thanks

Change date format

With the previous version I was able to change the date format. Now I can't get it to work. I want to display something like this: 18 April

Deprecation Home Assistant 2024.5

Version of the custom_component

v2.5.0-b1

Version of Home Assistant

2024.5.0b0

Describe the bug

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 23:03:10 (6 occurrences)
Last logged: 23:04:28

Detected that custom integration 'recycle_app' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/recycle_app/calendar.py, line 153: self._remove_change_listener = async_track_state_change(, please create a bug report at https://github.com/olibos/HomeAssistant-RecycleApp/issues

Feature request "next pickup"

Hello,

Would it be possible to add an entity called "next pickup" with the nearest pickup only? Well that would be great, like this we can add a card with only 1 entity instead of all entities without struggling a lot with custom entities and conditional cards.

Kind regards,

Integration is using deprecated `DEVICE_CLASS_*` constants

This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

Kindest regards,

../Frenck

TIMESTAMP instead of DATE device class?

Could you please consider changing or adding the option to have the device class as timestamp instead of date?
It allows to have the UI taking care of nicely displaying a relative time (and the date still available in the more-info dialog):
image

Enhancement: Number of days before the next collection

Thanks for your integration ! It's always great to integrate stuffs related to our country.

I was previously using the popular Garbage Collection integration for this purpose (https://github.com/bruxy70/Garbage-Collection).

Its entities have an attribute named Days to tell the number of days before the next collection.

I know I can create a sensor for this but it would be great if it could be part of the integration itself !

Thanks for your work :)

icon colours

Hi,

the icons are almost invisible on a dark theme, ie. noctis gray dark.

Would be nice to have light-coloured icons too.

Thanks

Got message "Failed to register, please try again."

Hello,

Did not work with my home address. Can provide screen shot privately if needed.
Went to https://recycleapp.be/ inputed my address to see that I did not cause the issue with wrong address.....
Copy/pasted information to youa App.
Got message "Failed to register, please try again."
Please let me know if I can be of any assistance.
Bye,
Carlo.

Bug in original apps API creates duplicates

As explained in this issue from another integration here pippyn/Home-Assistant-Sensor-Afvalbeheer#367 (comment), the original Recycle App API sometimes creates duplicates in the data returned, and they're not going to fix it. It also affects this integration, especially the calendar entity:
image

Duplicated events are returned for PMC (here using service: calendar.get_events, see two first events):

calendar.ceroux:
  events:
    - start: "2024-02-15"
      end: "2024-02-16"
      summary: Céroux PMC
    - start: "2024-02-15"
      end: "2024-02-16"
      summary: Céroux PMC
    - start: "2024-02-15"
      end: "2024-02-16"
      summary: Déchets organiques
    - start: "2024-02-20"
      end: "2024-02-21"
      summary: Déchets organiques
    - start: "2024-02-15"
      end: "2024-02-16"
      summary: Ordures ménagères résiduelles
    - start: "2024-02-20"
      end: "2024-02-21"
      summary: Ordures ménagères résiduelles

The two first entries are duplicates and therefore repeat in the calendar view. So the integration should ideally correct the API bug by filtering out the duplicates when creating the events (preferably already when fetching the data).

can not install recycle app

i get the error: Fout tijdens initialisatie, probeer het opnieuw when I give in all the fields. it was ok before.

Readme example: screenshot without code

A bit strange to see the "device-filter" sample card in the Readme.md to feature a screenshot (including a screenshot of the code itself), but no way to copy the code.

Here it is (in Dutch rather than the French in the screenshot):

type: entity-filter
entities:
  - sensor.pmd
  - sensor.papier_karton
  - sensor.huisvuil_diftar
  - sensor.kerstbomen
  - sensor.snoeihout
  - sensor.gft_diftar
state_filter:
  - operator: <=
  - value: 1
  - attribute: days
card:
  type: entities

(By the way, if anyone sees a way to improve this card by ordering it chronologically by next pickup date, I'd be interested.)

Thanks!

Date Format

Hi,

Would it be possible to change data format to DD-MM-YYYY.
image

but on my phone i can only see the year.
Regards

Issue with integration

I’m a complete noob regarding coding so please correct me if I’m doing something wrong, but after adding this in HACS and as an integration, I configure my address (which works) and then have no idea how to proceed.

No devices show up in HA, nor any entities..

I’ve removed the config with my address and set a new one by adding a device, and still nothing shows up.

Number of days until collection + Enhancement Suggestion

Thank you for creating the integration for RecycleApp.

I was reviewing previous enhancements and noticed that in version 1.4.0, there was an option to include the number of days until garbage collection. However, when I checked the integration page on RecycleApp, I only saw the option to view garbage entities.

Did I miss something?

As a suggestion, I would like to request the addition of a "today" and "tomorrow" sensor. This would provide more context and make it easier for users to know when their garbage will be collected.

Kind greetings

How to use the date format relatively?

Hello,

First of all, thanks for this integration, as someone with next to no coding knowledge this saved my life, inputting this data into home assistant is very nice.

You mention on the github page that it is possible to format the date relatively, to have the PMD sensor display: "in 2 days", instead of date/month/year. How do I do this? I've looked into the python date/time formatting but am at a complete loss, and also cannot find anything about the innate HA time templates you mentioned..

I tried a workaround creating template sensors which do the correct thing (see example), but in this case I lose the nice looking custom icons, which I definitely want to use, as otherwise I'd have to come up with custom icons somehow.

Example of my current format on the first row, and using template sensors on the second row, I'd like the timestamps combined with the icons:
image

Thanks in advance!
Kind regards,
Joris

Adding integration results in error

HA version:
Core 2024.4.0
Supervisor 2024.03.1
Operating System 12.1
Frontend 20240403.1

Trying to add the recycle app results in error:
This integration does not support configuration via the UI. If you followed this link from the Home Assistant website, make sure you run the latest version of Home Assistant.

Can't install

I can't install the integration (yes, I do have HACS).
When I click on "Add integration" from this page (http://homeassistant.local:8123/hacs/repository/562404203), it asks to open the page in Home Assistant. After clicking "open link", it moves to my Home Assistant and then I get the following error :

This integration does not support configuration via the UI. If you followed this link from the Home Assistant website, make sure you run the latest version of Home Assistant.

I have the following HA versions installed:
Core2024.9.1
Supervisor2024.08.0
Operating System13.1
Frontend20240906.0

Invalid street name

Hello,

I just installed v1.5.0 of your custom component but when trying to set it up for my home address, it keeps telling me "Invalid street name". My postal code is 9200 (Sint-Gillis-bij-Dendermonde) and my street name is Heirbaan.
I tried setting it up with my parents' address in 9280 Lebbeke and it worked just fine. My address also works just fine in the Recycle app and on their website.

Any clue as to what could be wrong?

Regards,
David

Warning: Detected code that calls async_forward_entry_setup

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:151
First occurred: 00:28:51 (7 occurrences)
Last logged: 00:30:33

Detected code that calls async_forward_entry_setup for integration recycle_app with title: 7 Gildenstraat, 2470 - Retie and entry_id: c8a3d728c994a46553b6290280963749, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

Restafval missing

I currently only see sensors for GFT, Papier and PMD. Can at least restafval be added as well and/or make it an option in the config flow?

Error when adding integration

When I add the integration to HA and fill out my address data the exception below occurs when I press the submit button.

2024-09-04 12:49:26.137 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _chain_future.<locals>._set_state(<Future pendi...ask_wakeup()]>, <Future at 0x...StopIteration>) at /usr/local/lib/python3.12/asyncio/futures.py:381 (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/asyncio/futures.py", line 383, in _set_state
    _copy_future_state(other, future)
  File "/usr/local/lib/python3.12/asyncio/futures.py", line 359, in _copy_future_state
    dest.set_exception(_convert_future_exc(exception))
TypeError: StopIteration interacts badly with generators and cannot be raised into a Future

The same error occurs every time I add the integration, network is OK, settings.json can be reached (from browser).

HA core is at 2024.8.3

ILVA - missing city?

Hi,

Installed RecycleApp in Home Assistant and configured it according to my situation. So I am living in Geraardsbergen in Belgium and entered postal code 9500. Based on that, it gives me the correct list of related recycle parks but when I want to choose 'Geraardsbergen' from thie list, it is not in the list. The list only contains: Aalst 1, Aalst 2 (Hofstade), Affligem, Denderleeuw, Galmaarden, Herzele, Ninove, Oosterzele, Sint-Lievens-Houtem and Zottegem.

Any reason why 'Geraardsbergen' is not showing in the list eventhough it is part of the ILVA-group?

Regards
Marc Engrie
Screenshot 2024-03-19 202157

Missing "Green waste"

Hello,

This integration is working very well. I'm just missing green waste in my case.
Don't know if someone else is missing it too ?

Kind regards,

feature request: "is tomorrow" sensors

First and foremost: thanks for taking the time to create this integration.

I just installed it and works without issues.
On my dashboad, I would like to add sensor if collection is tomorrow.
I know I can check the days attribute, tested in Developer > Templates and that'll work fine.

A great addition to help everyone using this would be extra sensors if collection is 'tomorrow' (and maybe also for 'today' is someone want to trigger on the day itself). I know it can be done with template sensor. When I have these I can add them to the readme if you prefer that.

Initialization fails

Hi,

Initialization fails after entering my adresse (adress is working in !Recycle App).

I get the following error :

image

Here is the error from the log :

Logger: custom_components.recycle_app.config_flow
Source: custom_components/recycle_app/config_flow.py:61
Integration: RecycleApp (documentation, issues)
First occurred: 15:22:35 (2 occurrences)
Last logged: 15:26:54

Failed to register 'NoneType' object is not subscriptable

HA Version :

Home Assistant 2023.5.2
Supervisor 2023.04.1
Operating System 10.0
Interface utilisateur : 20230503.3 - latest

Don't hesite if you need more informations/context.

Regards,

Vincent

App entities in error.

The entities of the app are constantly in error with message:
This entity is no longer being provided by the recycle_app integration. If the entity is no longer in use, delete it in settings.
I reload the integration and sometimes it fixes the issue but then after a while I get the same error.

How you install this

Hello Olivier

I installed your repository via HACS into my homeassistent.
But what is thé next step? Somewhere you should specify my home adres.... Bug you do not mention where.
When adding this repository no configuration-questions where asked.
So what do i have to do?
Thx

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/hacs.yml
.github/workflows/hassfest.yml
  • actions/checkout v4
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v6
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

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.