Home Assistant custom integration to gather data from the Energa My Meter (https://mojlicznik.energa-operator.pl/) website.
This integration will include the following entities to Home Assistant:
Parameter | Description |
---|---|
Meter reading | The latest reading in kWh for the specified meter. Will not contain per hour data. |
Client type | The reading of the client type specified for the account on Energa website. For example: Odbiorca |
Contract period | The reading of the contract start / end, as provided on Energa website |
Last update | The information about when was the last update published on the Energa website (not when it was updated in Home Assistant). This can be used to determine how often Energa refreshes the data on the account. |
PPE address | The physical address for the PPE, as provided by Energa |
Seller | The name of energy seller, as provided by Energa |
Tariff | The name of the tariff type used by the meter |
Energy statistics | Historical readings for the energy used/produced sensor. More about them in the Statistic sensors section. |
This integration supports configuring multiple meters, even from different accounts. To do so, just add another entry for the Energa My Meter integration.
Every meter will have its own device configured, so sensors will be properly grouped and the information will be easily accessible.
This integration does support per hour energy produced/consumed data that can be used in the Energy dashboard:
Because Energa rarely updates the data on their website, the integration needs to create special "statistic" entities that store no state, but save the hourly usage Energa provides. The integration also supports loading old data from previous days. In the configuration options you can specify how many days should be loaded on the initial run - after that the integration will load only the missing data from the last loaded historical point.
All statistics sensors will be shown in the Home Assistant as Unknown state - and that is OK, they should be used only to populate the data in the Energy dashboard. This is due to Home Assistant limitation that you cannot save old statistic point if the sensor already has some state. Could be possibly enhanced in the future.
This integration will create a set of statistics for each zone your tariff supports.
If you wish not to load any statistics, then do not select any mode during the configuration of the component.
If you want to load historical data, you can do so by providing the number of days to load parameter during the configuration.
If the data you want to load is older than 60 days, please keep in mind, that the integration does not download all requested data at once. Instead, it will fetch it with smaller packages of 60 days to avoid issues with Energa website returning bot-protection errors like captcha requirement.
This means that the component will slowly load the missing data with each iteration (by default, after every 5h).
To make it load faster, you can set up the Refresh data interval in minutes
configuration option for your config entry
(the Configure
button in Home Assistant) to a much smaller value (like 10 minutes) until the integration will fetch
the freshest data - or reload the entry manually in Home Assistant.
If you wish to completely reload the data, you will need to:
Settings
-> Integrations
-> Energa integration (Mój licznik)Developer tools
-> Statistics
-> Search for energa
Fix issue
button, which will open a modal with Delete
option. Please delete all statistics related to deleted entry (for all selected zones & modes).This integration is a standard Home Assistant custom component and there are many tutorials on how to install it.
All you have to do is place the energa_my_meter directory inside your
/config/custom_components/
directory (if the custom_components
does not exist, simply create it).
Because HACS does not allow Gitlab repositories to be added (and the original repository is hosted on https://gitlab.com/home-assistant-custom-components/hass-energa-my-meter), there is a GitHub mirror hosted on https://github.com/thedeemling/hass-energa-my-meter. This integration should be enlisted in HACS default repositories.
This integration supports adding multiple Energa accounts and meters/PPEs by creating additional config entries.
This custom component does support GUI installation. In your Home Assistant instance please search for Energa integration or simply click on button below (if you have configured the My Home Assistant) to add it.
The configuration wizard will provide the details about possible configuration options.
You can also change the interval of refreshing the data (by default 5 hours) to best suit your needs by clicking on the
Configure
button near the integration's config entry.
The YAML configuration will be imported as a config flow and presented in GUI as additional integration config entry.
energa_my_meter:
- password: YOUR_ENERGA_PASSWORD
username: YOUR_ENERGA_USERNAME
# The meter number that the integration should monitor
selected_meter: XX
# The internal Energa ID for the meter. Can be seen in API calls when checking the past usage
selected_meter_internal_id: XX
# The PPE number for the entry
selected_ppe: XX
# Select all zones that you would like to monitor. Please ensure they will be added exactly as
# returned by Energa (with colon, if added there)
selected_zones:
- 'Strefa 1 (Dzienna):'
- 'Strefa 2 (nocna):'
# What kind of statistic sensors you would like to create
selected_modes:
- ENERGY_CONSUMED
- ENERGY_PRODUCED
# Optional. You can also configure it in the integration options (GUI)
# Interval in *minutes* which will be used to refresh data from the Energa website
# By default 300 minutes
scan_interval: 310
# Optional. How many historical days should be loaded initially, by default 10
number_of_days_to_load: 100
To enable debug logs please set up the Home Assistant logger:
custom_components.energa_my_meter: debug
If you do not have a smart meter provided by Energa, and would still like to use this integration to remotely access your energy usage and production data, there is a way to obtain the meter, although the process is not always cost-free.
You can find more information about getting access to remote reading for your meter on the Mój Licznik portal in the official Energa documentation.