- CLP Subscriber
- CLP website credentials
- CLP smart meter installed (for
HOURLY
usage data)
- Setup
HACS
https://hacs.xyz/docs/setup/prerequisites - In
Home Assistant
, clickHACS
on the menu on the left - Select
integrations
- Click the menu button in the top right hand corner
- Choose
custom repositories
- Enter
https://github.com/thematrixdev/home-assistant-clp
and chooseIntegration
, clickADD
- Find and click on
CLPHK
in thecustom repositories
list - Click the
DOWNLOAD
button in the bottom right hand corner - Restart Home Assistant
- Go to
Settings
,Devices and Services
- Click the
Add Integration
button - Search
CLPHK
- Go through the configuration flow
Starting from 21st June 2025, sign-in with username
and password
no long works.
- Visit CLP sign-in page 中文 / English
- Choose to Sign-in with email
- Enter your email address. Click
Continue
- Get the one-time-password (OTP) from email. DO NOT continue signing-in on CLP webpage.
- Enter the OTP during the configuration flow
Key | Type | Required | Accepted Values | Default | Description |
---|---|---|---|---|---|
email |
string | * | Any string | (N/A) | CLP username or account number |
otp |
string | * | Any string | (N/A) | CLP account password |
name |
string | Any string | CLP |
Name of the sensor | |
timeout |
int | Any integer | 30 |
Connection timeout in second | |
retry_delay |
int | Any integer | 300 |
Delay before retry in second | |
type |
string | BIMONTHLY DAILY HOURLY |
|
Type of data to be shown in state If not specified, best accurate value is used |
|
get_account |
boolean | True False |
False |
Get account summary | |
get_bill |
boolean | True False |
False |
Get bills | |
get_estimation |
boolean | True False |
False |
Get usage estimation | |
get_bimonthly |
boolean | True False |
False |
Get bi-monthly usage | |
get_daily |
boolean | True False |
False |
Get daily usage | |
get_hourly |
boolean | True False |
False |
Get hourly usage | |
get_hourly_days |
int | 1 or 2 |
1 |
Number of days to get hourly data | |
renewable_energy_sensor_enable |
boolean | True False |
False |
Enable renewable energy sensor | |
renewable_energy_sensor_name |
string | True False |
'CLP Renewable Energy' |
Name of the renewable energy sensor | |
renewable_energy_sensor_type |
string | BIMONTHLY DAILY HOURLY |
|
Type of data to be shown in state If not specified, best accurate value is used |
|
renewable_energy_sensor_get_bill |
boolean | True False |
False |
Get energy generation in bills | |
renewable_energy_sensor_get_daily |
boolean | True False |
False |
Get daily energy generation | |
renewable_energy_sensor_get_hourly |
boolean | True False |
False |
Get hourly energy generation | |
renewable_energy_sensor_get_hourly_days |
int | 1 or 2 |
1 |
Number of days to get hourly data |
- It is recommended to provide
type
andrenewable_energy_sensor_type
for data consistency
This integration exchanges the OTP
for a token
.
However, the token
may get invalidated from time to time.
- Go to
Settings
,Devices and Services
- Click
CLPHK
- Click
Configure
- Fill in the new
OTP
- Click
Submit
- Install
IMAP
integration https://www.home-assistant.io/integrations/imap - Configure
IMAP
integration- Fill in
Username
,Password
andServer
according to your email provider - Keep everything else default
- If you concern about privacy, enter
FROM "[email protected]"
inIMAP search
to expose only CLP email - On
Message data to be included in the imap_content event data
, checkBody text
- Fill in
- Update
configuration.yaml
- how to update
configuration.yaml
: https://www.home-assistant.io/docs/configuration/ - add the following:
- how to update
template:
- trigger:
- platform: event
event_type: "imap_content"
id: "clp_email_otp_event"
event_data:
sender: "[email protected]"
sensor:
- name: clp_email_otp
state: "{{ trigger.event.data['text'] | regex_findall('(\\d{6})') | first }}"
attributes:
Date: "{{ trigger.event.data['date'] }}"
- Restart Home Assistant
- More than one
clphk
entry will cause issues. Avoid multiple entries. - Timeouts may occur on slower hardware. Increase
timeout
value to mitigate.
- On Home Assistant, go to
Settigns
->Logs
- Search
CLPHK
- Add these lines to
configuration.yaml
logger:
default: info
logs:
custom_components.clphk: debug
- Restart Home Assistant
- On Home Assistant, go to
Settigns
->Logs
- Search
CLPHK
- Click the
LOAD FULL LOGS
button
- Open an issue on GitHub
- Specify:
- What's wrong
- Home Assistant version
- CLP custom-integration version
- Configuration (without sensitive data)
- Logs
- Telegram Group https://t.me/smarthomehk
- Ubuntu 24.04
- Home Assistant Container 2025.6.1