Import data from Enedis to Domoticz This script use the bridge "Conso API" (https://github.com/bokub/conso-api)
As the quota via the bridge is limited, please execute the script only one time by day.
- In Domoticz, go to hardware, create a virtual "P1 smart meter".
sudo apt-get install python3 python3-dateutil python3-requests
git clone https://github.com/Scrat95220/DomoticzLinky.git
cp _domoticz_linky.cfg domoticz_linky.cfg
nano domoticz_linky.cfg
and change:
[LINKY]
TOKEN=
PDL=
NB_DAYS_IMPORTED=30
[DOMOTICZ]
DOMOTICZ_ID=
[DOMOTICZ_SETTINGS]
HOSTNAME=http://localhost:8080
USERNAME =
PASSWORD =
Where: TOKEN correspond to the value of the token return by this authorization : https://conso.boris.sh/api/auth PDL correspond to your "Point de Livraison" Enedis NB_DAYS_IMPORTED correspond to the number of days to import DOMOTICZ_ID is id device on domoticz
Configuration file will not be deleted in future updates.
8 30 * * * python3 /home/pi/domoticz/DomoticzLinky/linky.py
return {
on = {
timer = {
'at xx:xx:xx', -- specific time
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'template',
},
execute = function(domoticz, timer)
domoticz.log('Timer event was triggered by ' .. timer.trigger, domoticz.LOG_INFO)
print("Launch Linky")
os.execute('python3 /home/pi/domoticz/scripts/python/DomoticzLinky/linky.py')
end
}