Home Assistant Custom Integration

Install the hydroqc-ha custom integration for Home Assistant (Recommended)

Why choose hydroqc-ha?

  • Native integration: Runs as a Home Assistant custom component
  • Easy configuration: Setup entirely through the Home Assistant interface
  • Full feature support: Consumption, billing, winter credits and dynamic pricing
  • Multiple contracts: One device per Hydro-Québec contract
  • Diagnostic entities: Optional entities for troubleshooting and advanced automations

Installation

Prerequisites

Make sure HACS is installed on your Home Assistant instance. If not:

  1. Follow the HACS installation guide
  2. Restart Home Assistant after installing HACS

Install the integration

Option A: One-click installation

Open your Home Assistant instance and open the repository in HACS.

Click the badge above to add the repository to HACS, then:

  1. Click “Download” (or “Install”)
  2. Restart Home Assistant

Option B: Manual installation via HACS

  1. Open HACS in Home Assistant
  2. Click on Integrations
  3. Click the three-dot menu in the top right corner
  4. Select “Custom repositories”
  5. Add the repository URL: https://github.com/hydroqc/hydroqc-ha
  6. Select category: Integration
  7. Click “Add”
  8. Search “Hydro-Québec” in the HACS integrations list
  9. Click on the Hydro-Québec integration
  10. Click “Download” (or “Install”)
  11. Restart Home Assistant

Note: after restarting, you still need to configure the integration (see the Configuration section below).

Manual installation

  1. Download the latest release from GitHub Releases
  2. Extract the hydroqc folder into your custom_components directory
  3. Restart Home Assistant

Configuration

The first step asks which connection mode to use: Portal Mode (requires login) for a Hydro-Québec account, or OpenData Mode (no login required) for public peak data without credentials.

Option 1: Portal Mode (Hydro-Québec account)

  1. Go to Settings > Devices & Services
  2. Click + Add Integration
  3. Search Hydro-Québec
  4. Select Portal Mode (requires login)
  5. Enter your credentials:
    • Username: Hydro-Québec email
    • Password: Hydro-Québec password
    • Contract name: a friendly name (e.g., “Home”, “Cottage”)
  6. Select the contract to monitor
  7. Choose how many days of consumption history to import (0-800). Set 0 to sync only the last 30 days
  8. Enable or disable consumption synchronization
  9. For DPC (Flex D) and DCPC (Winter Credits), select a dedicated calendar
  10. Done! Entities appear shortly

Features with an account:

  • Current and historical consumption data
  • Balance and billing information
  • Current rate and rate option
  • Winter credits and peak events
  • Outage information
  • Energy Dashboard statistics

Option 2: OpenData Mode (no account required)

For users who only want peak period information without logging in:

  1. Go to Settings > Devices & Services
  2. Click + Add Integration
  3. Search Hydro-Québec
  4. Select OpenData Mode (no login required)
  5. Choose your customer sector (residential or commercial)
  6. Select your rate plan (the available plans are fetched from Hydro-Québec’s public API)
  7. Enter a contract name and a preheat duration (0-240 minutes)
  8. For DPC (Flex D) and DCPC (Winter Credits), select a dedicated calendar
  9. Done! Entities appear shortly

Features without an account:

  • Peak event information
  • Dynamic pricing information
  • No consumption tracking
  • No billing information

Multi-contract setup

To monitor multiple contracts (e.g., home and cottage):

  1. Add the integration multiple times
  2. Use a different contract name for each one
  3. Select a different contract during each setup

Changing contract or password

Hydro-Québec assigns a new contract number whenever the person responsible for a consumption site changes, even if the site is already linked to the account. You don’t need to remove the integration to update it:

  1. Go to Settings > Devices & Services > Hydro-Québec
  2. Open the three-dot menu of the entry and select Reconfigure
  3. Confirm your email. Leave the password empty to keep the current one, or enter a new one
  4. Select the contract

Entities keep their entity_id and the consumption history is preserved.

Email verification (MFA)

Hydro-Québec may require an email verification code after the password.

  1. During initial setup, reconfiguration or reauthentication, the integration shows the Email verification step.
  2. Enter the code you received. Leave the field empty to request a new code. If the code has expired, the login is restarted and a new code is sent automatically.
  3. The portal session (refresh token and Azure AD B2C cookies) is kept in Home Assistant storage. On restart, the integration tries a silent login before asking for credentials again. The session obtained during initial setup is reused: no second code is requested right after adding the integration.

No code requested in the background

Automatic logins stop at the verification step: no code is sent and the login is not retried in a loop. Home Assistant shows Reauthentication required in Settings > Devices & services. Click Reauthenticate to enter a new code.

Next steps

Troubleshooting

See Troubleshooting for connection problems, missing data and debug logging.

Support