Page 7 sur 27

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 22 août 2015, 18:41
par sirus
Le code fonctionne maintenant pour les sites suivants :

SDEI : lyonnaise-des-eaux.fr

SOGEST : sogest.info

SENART : eauxdesenart.com


N'hesitez pas si vous avez aussi une facture Lyonaise des eaux ou suez environnement a tester et faire un retour ici !

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 29 août 2015, 17:38
par manuloup
Pas de compteur RF chez moi, snif :(

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 15 sept. 2015, 20:17
par atlantis007
bonjour
j ai un souci je récupéré bien les données mais elle ne s affiche pas dans domoticz

vous une solution merci

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 09:09
par sirus
Bonjour atlantis007

Sans plus d'information il est difficile pour nous de taider. Tu pourrai nous donner le contenu du fichier 2015-09.dat?

Aucun message d'erreur quand tu lances le script?

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 11:04
par atlantis007
bonjour sirus voici le contenu du fichier 2015-09

Code : Tout sélectionner

01/09/2015,0.306,493.877
02/09/2015,0.268,494.145
03/09/2015,0.282,494.427
04/09/2015,0.317,494.744
05/09/2015,0.364,495.108
06/09/2015,0.341,495.449
07/09/2015,0.3,495.749
08/09/2015,0.239,495.988
09/09/2015,0.265,496.253
10/09/2015,0.444,496.697
11/09/2015,0.362,497.059
12/09/2015,0.149,497.208
13/09/2015,0,497.721
il ma l aire normal je pense

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 13:52
par sirus
Oui il est parfait ! Il est même très joli !!


Que donnent les fichiers SQL ?
et la log quand tu executes le script ?

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 14:21
par atlantis007
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 :oops:

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 17:45
par sirus
Tu le lance bien avec root?

888 c'est bien le bon numero?

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 18:37
par atlantis007
oui je suis en root et 888 est le bon numéro de plus quand je lance le script la date et l'heure sont modifié

Re: [TUTO] Consomation d'eau ajout simple dans domoticz

Publié : 16 sept. 2015, 23:09
par sirus
Bizarre... il n'y a vraiment rien sur les 3 graphe de ton compteur ??
Tu peux essayer sur le mois passé comme ca pour voir :

Code : Tout sélectionner

/home/pi/EAU/updateConsoEau.sh 2015 08

Ensuite tu peux aussi essayer ceci :

- faire un backup de la db domoticz via l'interface web (juste au cas ou)
- arrêter domoticz :

Code : Tout sélectionner

root> sudo /etc/init.d/domoticz.sh stop
- ouvrir la base de données avec sqlite3 :

Code : Tout sélectionner

root> sqlite3 /home/pi/domoticz.db
ensuite exécuter le fichier sql manuellement :

Code : Tout sélectionner

sqlite> .read /home/pi/EAU/previous.generated.2015-08.sql
Normalement, si tout vas bien il n'y a pas de message d'erreur. Mais en cas d’erreur tu devrais avoir des informations...
Colle les erreurs ici si il y en a..

ensuite tu quites sqlite3 et redémarres domoticz :

Code : Tout sélectionner

sqlite> .quit
root>sudo /etc/init.d/domoticz.sh start
Colles les erreurs ici si il y en a..