Bon j'ai supprimé un de mes commentaires car je racontais n'importe quoi......bref
En modifiant le fichier 2015-08.dat j'obtiens maintenant ce ci:
Code : Tout sélectionner
./updateConsoEau.sh[19]: [: argument expected
- PART 1 Get the data from SDEI for 2015-08
/home/pi/SDEI/2015-08.dat generated
rm: impossible de supprimer « /home/pi/SDEI/cookiefile »: Aucun fichier ou dossier de ce type
- PART 2 Update .dat file
/home/pi/SDEI/2015-08.dat Updated
- PART 3 Generate SQL
comm: fichier 1 n'est pas dans l'ordre attendu
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-01'; INSERT INTO `Meter_Calendar` VALUES ('60', '18500', '468 902', '2015-08-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-01'; INSERT INTO `Meter_Calendar` VALUES ('60', '18500', '468.902', '2015-08-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-02'; INSERT INTO `Meter_Calendar` VALUES ('60', '34400', '469 246', '2015-08-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-02'; INSERT INTO `Meter_Calendar` VALUES ('60', '34400', '469.246', '2015-08-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-03'; INSERT INTO `Meter_Calendar` VALUES ('60', '44500', '469 691', '2015-08-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-03'; INSERT INTO `Meter_Calendar` VALUES ('60', '44500', '469.691', '2015-08-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-04'; INSERT INTO `Meter_Calendar` VALUES ('60', '58100', '470 271', '2015-08-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-04'; INSERT INTO `Meter_Calendar` VALUES ('60', '58100', '470.271', '2015-08-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-05'; INSERT INTO `Meter_Calendar` VALUES ('60', '43300', '470 704', '2015-08-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-05'; INSERT INTO `Meter_Calendar` VALUES ('60', '43300', '470.704', '2015-08-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-06'; INSERT INTO `Meter_Calendar` VALUES ('60', '50800', '471 212', '2015-08-06' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-06'; INSERT INTO `Meter_Calendar` VALUES ('60', '50800', '471.212', '2015-08-06' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-07'; INSERT INTO `Meter_Calendar` VALUES ('60', '41600', '471 628', '2015-08-07' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-01'; INSERT INTO `Meter_Calendar` VALUES ('60', '18500', '468 902', '2015-08-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-02'; INSERT INTO `Meter_Calendar` VALUES ('60', '34400', '469 246', '2015-08-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-03'; INSERT INTO `Meter_Calendar` VALUES ('60', '44500', '469 691', '2015-08-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-04'; INSERT INTO `Meter_Calendar` VALUES ('60', '58100', '470 271', '2015-08-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-05'; INSERT INTO `Meter_Calendar` VALUES ('60', '43300', '470 704', '2015-08-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-06'; INSERT INTO `Meter_Calendar` VALUES ('60', '50800', '471 212', '2015-08-06' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-07'; INSERT INTO `Meter_Calendar` VALUES ('60', '41600', '471 628', '2015-08-07' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-01'; INSERT INTO `Meter_Calendar` VALUES ('60', '18500', '468.902', '2015-08-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-02'; INSERT INTO `Meter_Calendar` VALUES ('60', '34400', '469.246', '2015-08-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-03'; INSERT INTO `Meter_Calendar` VALUES ('60', '44500', '469.691', '2015-08-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-04'; INSERT INTO `Meter_Calendar` VALUES ('60', '58100', '470.271', '2015-08-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-05'; INSERT INTO `Meter_Calendar` VALUES ('60', '43300', '470.704', '2015-08-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=60 and date = '2015-08-06'; INSERT INTO `Meter_Calendar` VALUES ('60', '50800', '471.212', '2015-08-06' );
update DeviceStatus set lastupdate = '2015-08-07 16:03:59' where id = 60;
- PART 4 Update the db
File size is NOT zero -> DB update needed
Stoping Domoticz !
Domoticz stopped
Update DB START
Update Values
./updateConsoEau.sh[157]: sqlite3: not found [Aucun fichier ou dossier de ce type]
Update Status
./updateConsoEau.sh[160]: sqlite3: not found [Aucun fichier ou dossier de ce type]
Update DB END
Starting Domoticz !
2015-08-09 16:04:05.319 Domoticz V2.2692 (c)2012-2015 GizMoCuz
2015-08-09 16:04:05.321 System: Raspberry Pi
2015-08-09 16:04:05.322 Startup Path: /home/pi/domoticz/
domoticz: Domoticz is starting up....
Domoticz started
### END ###
Pour obtenir ceci j'ai transformé le fichier de base:
Code : Tout sélectionner
01/08/2015,0.185,468.902
02/08/2015,0.344,469.246
03/08/2015,0.445,469.691
04/08/2015,0.581,470.271
05/08/2015,0.433,470.704
06/08/2015,0.508,471.212
07/08/2015,0.416,471.628
En ceci:
Code : Tout sélectionner
01/08/2015,185,468.902
02/08/2015,344,469.246
03/08/2015,445,469.691
04/08/2015,581,470.271
05/08/2015,433,470.704
06/08/2015,508,471.212
07/08/2015,416,471.628