Blueprint Flex D

Home-Assistant Blueprint for Flex D

Home-Assistant Blueprint

A Home-Assistant blueprint that connects the critical peak events of your Flex D (DPC) calendar to your own pre-heat and consumption-reduction actions. It can be installed directly with the following button:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

The blueprint source is available here. To import it manually, go to Settings > Automations & scenes > Blueprints > Import blueprint and paste that URL.

How it works

The blueprint is a single automation with four calendar triggers on the calendar selected in the integration options:

TriggerFires
Pre-heat (morning)preheat_offset_morning before an event starting before 12:00
Pre-heat (evening)preheat_offset_evening before an event starting at 12:00 or later
Peak startcritical_peak_offset before the event start
Peak endAt the event end

All four triggers only run when the event summary contains pointe and the description contains Tarif: DPC, so events from other calendars or other rates are ignored. Each action also requires the event to be a critical peak (Critique: Oui in the description). The integration only writes critical peaks to the calendar, so this always matches for synced events.

The automation runs in parallel mode, which allows a new peak to be handled while the actions of the previous one are still running.

Prerequisites

  • Hydro-Québec integration configured with the DPC (Flex D) rate
  • A dedicated local calendar selected in the integration options, so the integration can write the peak events to it (see Setup)
  • The blueprint imported

Inputs

InputDefaultDescription
Calendrier Hydro-Québec–Calendar entity to watch. Select the same calendar as in the integration options
Délai de pré-chauffage (matin)-02:00:00How long before a morning peak the pre-heat action starts. -HH:MM:SS, so -01:30:00 for 90 minutes
Délai de pré-chauffage (soir)-02:00:00Same, for evening peaks
Délai avant début pointe critique-00:01:00How long before the official start the peak-start action runs. Keeps devices settled before the peak
Action de pré-chauffage (matin)Persistent notificationActions to run before a morning peak
Action de pré-chauffage (soir)Persistent notificationActions to run before an evening peak
Action début pointe critiquePersistent notificationActions to run when the critical peak starts
Action fin pointe critiqueRandom delay, then persistent notificationActions to run when the critical peak ends

The offsets are computed from the calendar event itself, so a change announced by Hydro-Québec automatically moves the actions. Offsets must be negative values in the -HH:MM:SS format.

Peak events written by the integration

For every upcoming critical peak, the integration creates one event in the configured calendar:

  • Summary: an icon followed by Pointe critique
  • Location: Hydro-Québec DPC
  • Description:
Réduisez votre consommation d'électricité pendant cette période.

Début: 06:00
Fin: 10:00

--- Métadonnées ---
Ajouté le: 2026-01-15 08:12:34 EST
Tarif: DPC
Critique: Oui
ID: hydroqc_123456789_2026-01-16T06:00:00-05:00

The Tarif and Critique metadata lines are what the blueprint filters on. Regular peaks are not added to the calendar, and events added manually with the hydroqc.create_peak_event service use the same format.

Testing calendar automations

Recommendations

  • Wrap your actions in parallel: rather than a plain sequence. A failing action then does not prevent the following ones from running:

    parallel:
      - action: climate.set_temperature
        target:
          entity_id: climate.thermostat
        data:
          temperature: 21
      - action: light.turn_on
        target:
          entity_id: light.office
    
  • Keep the random 30 seconds to 5 minutes delay in the end action, and spread similar delays between your own restart actions. Without it, thousands of devices restart at the same second and create a new demand peak.

  • For complex logic, use the blueprint only as a trigger (calendar trigger or a separate automation) instead of adding many conditions to it. It stays easier to maintain and debug.

  • The default end action only sends a notification. Add your real actions there before relying on it.