Skip to content

Home Assistant integration for the city of Saguenay's waste collection schedule

Notifications You must be signed in to change notification settings

DavidBilodeau1/saguenay_collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saguenay Waste Collection Schedule

GitHub Release License

hacs

Home Assistant Integration for Saguenay's Waste Collection.

Work in Progress

Supported Features:

  • Track the collection dates for garbage, recycling and compost

Installation

Recommended: HACS

  1. Add this repository as a custom repository to HACS: Add Repository
  2. Use HACS to install the integration.
  3. Restart Home Assistant.
  4. Set up the integration using the UI: Add Integration

Alternative: Manual

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called saguenay_collection.
  4. Download all the files from the custom_components/saguenay_collection/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Saguenay Collection Schedule"

Configuration is done in the UI

Template to display in Home Assistant

To display the next waste collection date as something more user-friendly, I made a YAML template:

  {% set t = now() %} # compare with now
  {% set midnight = today_at() %}
    # convert sensor value as y-m-d to datetime
  {% set event_date = as_local(states('sensor.saguenay_récupération_schedule') | as_datetime('%Y-%m-%d')) %}
  {% if event_date %}
    {% set delta = (event_date - midnight).days %} # get difference in days
    {% if delta == 0 %}
      Aujourd'hui
    {% elif delta == 1 %}
      Demain
    {% elif delta == 2 %}
      Après demain
    {% else %}
      Dans {{ delta }} jours
    {% endif %}
  {% else %}
    Date invalide
  {% endif %}

View gist

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines


About

Home Assistant integration for the city of Saguenay's waste collection schedule

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages