* fixes for change in Enedis API on 2024 December 20 ! - URL for data is now mes-mesures-prm and not mes-mesures. - Dto format have changed : mainly merge data & date, field renaming, and moving. - Some changes on date format. * add timezone to thing config to allow overriding default timezone * add possible fix for 500 Internal Server Error * backport some fixes from linkyv2 branch to handle enedis website errors * remove condition so we can always get metadata to fix 500 error * remove the missingData stuff from previous commit, realize if was duplicate with check already done in getConsumptionAfterChecks * remove also the refreshinterval on ExpiringDayCache constructor, we don't need it anymore * remove nullable on action field Signed-off-by: Laurent ARNAL <laurent@clae.net> |
||
---|---|---|
.. | ||
src/main | ||
NOTICE | ||
README.md | ||
pom.xml |
README.md
Linky Binding
This binding uses the API provided by Enedis to retrieve your energy consumption data. You need to create an Enedis account here if you don't have one already.
Please ensure that you have accepted their conditions, and check that you can see graphs on the website. Especially, check hourly view/graph. Enedis may ask for permission the first time to start collecting hourly data. The binding will not provide these informations unless this step is ok.
Supported Things
There is one supported thing : the linky
thing is retrieving the consumption of your home from the Linky electric meter.
Discovery
This binding does not provide discovery service.
Binding Configuration
The binding has no configuration options, all configuration is done at Thing level.
Thing Configuration
The thing has the following configuration parameters:
Parameter | Description |
---|---|
username | Your Enedis platform username. |
password | Your Enedis platform password. |
internalAuthId | The internal authID |
timezone | The timezone at the location of your linky |
This version is now compatible with the new API of Enedis (deployed from june 2020). To avoid the captcha login, it is necessary to log before on a classical browser (e.g Chrome, Firefox) and to retrieve the user cookies (internalAuthId).
Instructions given for Firefox :
- Go to https://mon-compte-client.enedis.fr/.
- Select "Particulier" in the drop down list and click on the "Connexion" button.
- You'll be redirected to a page where you'll have to enter you Enedis account email address and check the "Je ne suis pas un robot" checkbox.
- Clic on "Suivant".
- In the login page, prefilled with your mail address, enter your Enedis account password and click on "Connexion à Espace Client Enedis".
- You will be directed to your Enedis account environment. Get back to previous page in you browser.
- Disconnect from your Enedis account
- Repeat steps 1, 2. You should arrive directly on step 5, then open the developer tool window (F12) and select "Stockage" tab. In the "Cookies" entry, select "https://mon-compte-enedis.fr". You'll find an entry named "internalAuthId", copy this value in your openHAB configuration.
A new timezone parameter has been introduced. If you don't put a value, it will default to the timezone of your openHAB installation. This parameter can be useful if you read data from a Linky in a different timezone.
Channels
The information that is retrieved is available as these channels:
Channel ID | Item Type | Description |
---|---|---|
daily#yesterday | Number:Energy | Yesterday energy usage |
daily#power | Number:Power | Yesterday's peak power usage |
daily#timestamp | DateTime | Timestamp of the power peak |
weekly#thisWeek | Number:Energy | Current week energy usage |
weekly#lastWeek | Number:Energy | Last week energy usage |
monthly#thisMonth | Number:Energy | Current month energy usage |
monthly#lastMonth | Number:Energy | Last month energy usage |
yearly#thisYear | Number:Energy | Current year energy usage |
yearly#lastYear | Number:Energy | Last year energy usage |
Console Commands
The binding provides one specific command you can use in the console.
Enter the command openhab:linky
to get the usage.
openhab:linky <thingUID> report <start day> <end day> [<separator>] - report daily consumptions between two dates
The command report
reports in the console the daily consumptions between two dates.
If no dates are provided, the last 7 are considered by default.
Start and end day are formatted yyyy-mm-dd.
Here is an example of command you can run: openhab:linky linky:linky:local report 2020-11-15 2020-12-15
.
Docker specificities
In case you are running openHAB inside Docker, the binding will work only if you set the environment variable CRYPTO_POLICY
to the value "unlimited" as documented here.
Full Example
Thing
Thing linky:linky:local "Compteur Linky" [ username="example@domaine.fr", password="******", internalAuthId="******" ]
Items
Number:Energy ConsoHier "Conso hier [%.0f %unit%]" <energy> { channel="linky:linky:local:daily#yesterday" }
Number:Energy ConsoSemaineEnCours "Conso cette semaine [%.0f %unit%]" <energy> { channel="linky:linky:local:weekly#thisWeek" }
Number:Energy ConsoSemaineDerniere "Conso semaine dernière [%.0f %unit%]" <energy> { channel="linky:linky:local:weekly#lastWeek" }
Number:Energy ConsoMoisEnCours "Conso ce mois [%.0f %unit%]" <energy> { channel="linky:linky:local:monthly#thisMonth" }
Number:Energy ConsoMoisDernier "Conso mois dernier [%.0f %unit%]" <energy> { channel="linky:linky:local:monthly#lastMonth" }
Number:Energy ConsoAnneeEnCours "Conso cette année [%.0f %unit%]" <energy> { channel="linky:linky:local:yearly#thisYear" }
Number:Energy ConsoAnneeDerniere "Conso année dernière [%.0f %unit%]" <energy> { channel="linky:linky:local:yearly#lastYear" }