Skip to content

Frazou1/ville_qc_collecte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ville_qc_collecte

Ville_qc_collecte is a Home Assistant add-on that scrapes the Ville de Québec Info-Collecte website (using Selenium) to determine the next garbage (ordures/résidus alimentaires) and recycling (recyclage) collection dates. The add-on then publishes these dates as MQTT sensors, making them available in Home Assistant.


How it works

  1. Headless browser (Selenium):
    The add-on launches a headless Chromium browser to load the Ville de Québec Info-Collecte page and automatically enters your address.
  2. HTML parsing (BeautifulSoup):
    Once the calendar is displayed, the add-on parses the HTML to find upcoming pickup dates for ordures/résidus alimentaires and recyclage.
  3. MQTT sensor publishing:
    Using MQTT Discovery, the add-on publishes states and attributes for two sensors:
    • sensor.collecte_ordures
    • sensor.collecte_recyclage
      so Home Assistant can automatically detect and display them.

Installation

  1. Add this repository to Home Assistant as an Add-on repository:

    • Go to SettingsAdd-onsAdd-on Store → the three dots menu () → Repositories → enter this repo's URL.
    • Or click the button below:

    Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

  2. Install the add-on named Ville_qc_collecte from your local add-ons list.

  3. Configure the add-on (address to search, update interval, MQTT settings, etc.).

  4. Start the add-on and check the logs. You should see it fetching the Info-Collecte calendar and publishing sensor data via MQTT.


Configuration Options

Key Description Default
address The address to look up "123 rue des tulippes"
update_interval How frequently (in seconds) to re-check the Info-Collecte site 3600 (1 hour)
mqtt_host The MQTT broker hostname "core-mosquitto"
mqtt_port The MQTT broker port 1883
mqtt_username Username for MQTT (if any) ""
mqtt_password Password for MQTT (if any) ""

Automation Exemple

trigger:
  - platform: state
    entity_id: sensor.collecte_status
    to: "error"
action:
  - service: notify.persistent_notification
    data:
      title: "Ville QC Collecte"
      message: "Le scraping a échoué."

Architectures

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture


Community & Support


About

ville_qc_collecte

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published