|
|
|
|
@ -7,7 +7,7 @@ import logging
@@ -7,7 +7,7 @@ import logging
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
|
|
|
|
logging.basicConfig(level=logging.INFO, filename=os.path.join(os.path.dirname(__file__),'enphase.log'), filemode="a+",format="%(asctime)-15s %(levelname)-8s %(message)s") |
|
|
|
|
logging.basicConfig(level=logging.ERROR, filename=os.path.join(os.path.dirname(__file__),'enphase.log'), filemode="a+",format="%(asctime)-15s %(levelname)-8s %(message)s") |
|
|
|
|
|
|
|
|
|
user='christophe.scaya@gmail.com' |
|
|
|
|
password='92@!Z&KYxt8shT' |
|
|
|
|
@ -34,7 +34,7 @@ while True:
@@ -34,7 +34,7 @@ while True:
|
|
|
|
|
total = round(json[0]['cumulative']['currW']) |
|
|
|
|
net = round(json[1]['cumulative']['currW']) |
|
|
|
|
panneaux = total-net |
|
|
|
|
#esp_cmd = requests.get('http://'+ip_esp+'/control?cmd=event,setPwr='+str(net)) |
|
|
|
|
esp_cmd = requests.get('http://'+ip_esp+'/control?cmd=event,setPwr='+str(net)) |
|
|
|
|
logging.info("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) |
|
|
|
|
print("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) |
|
|
|
|
time.sleep(2) |
|
|
|
|
|