Lazer Posté(e) le 18 octobre 2016 Auteur Signaler Posté(e) le 18 octobre 2016 Sorry, it is not possible to exclude specific devices from being collected wihin the virtual device. The only way to exclude devices is to hide them in the graphical interface.... But you won't be able to see them anymore in your GUI. 1
kead77 Posté(e) le 18 octobre 2016 Signaler Posté(e) le 18 octobre 2016 This is a problem when i need to download the csv data from the myphp database... Ok... i hope in a future upgrade Thank you for your works!
Lazer Posté(e) le 18 octobre 2016 Auteur Signaler Posté(e) le 18 octobre 2016 What kind of server to you have for your database ? I have a lot of devices, and my database is less than 200MB, I have very good performances when extracting data. I am running on a Web shared hosting. Your server may have very very low performances.
kead77 Posté(e) le 19 octobre 2016 Signaler Posté(e) le 19 octobre 2016 Yes... my database it's about 120mb but when i download it in csv format it increase the size at 250mb... For now it's not a big problem.. i think for the future. I have stored data just for two months. But no problem. It'is ok!! Thank you
Lazer Posté(e) le 19 octobre 2016 Auteur Signaler Posté(e) le 19 octobre 2016 OK, it's normal, since CSV data is just text data, so the size is bigger. I have a backup schedule that runs automaticaly every night, and extract all tables in CSV format, and I have no probem so far.
kead77 Posté(e) le 19 octobre 2016 Signaler Posté(e) le 19 octobre 2016 Oh! very interesting program! What's his name? For a manual backup which format do you recommend?
Lazer Posté(e) le 19 octobre 2016 Auteur Signaler Posté(e) le 19 octobre 2016 I use 2 home-made scripts : - a PHP file running on the web server to extract data from DB - a Shell file running on a Linux station, which download the file then copy it onto a NFS mount on the NAS. The PHP file : <?php /******************************************************************************/ /*** File : backup_sql.php ***/ /*** Author : Christophe DRIGET ***/ /*** Version : 1.0 ***/ /*** History : January 2016 : Initial release ***/ /*** Note : Script to backup database ***/ /******************************************************************************/ //*** Debug mode define('DEBUG', false); //*** Report all PHP errors if (DEBUG) error_reporting(E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED); else error_reporting(E_ALL); ini_set('display_errors', 'on'); //*** Generate exception for all errors function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, $errno, 0, $errfile, $errline); } set_error_handler('exception_error_handler', E_ALL); //*** //*** Main loop //*** try { //*** Include necessary files require 'config.inc.php'; //*** MySQL connection if ( ! isset($bdd) ) $bdd = new PDO('mysql:host='.$server.';dbname='.$database.';charset=UTF8', $login, $password); //*** Get tables list $sql = $bdd->prepare("select TABLE_NAME from information_schema.tables where TABLE_TYPE='BASE TABLE' AND TABLE_NAME LIKE 'domotique%' OR TABLE_NAME LIKE 'teleinfo%'"); $sql->execute(); $tables = implode(' ', $sql->fetchAll(PDO::FETCH_COLUMN)); if (DEBUG) echo $tables.'<br/>'.PHP_EOL; //*** Dump database $date = date('Ymd-His'); $filename = $database.'.sql'; $last_line = system('mysqldump --host='.$server.' --user='.$login.' --password='.$password.' '.$database.' '.$tables.' > '.$filename, $retval); if (DEBUG) { echo $last_line.'<br/>'.PHP_EOL; echo $retval.'<br/>'.PHP_EOL; } if ( $retval == 0 ) { //*** Compress file if (file_exists($filename.'.gz')) unlink($filename.'.gz'); system('gzip '.$filename, $retval); if ( $retval == 0 ) echo $date; else throw new Exception('Cannot compress file'); } else throw new Exception('Cannot dump SQL'); } //*** //*** Exception handling //*** catch(Exception $e) { die('Error : '.$e->getMessage()); } ?> The Shell script : #!/bin/bash # # Script : backup_domotique.sh # Author : Christophe DRIGET # Version : 1.0 # Date : January 2016 # # Website SITE_URL="http://my.domain.com/path/to/domocharts" BACKUP_URL="backup_sql.php" FILE_URL="backup-sql.sql.gz" # NAS NAS_ADDRESS="1.2.3.4" NAS_SHARE="/nfs/share" NAS_PATH="/backup/directory" MOUNT_POINT="/mnt/nfs" # Email MAIL_FROM="me@domain.com" MAIL_TO="me@domain.com" MAIL_SMTP="smtp.provider.com" MAIL_SUBJECT="Mail subject" # Perform backup OUTPUT=`/usr/bin/curl --silent ${SITE_URL}/${BACKUP_URL}` ERROR=`echo ${OUTPUT} | /bin/grep -c -i "error"` if [ ${ERROR} -eq 0 ] then # Mount NFS filesystem /bin/grep -qs "${MOUNT_POINT}" /proc/mounts if [ $? -ne 0 ] then /bin/mount -t nfs ${NAS_ADDRESS}:${NAS_SHARE} ${MOUNT_POINT} if [ $? -ne 0 ] then /bin/date echo "Error : cannot mount NFS filesystem" echo "Error : cannot mount NFS filesystem" | /bin/mailx -r "${MAIL_FROM}" -s "${MAIL_SUBJECT}" -S smtp="${MAIL_SMTP}" "${MAIL_TO}" exit 1 fi fi # Download backup file /usr/bin/curl --silent ${SITE_URL}/${FILE_URL} > ${MOUNT_POINT}/${NAS_PATH}/domotique_${OUTPUT}.sql.gz if [ $? -ne 0 ] then /bin/date echo "Error : cannot download backup file" echo "Error : cannot download backup file" | /bin/mailx -r "${MAIL_FROM}" -s "${MAIL_SUBJECT}" -S smtp="${MAIL_SMTP}" "${MAIL_TO}" fi # Unmount NFS filesystem /bin/umount ${MOUNT_POINT} else /bin/date echo "${OUTPUT}" # Send Email echo "${OUTPUT}" | /bin/mailx -r "${MAIL_FROM}" -s "${MAIL_SUBJECT}" -S smtp="${MAIL_SMTP}" "${MAIL_TO}" exit 99 fi exit 0 And the crontab to launch the backup every night at 02:30 : [root@redhat ~]# crontab -l 30 2 * * * /root/backup_domotique.sh >> /root/backup_domotique.out 2>&1 1
Nexus_77 Posté(e) le 20 octobre 2016 Signaler Posté(e) le 20 octobre 2016 hi Lazer, i add a MCO Co2 i push all buttton to vd, but i don't read a Co2 in a graph, i have error not device found. i see new temp ad humidity but no co2.. you have a idea? thanks
Lazer Posté(e) le 20 octobre 2016 Auteur Signaler Posté(e) le 20 octobre 2016 Can you share the JSON of your new device ? I will try to integrate it in a future release of Domocharts. For now, only Netatmo weather station is supported for CO2. 1
Nexus_77 Posté(e) le 20 octobre 2016 Signaler Posté(e) le 20 octobre 2016 Can you share the JSON of your new device ? I will try to integrate it in a future release of Domocharts. For now, only Netatmo weather station is supported for CO2. Ok tell me a procedure and i share asapInviato dal mio PLK-L01 utilizzando Tapatalk
Lazer Posté(e) le 20 octobre 2016 Auteur Signaler Posté(e) le 20 octobre 2016 open the following URL and copy/paste the result: http://IP_of_your_HC2/api/devices/ID_of_your_device ex : http://192.168.1.1/api/devices/127
Nexus_77 Posté(e) le 20 octobre 2016 Signaler Posté(e) le 20 octobre 2016 this is a main device: {"id":322,"name":"322","roomID":0,"type":"com.fibaro.zwaveDevice","baseType":"com.fibaro.device","enabled":true,"visible":false,"isPlugin":false,"parentId":1,"remoteGatewayId":0,"interfaces":["polling","zwave","zwaveAssociation","zwaveConfiguration","zwaveSlaveRouting"],"properties":{"associations":"[{\"endPointId\":0,\"groups\":[{\"groupInfo\":{\"commands\":[],\"name\":\"\",\"profile\":\"\"},\"id\":1,\"singleChannel\":{\"max\":5,\"set\":[1],\"view\":[1]}},{\"groupInfo\":{\"commands\":[],\"name\":\"\",\"profile\":\"\"},\"id\":2,\"singleChannel\":{\"max\":1,\"set\":[1],\"view\":[1]}}]}]","configured":"true","dead":"false","deviceControlType":"0","deviceIcon":"28","deviceSpecificData":"","deviceSpecificIdType":"","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"95","parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":2,"value":1000}],"parametersTemplate":"775","pollingInterval":"0","pollingTimeSec":0,"productInfo":"1,95,9,5,2,1,1,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smsNotificationID":"0","smsNotificationType":"0","useTemplate":"true","userDescription":"","zwaveCompany":"McoHome Technology Co., Ltd","zwaveInfo":"5,3,67","zwaveSoftwareVersion":"{}","zwaveVersion":"1.2"},"actions":{"getParameter":1,"poll":0,"reconfigure":0,"setParameter":2},"created":1476965482,"modified":1476965482,"sortOrder":134} Co2 sensor {"id":323,"name":"Co2 camera letto","roomID":5,"type":"com.fibaro.multilevelSensor","baseType":"com.fibaro.sensor","enabled":true,"visible":true,"isPlugin":false,"parentId":322,"remoteGatewayId":0,"interfaces":["zwave"],"properties":{"parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":2,"value":1000}],"zwaveCompany":"McoHome Technology Co., Ltd","zwaveInfo":"5,3,67","zwaveVersion":"1.2","pollingTimeSec":0,"configured":"true","dead":"false","deviceControlType":"0","deviceIcon":"47","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"95","parametersTemplate":"775","productInfo":"1,95,9,5,2,1,1,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smsNotificationID":"0","smsNotificationType":"0","unit":"ppm","useTemplate":"true","userDescription":"","value":"1949.00"},"actions":{"reconfigure":0},"created":1476965486,"modified":1476965486,"sortOrder":135} Temp sensor {"id":324,"name":"Temperatura","roomID":5,"type":"com.fibaro.temperatureSensor","baseType":"com.fibaro.multilevelSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":322,"remoteGatewayId":0,"interfaces":["zwave"],"properties":{"parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":2,"value":1000}],"zwaveCompany":"McoHome Technology Co., Ltd","zwaveInfo":"5,3,67","zwaveVersion":"1.2","pollingTimeSec":0,"configured":"true","dead":"false","deviceControlType":"0","deviceIcon":"30","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"95","offset":"0.00","parametersTemplate":"775","productInfo":"1,95,9,5,2,1,1,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","showFireAlarm":"true","showFreezeAlarm":"false","smsNotificationID":"0","smsNotificationType":"0","unit":"C","useTemplate":"true","userDescription":"","value":"20.30"},"actions":{"reconfigure":0},"created":1476965486,"modified":1476965486,"sortOrder":136} humidity sensor {"id":325,"name":"Umidità","roomID":5,"type":"com.fibaro.humiditySensor","baseType":"com.fibaro.multilevelSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":322,"remoteGatewayId":0,"interfaces":["zwave"],"properties":{"parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":2,"value":1000}],"zwaveCompany":"McoHome Technology Co., Ltd","zwaveInfo":"5,3,67","zwaveVersion":"1.2","pollingTimeSec":0,"configured":"true","dead":"false","deviceControlType":"0","deviceIcon":"31","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"95","parametersTemplate":"775","productInfo":"1,95,9,5,2,1,1,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smsNotificationID":"0","smsNotificationType":"0","unit":"%","useTemplate":"true","userDescription":"","value":"63.00"},"actions":{"reconfigure":0},"created":1476965486,"modified":1476965486,"sortOrder":137} Gas sensor {"id":326,"name":"322.0.3","roomID":5,"type":"com.fibaro.gasDetector","baseType":"com.fibaro.lifeDangerSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":322,"remoteGatewayId":0,"interfaces":["fibaroBreach","zwave","zwaveAlarm"],"properties":{"parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":2,"value":1000}],"zwaveCompany":"McoHome Technology Co., Ltd","zwaveInfo":"5,3,67","zwaveVersion":"1.2","pollingTimeSec":0,"alarmLevel":"0","alarmType":"0","configured":"true","dead":"false","deviceControlType":"0","deviceIcon":"21","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","lastBreached":"1476965495","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","model":"","nodeId":"95","parametersTemplate":"775","productInfo":"1,95,9,5,2,1,1,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smsNotificationID":"0","smsNotificationType":"0","useTemplate":"true","userDescription":"","value":"true"},"actions":{"reconfigure":0},"created":1476965486,"modified":1476965486,"sortOrder":138}
Lazer Posté(e) le 20 octobre 2016 Auteur Signaler Posté(e) le 20 octobre 2016 Great ! thank you But I don't give you a date for a future release, I don't work on this project for now....
Sakkhho Posté(e) le 29 janvier 2017 Signaler Posté(e) le 29 janvier 2017 @Lazer j'envisage d'acheter un northQ gaz pour suivre la consommation. Penses tu qu'il soit possible de recuperer la data pour mettre dans domochart ?
Lazer Posté(e) le 29 janvier 2017 Auteur Signaler Posté(e) le 29 janvier 2017 Aucune idée, faudrait avoir le JSON avant.Au pire ça sera toujours possible en passant par une variable globale.
Sakkhho Posté(e) le 29 janvier 2017 Signaler Posté(e) le 29 janvier 2017 i y a un VD sur le fofo officielle qui remonte les data et push vers EMONCMS j'ai installé pour voir if useGasNorthQ == true then rgas, status, errorCode = HC2:GET("/api/devices/"..gasNorthQID) end if useGasNorthQ == true then jsonTable4 = json.decode(rgas) gasValueNow = jsonTable4.properties.value g1 = os.time{year=year, month=month, day=day, hour=00, min=01, sec=00} if g1 > time then gasStartToday = (jsonTable4.properties.value) fibaro:setGlobal("gasStartToday", gasStartToday) end vgasStartToday = fibaro:getGlobal("gasStartToday") gasToday = gasValueNow-vgasStartToday fibaro:setGlobal("gasToday", gasToday) -- Gas per hour if minute == 00 then gasStartHour = gasValueNow fibaro:setGlobal("gasStartHour", gasStartHour) end if minute == 59 then gasStopHour = gasValueNow gasHour = gasStartHour - gasStopHour fibaro:setGlobal("gasHour", gasHour) else gasStartHour = fibaro:getGlobal("gasStartHour") gasHour = gasValueNow - gasStartHour end end et donc il semble recuperer le JSON pour conso depuis 1heure, sur la journée. le plus compliqué semble donc de savoir si mon compteur est compatible. mais ca semble le cas
Lazer Posté(e) le 29 janvier 2017 Auteur Signaler Posté(e) le 29 janvier 2017 ouais alors les cumuls de conso, remise à zero à intervalle régulier (heure, jour, etc) c'est galère car ce n'est pas géré par Domocharts, donc tu auras bien des courbes, mais le calcul de statistiques journalières sera foireux. J'ai le problème avec la sonde de pluie du plugin Netatmo.
Sakkhho Posté(e) le 29 janvier 2017 Signaler Posté(e) le 29 janvier 2017 Pas moyen de stocker dans un variable et d envoyer vers domocharts à 0h01 ?
Lazer Posté(e) le 30 janvier 2017 Auteur Signaler Posté(e) le 30 janvier 2017 si, mais tu devrais coder ça à la main, pour l'instant ça n'existe pas
Sakkhho Posté(e) le 30 janvier 2017 Signaler Posté(e) le 30 janvier 2017 Ok on verra. J ai commandé le compteur. À suivre.
Sakkhho Posté(e) le 2 février 2017 Signaler Posté(e) le 2 février 2017 (modifié) Hello - donc comme je l'ai dit sur le poste, ce device pas tres populaire fonctionne bien peut être un peu cher pour ce que c'est versus un capteur REEM + ecodevice mais bon, ca évité de tirer des cables pour le moment :-) et ca semble compter correctement. donc le nec plus ultra sera de plotter tout ca :-) @Lazer quelles sont les solutions que tu préconises ? merci pour ton aide Modifié le 2 février 2017 par Sakkhho 1
Lazer Posté(e) le 2 février 2017 Auteur Signaler Posté(e) le 2 février 2017 Déjà partage le JSON on verra ce qu'on peut trouver dedans.
Sakkhho Posté(e) le 3 février 2017 Signaler Posté(e) le 3 février 2017 (modifié) yes comment deja ? like that ? {{"id":545,"name":"Compteur Gaz","roomID":11, type":"com.fibaro.multilevelSensor", "baseType":"com.fibaro.sensor", "enabled":true,"visible":true, "isPlugin":false, "parentId":544, "remoteGatewayId":0, "interfaces":["battery","fibaroFirmwareUpdate","zwave","zwaveWakeup"], "properties": {"batteryLevel":100,"parameters":[{"id":1,"lastReportedValue":1000,"lastSetValue":1000,"size":4,"value":1000}, {"id":2,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1}, {"id":3,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0}, {"id":4,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0}, {"id":5,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0}, {"id":6,"lastReportedValue":5,"lastSetValue":5,"size":1,"value":5}, {"id":7,"lastReportedValue":10,"lastSetValue":10,"size":1,"value":10}, {"id":8,"lastReportedValue":900,"lastSetValue":900,"size":2,"value":900}, {"id":9,"lastReportedValue":2536834,"lastSetValue":2536834,"size":4,"value":2536834}, {"id":10,"lastReportedValue":3,"lastSetValue":3,"size":2,"value":3}, {"id":11,"lastReportedValue":0,"lastSetValue":0,"size":2,"value":0}, {"id":13,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1}], "pollingTimeSec":0,"wakeUpTime":900,"zwaveCompany":"NorthQ","zwaveInfo":"3,3,28", "zwaveVersion":"3.35","batteryLowNotification":"true","configured":"true","dead":"false", "defInterval":"0","deviceControlType":"0","deviceIcon":"1044","emailNotificationID":"0", "emailNotificationType":"0","endPointId":"0", "firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"3.35\"}", "liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"", "markAsDead":"true","maxInterval":"0","minInterval":"0","model":"", "nodeId":"117","parametersTemplate":"353","productInfo":"0,150,0,16,0,1,3,35", "pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true", "serialNumber":"h'00001153","smsNotificationID":"0","smsNotificationType":"0", "stepInterval":"0","unit":"m³","updateVersion":"","useTemplate":"true","userDescription":"", "value":"25376.66"},"actions":{"abortUpdate":1,"reconfigure":0,"retryUpdate":1,"setInterval":1,"startUpdate":1,"updateFirmware":1}, "created":1486045011,"modified":1486045011,"sortOrder":259} Modifié le 3 février 2017 par Sakkhho
Sakkhho Posté(e) le 4 février 2017 Signaler Posté(e) le 4 février 2017 Sachant que le VD j'ai mis en place possède les variables suivante gasHour gasStartHour gasStartToday gasToday gasValueNow
Lazer Posté(e) le 4 février 2017 Auteur Signaler Posté(e) le 4 février 2017 OK il va falloir créer de nouvelles tables pour gérer le gaz, que tu peux appeler domotique_gaz Avec PHPmyadmin, il faut copier une table existante. Ensuite il faut ajouter les informations nécessaire dans les fichiers, de mémoire dans : - index.php - config.js C'est essentiellement du copier/coller des lignes de configurations déjà existantes.... tu te sens de te lancer seul là dedans ? OK il va falloir créer de nouvelles tables pour gérer le gaz, que tu peux appeler domotique_gaz Avec PHPmyadmin, il faut copier une table existante. Ensuite il faut ajouter les informations nécessaire dans les fichiers, de mémoire dans : - index.php - config.js C'est essentiellement du copier/coller des lignes de configurations déjà existantes.... tu te sens de te lancer seul là dedans ? 1
Messages recommandés