OK super, vielen Dank. Macht auch mehr Sinn ;-)
Ankündigung
Einklappen
Keine Ankündigung bisher.
Wie erstelle ich ein Diagramm in der CometVisu?
Einklappen
X
-
So wie hier sollte die linknx.xlm aussehen.
Code:<?xml version="1.0" ?> <config> <services> <knxconnection url="ip:127.0.0.1" /> <xmlserver type="inet" port="1028"/> <exceptiondays> <date day="1" month="1" /> <date day="1" month="5" /> <date day="15" month="8" /> <date day="25" month="12" /> <date day="25" month="4" year="2011" /> <date day="2" month="6" year="2011" /> <date day="13" month="6" year="2011" /> <date day="9" month="4" year="2012" /> <date day="17" month="5" year="2012" /> <date day="28" month="5" year="2012" /> <date day="1" month="4" year="2013" /> <date day="9" month="5" year="2013" /> <date day="20" month="5" year="2013" /> <date day="21" month="4" year="2014" /> <date day="29" month="5" year="2014" /> <date day="9" month="6" year="2014" /> </exceptiondays> <persistence type="file" path="/var/lib/linknx" /> </services> <objects> <object id="raumtemp" gad="0/4/0" type="9.xxx" flags="cwu" init="persist" log="false">Raumtemperatur</object> <object id="RL_WC" gad="0/1/17" type="9.xxx" flags="crwtu" log="false">RL_WC</object> </objects> <rules> </rules> <logging output="/var/log/linknx.log" format="%d{%Y-%m-%d %H:%M:%S,%l} %5p > %c %x - %m%n" level="NOTICE" maxfilesize="100" maxfileindex="2" /> </config>
Kommentar
-
So sieht es im Moment aus:
Code:<?xml version="1.0" ?> <config> <services> <knxconnection url="ip:127.0.0.1" /> <xmlserver type="inet" port="1028"/> <exceptiondays> <date day="1" month="1" /> <date day="1" month="5" /> <date day="15" month="8" /> <date day="25" month="12" /> <date day="25" month="4" year="2011" /> <date day="2" month="6" year="2011" /> <date day="13" month="6" year="2011" /> <date day="9" month="4" year="2012" /> <date day="17" month="5" year="2012" /> <date day="28" month="5" year="2012" /> <date day="1" month="4" year="2013" /> <date day="9" month="5" year="2013" /> <date day="20" month="5" year="2013" /> <date day="21" month="4" year="2014" /> <date day="29" month="5" year="2014" /> <date day="9" month="6" year="2014" /> </exceptiondays> <persistence type="file" path="/var/lib/linknx" /> </services> <objects> <object id="raumtemp" gad="0/4/0" type="9.001" flags="cwu" init="persist" log="false">Raumtemperatur</object> </objects> <rules> <!-- <rule id="cur_time_date"> <condition type="timer" trigger="true"> <every>20</every> </condition> <actionlist> <action type="set-value" id="cur_time" value="now" /> <action type="set-value" id="cur_date" value="now" /> </actionlist> --> </rule> </rules> <logging output="/var/log/linknx.log" format="%d{%Y-%m-%d %H:%M:%S,%l} %5p > %c %x - %m%n" level="INFO" maxfilesize="100" maxfileindex="2" /> </config>
Crontab:
Code:# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # */5 * * * * root /var/www/rrd/raumtemp
Code:<diagram legend="popup" series="day" refresh="300" popup="true" previewlabels="false" legendposition="nw" period="2" datasource="AVERAGE"> <label>Raumtemperatur</label> <axis unit="Impulse">Load</axis> <rrd datasourceIndex="0" consolidationFunction="AVERAGE">raumtemp.rrd</rrd> </diagram>
Code:#!/bin/bash # # update .rrd database text file from linknx # # $Id: update_cputemp 275 2013-05-16 05:20:56Z lenik $ cd /var/www/rrd # create database if not exists [ -f raumtemp.rrd ] || { /usr/bin/rrdtool create raumtemp.rrd --step 300 \ DS:Temperatur:GAUGE:1200:U:U \ RRA:AVERAGE:0.5:1:3200 \ RRA:AVERAGE:0.5:6:3200 \ RRA:AVERAGE:0.5:36:3200 \ RRA:AVERAGE:0.5:144:3200 \ RRA:AVERAGE:0.5:1008:3200 \ RRA:AVERAGE:0.5:4320:3200 \ RRA:AVERAGE:0.5:52560:3200 \ RRA:AVERAGE:0.5:525600:3200 } # Read temperature from text file temp=`cat /var/lib/linknx/raumtemp` # Update database rrdtool update raumtemp.rrd N:$temp
Das Diagramm wird aber bisher nur ohne Inhalt und Legende AngezeigtZuletzt geändert von thomas6789; 30.11.2016, 17:27.
Kommentar
-
Hallo Thomas,
Ich stand vor kurzem vor dem selben Problem.
Bei mir war es der Fall, dass die Datei mit dem Temperaturwert in einem Unterordner abgelegt wurde.
Diese Datei müsstest du auch auf dem Raspberry sehen.
Ändere den Pfad einfach mal in /var/lib/linknx/persist/raumtemp
Schau aber ruhig mal in den Ordner rein, ob dieser bei dir auch erstellt wurde.
Wird denn die Datenbank (raumtemp.rrd) problemlos angelegt?
Gruß StefanLiebe Grüße
Stefan
Kommentar
-
Naja das Problem ist ja, dass solange linknx die Datei nicht anlegt, auch kein Wert ausgelesen werden kann.
Trag hier als Datentyp mal versuchsweise type="9.xxx" ein und reboote den Raspberry.
<object id="raumtemp" gad="0/4/0" type="9.001" flags="cwu" init="persist" log="false">Raumtemperatur</object>
Gruss StefanZuletzt geändert von spielkind1611; 30.11.2016, 20:05.Liebe Grüße
Stefan
Kommentar
-
Hallo,
Ich habe den Fehler gefunden. Es liegt unter anderem auch an dem Raspberry-Image aus dem Forum. Hier ist eine fehlerhafte Datei "Linknx.xml" integriert.
Dieses Problem ist anscheinend auch schon öfter mal aufgefallen nur wurde es nie mit dem Image in Verbindung gebracht.
Im unteren Bereich befindet sich eine Auskommentierung an der falschen Stelle.
Diese hinter
Code:</actionlist> -->
Code:</rule> -->
Ich hatte das damals bei mir in Ordnung bekommen, da ich mir die Datei "Linknx.xml" irgendwo aus dem Internet kopiert hatte.
Daher befinden sich die Dateien bei mir auch in einem Unterordner.
Der Speicherort wird durch die folgende Zeile festgelegt
Code:<persistence type="file" path="/var/lib/linknx" />
Ist es möglich diese Datei in dem Image in Ordnung zu bringen? Zumindest sollte man im Eingangspost eine Anmerkung darüber hinzufügen.
Gruss StefanZuletzt geändert von spielkind1611; 30.11.2016, 22:05.Liebe Grüße
Stefan
Kommentar
Kommentar