Skip to content

This is the HRA Recycling integrations for Home Assistant

License

Notifications You must be signed in to change notification settings

mr-raw/hra_recycling

Repository files navigation

HRA Recycling

buymecoffee validate_url Discord

What is this?

This is a Home Assistant integration for the Norwegian waste collection company HRA (Hadeland Ringerike Avfallsselskap). You can track the pickup dates for the different fractions (Plastic, bio, glass/metal and unsorted waste)

Installation

This integration is currently in development. Basic functionality is up and running. Please create an issue if you encounter bugs.

Version plans

  • 0.1.0 First release. Will have basic functionality. All the fractions will be shown. User mistakes will not be accounted for. This will break the integration and throw errors around.
  • 0.1.1 Small changes to the code. Did some refactoring. Using httpx instead of aiohttp.
  • 0.1.2 Fixed a templating issue in the README. Preparing for more customization in the setup process.
  • 1.0.0 Final release. You can choose which fractions to track. The integration has been thorougly tested.

Setup and configuration is done in the UI

Examples

This example creates template sendor that shows how many days until pickup of the provided fraction:

template:
  - sensor:
      - name: "Days Until Garbage Pickup"
        state: >
          {% set garbage_pickup_date = as_timestamp(states('sensor.restavfall')) %}
          {% set days_until = (garbage_pickup_date - as_timestamp(now())) // 86400)|round %}
          In {{ days_until }} days

This example sends a notification to your cellphone at 18:00 the day before the date in the provided fraction sensor (Remember to change the name of the mobile phone entity):

automation:
  - alias: Notify the day before garbage pickup
    description: Sends a notification at 18:00 the day before the date specified in the sensor
    trigger:
      - platform: time
        at: "18:00:00"
    condition:
      - condition: template
        value_template: "{{ (as_timestamp(now()) + 86400)|timestamp_custom('%Y-%m-%d') == states('sensor.restavfall')[0:10] }}"
    action:
      - service: notify.<mobile_phone>
        data:
          message: "Reminder: Garbage pickup is tomorrow."
          title: "Pickup Reminder"
    mode: single

Contact

If you have any questions, feel free to reach out to me on Discord