diff --git a/enphase.py b/enphase.py index 4d2ea20..ce257e1 100644 --- a/enphase.py +++ b/enphase.py @@ -38,6 +38,6 @@ while True: logging.info("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) print("Total: "+str(total)+" Panneaux: "+str(panneaux)+" Enedis: "+str(net)) time.sleep(2) - except requests.exceptions.RequestException as e: + except Exception as e: logging.error(e) time.sleep(30) diff --git a/updateESP.sh b/updateESP.sh new file mode 100644 index 0000000..7fc09bb --- /dev/null +++ b/updateESP.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Execute une commande distance sur le module ESP +# syntaxe : updateESP.sh PARAM VALUE +# PARAM : 3 -> min_temp ; 4 -> min_prct + +IP="192.168.0.115" + +[ ! -z "$1" ] || echo "PARAM is empty" +[ ! -z "$2" ] || echo "VALUE is empty" + +if [ ! -z "$1" ] && [ ! -z "$2" ]; then + curl http://$IP/control?cmd=taskvalueset,3,$1,$2 +else + echo "Leaving script :-(" +fi