Re: [TUTO] Consomation d'eau ajout simple dans domoticz
Publié : 10 sept. 2020, 13:05
ca fonctionne pour vous finalement ? moi toujours rien
Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
Code : Tout sélectionner
# This script will get the data from SDEI/SOGEST website and insert into domoticz.db
# Site : http://domotique.web2diz.net/
# Detail : http://domotique.web2diz.net/?p=131
# List of working provider : http://domotique.web2diz.net/?p=320
# Source : https://github.com/Sirus10/domoticz/blob/master/updateConsoEau.sh
# License : CC BY-SA 4.0
Code : Tout sélectionner
PROVIDER=SUEZmoi aussi
Code : Tout sélectionner
pi@raspberrypi:~ $ /home/pi/EAU/updateConsoEau.sh 2020 8
Using Configuration from file /home/pi/EAU/setup_perso
- PART 1 Get the data from website for 2020-8
- TOKEN OK
- LOGIN OK
- DATA collection OK
/home/pi/EAU/2020-8.dat generated
- PART 2 Update .dat file
/home/pi/EAU/2020-8.dat Updated
- PART 3 Generate SQL
/home/pi/EAU/updateConsoEau.sh: line 203: * 100: arithmetic syntax error
comm: /home/pi/EAU/temps.generated.2020-8.sql: No such file or directory
mv: cannot stat '/home/pi/EAU/temps.generated.2020-8.sql': No such file or directory
SQL with 0 line(s) generated : /home/pi/EAU/only_new_generated.2020-8.sql
- PART 4 Update the db
File size is zero -> DB update NOT needed
### END ###
Code : Tout sélectionner
echo "Provider (copy/paste) : "
echo "SEOP | SUEZ | SDEI | SOGEST | SEERC | SOBEP | EEF | SENART | OLIVET | SIEVA | SEE"
read PROVIDER
echo "Your virtual device ID in domoticz (see step2 here http://domotique.web2diz.net/?p=138 ) "
read devicerowid
echo "SDEI_CODE=$CODE
SDEI_EMAIL=$EMAIL
SDEI_PASSWD=$PASSWD
PROVIDER=$PROVIDER
devicerowid=$devicerowid" > $workingDIR/setup_perso
echo "#######################################"
echo " CONFIG FILE setup_perso CREATED WITH : "
echo "#######################################"
cat $workingDIR/setup_perso
echo "#######################################"
. $workingDIR/setup_perso
fi
#######################################
#
# PART 1 get the data
#
######################################
echo -e "\n - PART 1 Get the data from website for $dateY-$dateM"
if [[ $PROVIDER == 'SDEI' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'SOGEST' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'SEERC' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'SOBEP' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'EEF' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'SUEZ' ]] then website="www.toutsurmoneau.fr"
elif [[ $PROVIDER == 'SENART' ]] then website="www.eauxdesenart.com"
elif [[ $PROVIDER == 'OLIVET' ]] then website="www.eau-olivet.fr"
elif [[ $PROVIDER == 'SIEVA' ]] then website="www.eau-en-ligne.com"
elif [[ $PROVIDER == 'SEE' ]] then website="www.eauxdelessonne.com"
elif [[ $PROVIDER == 'SEOP' ]] then website="www.seop.fr"
fi