FHEM Forum

FHEM => Frontends => TabletUI => Thema gestartet von: tobi03 am 02 Juni 2018, 22:56:05

Titel: Chart ohne Funktion
Beitrag von: tobi03 am 02 Juni 2018, 22:56:05
Hallo FHEM Freunde,
ich bin vor kurzem in FHEM eingestiegen um meine eigene Wetterstation zu bauen. Habe schon ein paar Sensoren eingefügt und die werden auch erfolgreich in FTUI angezeigt (Label).
Nun wollte ich von der Feinstaubmessung ein Chart erstellen lassen, aber ich habe irgendwo einen Denkfehler. Ich bekomme einfach keine Werte angezeigt.

Ich füge mal ein paar Bilder ein, villeicht erkennt von euch erfahrenen FHEMlern ja einen Fehler


Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 03 Juni 2018, 10:47:14
 ::)
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 03 Juni 2018, 21:48:08
Niemand eine Idee?

Gesendet von meinem BLA-L09 mit Tapatalk

Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 03 Juni 2018, 21:54:59
Bitte die gesamte html Datei in Code Tags posten, und ein "list" vom Sensor.
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 03 Juni 2018, 22:04:47

              <div data-type ="label"
              data-device="ESPEasy_Aussenstation_BMP280"
              data-get="Luftdruck"
              data-unit="hp"></div>


            <div data-type ="popup" data-width ="450px" class ="">
            <div data-type ="simplechart"
            data-device="ESPEasy_Aussenstation_Feinstaub"
            data-logdevice="DR_Feinstaub-2018-06-02.log"
            data-columnspec="4:Feinstaub"
            data-minvalue ="auto"
            data-maxvalue ="auto"
            data-height ="150"
            data-width ="90"
            data-yticks="2"
            class ="">

</div>
<div class ="dialog">
<header>Feinstaubbelastung</header>
<div data-type ="simplechart"
data-device ="ESPEasy_Aussenstation_Feinstaub"
data-logdevice="DR-Feinstaub-2018-06-02.log"
data-columnspec="4:Feinstaub"
data-minvalue ="auto"
data-maxvalue ="auto"
data-yticks="2"
data-caption="$min - $max"
data-height ="250"




            </div>

</div>
</div>
</div>
</li>

        </ul>
    </div>
</body>

</html>

Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 04 Juni 2018, 00:20:16
Um ein "list" von einem Device zu kriegen, gibt man einfach "list <devicename>" im Kommandofeld von der Fhem Weboberfläsche ein.

Es fehlt die hälfte von deiner html Datei, so dass man schwierig prüfen kann, dass alles korrekt ist (Syntax, <li> Tags usw)

Du möchtest den Chart in einem Popup vergrössern? Versuch zuerst nur einen normalen Chart zu kriegen, und erst wenn mit data-type "simplechart" alles richtig ist, verschachtelst Du es in einem Popup.

Und verwechsele nicht das Widget "chart" und das Widget "simplechart". Ich bin z.B. nicht sicher, dass  data-minvalue ="auto" eine Option von simplechart ist.
Titel: Antw:Chart ohne Funktion
Beitrag von: eki am 04 Juni 2018, 14:31:13
Wichtig wäre auch noch, einen Auszug aus dem Logfile zu posten (DR_Feinstaub-2018-06-02.log). Ist aus meiner Sicht wichtiger um zu schauen, ob die columnspec richtig ist.
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 04 Juni 2018, 21:35:55
hier schonmal das was bei list rauskommt und die Logfile.
Wie war die Tastenkombi um den Text per putty aus nano zu kopieren und hier einzufügen? Irgendwie klappt das gerade nicht.....
Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 04 Juni 2018, 22:16:26
Bilder sind sehr aufwendiger zu lesen, und da kann man keine Suche machen, bzw. mit einem vernünftigen Editor formattieren / analysieren.
Bei putty gibt es keine Tastenkombination: Text markieren, und schon ist es im Zwischenspeicher. Mit nano, weiss ich nicht, aber mit more oder tail und grep, kann man einfach alles in der Konsole kriegen.

Was Du als Bild für das "list" hinzugefügt hast, kannst Du auch einfach mit copy/paste in code Tags kopieren.
Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 04 Juni 2018, 22:27:14
Für dein simplechart, probier mal bitte mit:
            data-minvalue ="90"
            data-maxvalue ="100"
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 04 Juni 2018, 22:32:17
Internals:
   DEF        192.168.178.89 80 Wetterstation Aussenstation_Feinstaub
   ESP_BUILD  20102
   ESP_BUILD_GIT (custom)
   ESP_BUILD_NOTES  - Mega
   ESP_NODE_TYPE_ID 17: ESP Easy Mega
   ESP_SLEEP  0
   ESP_UNIT   1
   ESP_VERSION 2
   HOST       192.168.178.89
   IDENT      Aussenstation_Feinstaub
   INTERVAL   300
   IODev      Wetterstation
   LASTInputDev Wetterstation
   MSGCNT     9241
   NAME       ESPEasy_Aussenstation_Feinstaub
   NOTIFYDEV  global
   NR         24
   NTFY_ORDER 50-ESPEasy_Aussenstation_Feinstaub
   PORT       80
   STATE      Fei: 99.00
   SUBTYPE    device
   TYPE       ESPEasy
   VERSION    1.39
   Wetterstation_MSGCNT 9241
   Wetterstation_TIME 2018-06-04 22:31:25
   READINGS:
     2018-06-04 22:31:25   Feinstaub       99.00
     2018-06-04 22:27:25   presence        present
     2018-06-04 22:31:25   state           Fei: 99.00
   helper:
     fpc        1527866964
     pm:
       Encode     1
       JSON       1
     received:
       Feinstaub  1528144285
Attributes:
   IODev      Wetterstation
   Interval   300
   group      ESPEasy Device
   presenceCheck 1
   readingSwitchText 1
   room       Wetterstation
   setState   3
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 04 Juni 2018, 22:33:50
hier die log einträge 8)

2018-06-03_00:00:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:00:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:01:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:01:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:02:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:02:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:03:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:03:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:04:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:04:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:05:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:05:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:06:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:06:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:07:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:07:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 101.00
2018-06-03_00:08:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 100.00
2018-06-03_00:08:38 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
2018-06-03_00:09:08 ESPEasy_Aussenstation_Feinstaub Feinstaub: 99.00
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 04 Juni 2018, 22:38:39
So jetzt hats endlich geklappt mit kopieren, hier die html file von ftui

<!DOCTYPE html>
<html>

<head>
    <!--
     /* FHEM tablet ui */
     /*
     * UI builder framework for FHEM
     *
     * Version: 2.5.*
     * URL: https://github.com/knowthelist/fhem-tablet-ui
     *
     * Copyright (c) 2015-2017 Mario Stephan <mstephan@shared-files.de>
     * Under MIT License (http://www.opensource.org/licenses/mit-license.php)
     *
     * - create a new folder named 'tablet' in /<fhem-path>/www
     * - copy all files incl. sub folders into /<fhem-path>/www/tablet
     * - add 'define TABLETUI HTTPSRV ftui ./www/tablet Tablet' in fhem.cfg
     * - Tadaaa! A new fhem ui in http://<fhem-url>:8083/fhem/tablet/
     */
    -->
    <link rel="icon" href="favicon.ico" type="image/x-icon" />

    <!-- define your personal style here, it wont be overwritten  -->
    <!-- link rel="stylesheet" href="css/fhem-green-ui.css" / -->
    <!-- link rel="stylesheet" href="css/fhem-tablet-ui-user.css" / -->

    <script src="js/fhem-tablet-ui.js" defer></script>


    <!-- Remove this line to enable for usage with WebViewControl
    <script defer>var wvcDevices = {'12345': 'Tablet'}; var wvcUserCssFile="webviewcontrol.css"</script>
    <script src="../pgm2/cordova-2.3.0.js" defer></script>
    <script src="../pgm2/webviewcontrol.js" defer></script>
    <!-- End for WebViewControl -->

    <title>FHEM-Tablet-UI</title>
</head>

<body>

    <div class="gridster">
        <ul>

             <li data-row="1" data-col="1" data-sizex="1" data-sizey="2">
             <header>Wetterstation</header>
             <div>Temperatur</div>
             <div data-type ="label"
              data-device="ESPEasy_Aussenstation_DHT22"
              data-get="Temperatur"
              data-unit="&deg;C"></div>


              <div>Luftfeuchtigkeit</div>
              <div data-type ="label"
              data-device="ESPEasy_Aussenstation_DHT22"
              data-get="Luftfeuchtigkeit"
              data-unit="%"></div>

   <div>Luftdruck</div>
              <div data-type ="label"
              data-device="ESPEasy_Aussenstation_BMP280"
              data-get="Luftdruck"
              data-unit="hp"></div>


            <div data-type ="popup" data-width ="450px" class ="">
            <div data-type ="simplechart"
            data-device="ESPEasy_Aussenstation_Feinstaub"
            data-logdevice="DR_Feinstaub-2018-06-02.log"
            data-columnspec="4:Feinstaub"
            data-minvalue ="auto"
            data-maxvalue ="auto"
            data-height ="150"
            data-width ="90"
            data-yticks="2"
            class ="">

</div>
<div class ="dialog">
<header>Feinstaubbelastung</header>
<div data-type ="simplechart"
data-device ="ESPEasy_Aussenstation_Feinstaub"
data-logdevice="DR-Feinstaub-2018-06-02.log"
data-columnspec="4:Feinstaub"
data-minvalue ="auto"
data-maxvalue ="auto"
data-yticks="2"
     class ="">

</div>
<div class ="dialog">
<header>Feinstaubbelastung</header>
<div data-type ="simplechart"
data-device ="ESPEasy_Aussenstation_Feinstaub"
data-logdevice="DR-Feinstaub-2018-06-02.log"
data-columnspec="4:Feinstaub"
data-minvalue ="auto"
data-maxvalue ="auto"
data-yticks="2"
data-caption="$min - $max"
data-height ="250"




            </div>

</div>
</div>
</div>
</li>

        </ul>
    </div>
</body>

</html>






Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 04 Juni 2018, 22:40:40
Ich vermute ich habe einen Fehler beim Logfile Pfad, beim Columnspec oder beim data Device
Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 04 Juni 2018, 22:43:15
Sehr schön.

Also... m.A. ist dein Problem nicht columnspec (scheint OK) sondern dein html. Wie gesagt, versuch erstmal ein "simple" simplechart statt "popup" und "dialog" zu bauen und mach mal diese "auto" weg

data-logdevice soll den Devicename des Filelog Devices enthalten, kein .log am ENde und vermutlich kein Datum. Das ist keine Datei sondern ein Device in Fhem.
data-logfile dann mit .log und vollständige Dateiname (ohne Pfad) oder "-" für die aktuelle oder einfach weg lassen ("-" ist der Standard-Wert)
Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 05 Juni 2018, 23:15:38
so ich hab jetzt nochmal ein bisschen rumgebastelt und hab ein einfaches chart geschrieben. das chart wird angezeigt aber keiner werte :(

ich poste euch mal den aktuellen html stand. habe unterschiedliche beispiele gefunden und beide verbastelt, einmal mit Feinstaubsensor und einmal mit DHT22

<!DOCTYPE html>
<html>

<head>
    <!--
     /* FHEM tablet ui */
     /*
     * UI builder framework for FHEM
     *
     * Version: 2.5.*
     * URL: https://github.com/knowthelist/fhem-tablet-ui
     *
     * Copyright (c) 2015-2017 Mario Stephan <mstephan@shared-files.de>
     * Under MIT License (http://www.opensource.org/licenses/mit-license.php)
     *
     * - create a new folder named 'tablet' in /<fhem-path>/www
     * - copy all files incl. sub folders into /<fhem-path>/www/tablet
     * - add 'define TABLETUI HTTPSRV ftui ./www/tablet Tablet' in fhem.cfg
     * - Tadaaa! A new fhem ui in http://<fhem-url>:8083/fhem/tablet/
     */
    -->
    <link rel="icon" href="favicon.ico" type="image/x-icon" />

    <!-- define your personal style here, it wont be overwritten  -->
    <!-- link rel="stylesheet" href="css/fhem-green-ui.css" / -->
    <!-- link rel="stylesheet" href="css/fhem-tablet-ui-user.css" / -->

    <script src="js/fhem-tablet-ui.js" defer></script>


    <!-- Remove this line to enable for usage with WebViewControl
    <script defer>var wvcDevices = {'12345': 'Tablet'}; var wvcUserCssFile="webviewcontrol.css"</script>
    <script src="../pgm2/cordova-2.3.0.js" defer></script>
    <script src="../pgm2/webviewcontrol.js" defer></script>
    <!-- End for WebViewControl -->

    <title>FHEM-Tablet-UI</title>
</head>

<body>

    <div class="gridster">
        <ul>

             <li data-row="1" data-col="1" data-sizex="1" data-sizey="2">
             <header>Wetterstation</header>
             <div>Temperatur</div>
             <div data-type ="label"
              data-device="ESPEasy_Aussenstation_DHT22"
              data-get="Temperatur"
              data-unit="&deg;C"></div>


              <div>Luftfeuchtigkeit</div>
              <div data-type ="label"
              data-device="ESPEasy_Aussenstation_DHT22"
              data-get="Luftfeuchtigkeit"
              data-unit="%"></div>

             <div>Luftdruck</div>
              <div data-type ="label"
              data-device="ESPEasy_Aussenstation_BMP280"
              data-get="Luftdruck"
              data-unit="hp"></div>



<div data-type ="chart"
data-logdevice="ESPEasy_Aussenstation_Feinstaub"
data-columnspec="4:Feinstaub"
data-style ="ftui l1dot"
data-ptype ="lines"
data-uaxis ="primary"
data-legend="Feinstaub mg³"
data-yunit="mg"
data-ytext ="Feinstaub"
data-minvalue ="auto"
data-maxvalue ="auto"
data-height ="250"
data-yticks="auto"
data-nofulldays="true"
data-daysago_start ="-5H"
data-daysago_end="-22H"
data-cursorgroup="1"
data-scrollgroup="1"
data-xticks="auto"

</div>

<div data-type ="chart"
data-device="ESPEasy_Aussenstation_DHT22"
data-logdevice="FileLog_Temperatur"
data-logfile="-"
data-Columnspec="4:Temperatur"
data-style ="ftui 1ldot"
data-ptype ="lines"
data-uaxis ="primary"
data-legend="Temperatur C°"
data-yunit="C°"
data-ytext ="Temperatur"
data-minvalue ="auto"
data-maxvalue ="auto"
data-height = "250"
data-yticks ="auto"
data-nofulldays ="true"
data-daysago_start ="-5H"
data-daysago_end ="-22H"
data-cursorgroup ="1"
data-scrollgroup ="1"
data-xticks ="auto"

</div>



            </div>

</div>
</div>
</div>
</li>

        </ul>
    </div>
</body>

</html>






Titel: Antw:Chart ohne Funktion
Beitrag von: amenomade am 06 Juni 2018, 07:16:22
data-logdevice="ESPEasy_Aussenstation_Feinstaub"
Das ist falsch. ESPEasy_Aussenstation_Feinstaub ist kein Log Device, sondern ein ESPeasy Device
Zitat von: tobi03 am 04 Juni 2018, 22:32:17
Internals:
   DEF        192.168.178.89 80 Wetterstation Aussenstation_Feinstaub
(...)
   NAME       ESPEasy_Aussenstation_Feinstaub
(...)
   SUBTYPE    device
   TYPE       ESPEasy


Richtig wäre:
data-device="ESPEasy_Aussenstation_Feinstaub"
data-logdevice="<FileLog Device>"

"FileLog Device": wie auch immer dein Device heisst, wo die Werte gespeichert werden. Kein Dateiname, sondern ein Devicename. Laut Antwort #4 ist ein Filelog Device "Feinstaub" in "probably associated with" zu sehen. Wahrscheinlich das richtige, also:
data-logdevice="Feinstaub"

Titel: Antw:Chart ohne Funktion
Beitrag von: tobi03 am 06 Juni 2018, 17:42:51
Du bist ein Genie :)
genau daran lag es. Ich war mir nicht sicher was ich dort eintragen muss, aus dem Beispiel im Wiki konnte ich es auch nicht rauslesen.
jetzt funktioniert es und ich bekomme linien angezeigt. Super vielen Dank :)