Support for Hydro-Québec (Tariff D / Flex D): not based on power, tiered consumption model

Hello @lmilcent,

Thanks for this very complete topic, it’s perfect timing! :raising_hands:

I’m currently overhauling the energy tracking in Gladys (I presented it here: API : permettre aux intégrations externes de déclarer leurs propres types de contrat énergie - #3 par pierre-gilles).

Contracts are no longer limited to Base / Off-Peak / Tempo: each contract is described by rules, and this covers exactly the points you raise.

Tariff D: this will be possible directly

  • No subscribed power: this field becomes optional.
  • Consumption tiers: « the first 40 kWh of the day at one price, the rest at another » is managed natively.
  • Daily access fees: a fixed amount per day.
  • Canadian dollar: each contract has its own currency (CAD, USD, EUR…).

Concretely, with the prices from your message, Tariff D is written like this:

{
  "tariff_version": 1,
  "components": [
    {
      "key": "energy",
      "kind": "consumption",
      "rules": [
        { "label": "First 40 kWh of the day", "when": { "tier": { "cumulative": "day", "from_kwh": 0, "to_kwh": 40 } }, "price": 0.07065 }
      ],
      "fallback": { "label": "Beyond 40 kWh", "price": 0.11142 }
    },
    { "key": "access", "kind": "fixed", "amount": 0.46154, "per": "day" }
  ]
}

You’ll be able to paste it into Gladys’ contract editor, and it can also be added to the community catalog so everyone can have it in one click.

Flex D: the calculation is planned, the source of critical peaks is missing

The calculation itself is covered: winter period from December 1st to March 31st, reduced price outside peak hours, high price during critical peak events. But since the events are announced the day before, something needs to retrieve them and transmit them to Gladys.

This will be the role of an external integration, which publishes the peak days in a « calendar » that the contract uses. Everything is planned in Gladys for this, but this integration still needs to be written.

Two questions to make sure it matches your bill

  1. For the 40 kWh threshold, does Hydro-Québec calculate it day by day, or as « 40 kWh × number of days » over the entire billing period? This slightly changes the result on days where you exceed 40 kWh.
  2. For Flex D, can you confirm the time slots of the peak events, and if the 40 kWh tiers also apply during the winter?

It’s not out yet, it’s being reviewed before a next version.