Best french discord community about "Domotique & Diy" :
The tool is still under development. It is possible that various functions disappear or be modified
EnedisGateway2MQTT use Enedis Gateway API to send data in your MQTT Broker.
Sometimes it takes several days for Enedis to activate the collection.
Activation is only valid for 1 year.
WARNING, The enedis website has some issues with chrome / chromium based browsers. The easiest way is to use Firefox in the consent process
In order to avoid saturation of Enedis Gateway services, the number of API calls is limited to 15 per day. Most of the information will be collected during the first launch. You will just need a few days to report all "detailed" consumption over 2 years (about 1 week)
Enedis Gateway limit to 50 call per day / per pdl.
If you reach this limit, you will be banned for 24 hours!
API call number by parameters :
| Parameters | Call number |
|---|---|
| GET_CONSUMPTION | 3 |
| GET_CONSUMPTION_DETAIL | 105 |
| GET_PRODUCTION | 3 |
| GET_PRODUCTION_DETAIL | 105 |
| ADDRESSES | 1 |
| CONTRACT | 1 |
See chapter persistance, to reduce API call number.
Filename : config.yaml
Container path : /data/config.yaml
The easiest is to map the "/data" in local because it is also this folder that contains the cache.
3 parameters is mandatory :
All other variables have default values
Exemple :
##########
# GLOBAL #
##########
debug: false
####################
## MQTT ##
####################
mqtt:
host: MOSQUITO_SERVER # MANDATORY
port: 1883
username: ""
password: ""
prefix: enedis_gateway
client_id: enedis_gateway
retain: true
qos: 0
####################
## Home assistant ##
####################
home_assistant:
discovery: false
discovery_prefix: homeassistant
card_myenedis: false
###############
## Influx DB ##
###############
#influxdb:
# host: MY_INFLUXDB_SERVER
# port: 8086
# token: MY_TOKEN
# org: MY_ORG
# bucket: MY_BUCKET
####################
## ENEDIS GATEWAY ##
####################
enedis_gateway:
XXXXXXXXXXXXXX: # Replace XXXXXXXXXXXXXX by your PDL Number. MANDATORY
token: YOUR_TOKEN # MANDATORY
plan: BASE # BASE or HP/HC
consumption: true
consumption_detail: true
consumption_price_hc: 0
consumption_price_hp: 0
consumption_price_base: 0
production: false
production_detail: false
offpeak_hours: "" # USE ONLY IF YOU WANT OVERLOAD DEFAULT VALUE, Format : 22h36-06h00;11h30-14h30
addresses: true
# YYYYYYYYYYYYYY: # Replace YYYYYYYYYYYYYY by your other PDL Number
# token: YOUR_TOKEN
# plan: HP/HC
# consumption: true
# consumption_detail: true
# consumption_price_hc: 0.1781
# consumption_price_hp: 0.1337
# consumption_price_base: 0.1781
# production: false
# production_detail: false
# addresses: true
offpeak_hours : I automatically retrieve the information via the Enedis APIs, but it happens that some account does not upload it. This parameter will allow you to fill in your HP / HC ranges yourself in order to be able to compare your consumption according to the 2 subscriptions.
Since v0.3, Enedis Gateway use SQLite database to store all data and reduce API call number.
Don't forget to mount /data to keep database persistance !!
If you wan wipe cache, just delete enedisgateway.db and restat container.
WARNING, if you wipe all data you generate lot of API Call (don't forget [Enedis Gateway limit](#Enedis Gateway limit))
It doesn't forget that it takes several days to recover consumption/production in detail mode.
Even if you are on a basic plan (and not HP / HC), it is interesting to enter the prices of each plan. The tool will do calculation for you and tell you which plan is the most advantageous for you based on your consumption.
Sometimes there are holes in the Enedis consumption records. So I set up a blacklist system for certain dates.
If date does not return information after 7 try (7 x CYCLE), I blacklist this date and will no longer generate an API call
Gateway is work with influxDB version 1.X & 2.X
influxdb:
host: influxdb
port: 8086
token: USERNAME:PASSWORD
org: "-"
bucket: "DATABASE/RETENTION"
influxdb:
host: influxdb
port: 8086
token: MY_TOKEN
org: MY_ORG
bucket: MY_BUCKET
When you are exported all data in your influxDB, you can use this grafana dashboard.
Actually it's work only in InfluxQL (v1 language), Flux mode (v2 language) it's in progress... But you can use InfluxQL in V2.
These are EXAMPLES, and do not necessarily represent your settings!
Please read parameter table and adapt to your configuration.
docker run -it --restart=unless-stopped -v $(pwd):/data m4dm4rtig4n/enedisgateway2mqtt:latest
docker-compose.yml
version: "3.9"
services:
enedisgateway2mqtt:
image: m4dm4rtig4n/enedisgateway2mqtt:latest
restart: unless-stopped
volumes:
-./:/data
Requirement:
Display help information:
make
Start containers:
make up
Stop containers:
make down
Start application:
make start
Connect to container:
make start
UPGRADE Procedure :
Change Log :
BREAKING CHANGE - All configuration is now in config.yml
Not update to 0.7.0 if you don't have adapt your configuration
NameError: name 'client' is not defined
Content type
Image
Digest
sha256:fb2de037d…
Size
270.9 MB
Last updated
over 2 years ago
docker pull m4dm4rtig4n/enedisgateway2mqtt