voici mon sql
Code : Tout sélectionner
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-01'; INSERT INTO `Meter_Calendar` VALUES ('888', '30.6', '493.877', '2015-09-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-02'; INSERT INTO `Meter_Calendar` VALUES ('888', '26.8', '494.145', '2015-09-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-03'; INSERT INTO `Meter_Calendar` VALUES ('888', '28.2', '494.427', '2015-09-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-04'; INSERT INTO `Meter_Calendar` VALUES ('888', '31.7', '494.744', '2015-09-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-05'; INSERT INTO `Meter_Calendar` VALUES ('888', '36.4', '495.108', '2015-09-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-06'; INSERT INTO `Meter_Calendar` VALUES ('888', '34.1', '495.449', '2015-09-06' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-07'; INSERT INTO `Meter_Calendar` VALUES ('888', '30', '495.749', '2015-09-07' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-08'; INSERT INTO `Meter_Calendar` VALUES ('888', '23.9', '495.988', '2015-09-08' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-09'; INSERT INTO `Meter_Calendar` VALUES ('888', '26.5', '496.253', '2015-09-09' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-10'; INSERT INTO `Meter_Calendar` VALUES ('888', '44.4', '496.697', '2015-09-10' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-11'; INSERT INTO `Meter_Calendar` VALUES ('888', '36.2', '497.059', '2015-09-11' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-12'; INSERT INTO `Meter_Calendar` VALUES ('888', '14.9', '497.208', '2015-09-12' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-13'; INSERT INTO `Meter_Calendar` VALUES ('888', '51.3', '497.721', '2015-09-13' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-14'; INSERT INTO `Meter_Calendar` VALUES ('888', '24.6', '497.967', '2015-09-14' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-15'; INSERT INTO `Meter_Calendar` VALUES ('888', '35', '498.317', '2015-09-15' );
et le log
Code : Tout sélectionner
/home/pi/EAU/updateConsoEau.sh
/home/pi/EAU/updateConsoEau.sh[21]: [: argument expected
- PART 1 Get the data from website for 2015-09
/home/pi/EAU/2015-09.dat generated
- PART 2 Update .dat file
/home/pi/EAU/2015-09.dat Updated
- PART 3 Generate SQL
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-01'; INSE RT INTO `Meter_Calendar` VALUES ('888', '30.6', '493.877', '2015-09-01' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-02'; INSE RT INTO `Meter_Calendar` VALUES ('888', '26.8', '494.145', '2015-09-02' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-03'; INSE RT INTO `Meter_Calendar` VALUES ('888', '28.2', '494.427', '2015-09-03' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-04'; INSE RT INTO `Meter_Calendar` VALUES ('888', '31.7', '494.744', '2015-09-04' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-05'; INSE RT INTO `Meter_Calendar` VALUES ('888', '36.4', '495.108', '2015-09-05' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-06'; INSE RT INTO `Meter_Calendar` VALUES ('888', '34.1', '495.449', '2015-09-06' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-07'; INSE RT INTO `Meter_Calendar` VALUES ('888', '30', '495.749', '2015-09-07' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-08'; INSE RT INTO `Meter_Calendar` VALUES ('888', '23.9', '495.988', '2015-09-08' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-09'; INSE RT INTO `Meter_Calendar` VALUES ('888', '26.5', '496.253', '2015-09-09' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-10'; INSE RT INTO `Meter_Calendar` VALUES ('888', '44.4', '496.697', '2015-09-10' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-11'; INSE RT INTO `Meter_Calendar` VALUES ('888', '36.2', '497.059', '2015-09-11' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-12'; INSE RT INTO `Meter_Calendar` VALUES ('888', '14.9', '497.208', '2015-09-12' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-13'; INSE RT INTO `Meter_Calendar` VALUES ('888', '51.3', '497.721', '2015-09-13' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-14'; INSE RT INTO `Meter_Calendar` VALUES ('888', '24.6', '497.967', '2015-09-14' );
DELETE FROM `Meter_Calendar` WHERE devicerowid=888 and date = '2015-09-15'; INSE RT INTO `Meter_Calendar` VALUES ('888', '35', '498.317', '2015-09-15' );
update DeviceStatus set lastupdate = '2015-09-15 14:16:37' where id = 888;
- PART 4 Update the db
File size is NOT zero -> DB update needed
Stoping Domoticz !
Domoticz stopped
Update DB START
Update Values
Update Status
Update DB END
Starting Domoticz !
2015-09-16 14:16:50.828 Domoticz V2.3011 (c)2012-2015 GizMoCuz
2015-09-16 14:16:50.830 Build Hash: 765fe41, Date: 2015-09-13 08:04:58
2015-09-16 14:16:50.831 System: Raspberry Pi
2015-09-16 14:16:50.833 Startup Path: /home/pi/domoticz/
domoticz: Domoticz is starting up....
Domoticz started
### END ###
voila toute les info que j ai
