SVG Plot that won't connect the dots

Begonnen von @lex99, 09 April 2023, 20:58:56

Vorheriges Thema - Nächstes Thema

@lex99

Hi,

I am using a SVG plot for the power drained from the grid (smart meter data).

However, when I drain nothing during the afternoon, the SVG plot will connect the dots making the plot confusing.

Is there a way to avoid this ?

Du darfst diesen Dateianhang nicht ansehen.

Gisbert

#1
Hi @lex99,

please check whether steps, histeps or fsteps fit better than lines.

Regards
Gisbert
Aktuelles FHEM | PROXMOX | Fujitsu Futro S740 | Debian 12 | UniFi | Homematic, VCCU, HMUART | ESP8266 | ATtiny85 | Wasser-, Stromzähler | Wlan-Kamera | SIGNALduino, Flamingo Rauchmelder FA21/22RF | RHASSPY

@lex99

Hi,

Unfortunately, it all give similar results, with some variations, but the big block at the time where the data is zero is still there.

Gisbert

Hi @lex99,

please check the log-file with the values in the time frame you are interested in and verify that all data values are zero.

Please post the SVG-Device here (Copy for Forum).

Regards
Gisbert
Aktuelles FHEM | PROXMOX | Fujitsu Futro S740 | Debian 12 | UniFi | Homematic, VCCU, HMUART | ESP8266 | ATtiny85 | Wasser-, Stromzähler | Wlan-Kamera | SIGNALduino, Flamingo Rauchmelder FA21/22RF | RHASSPY

rudolfkoenig

ZitatUnfortunately, it all give similar results, with some variations, but the big block at the time where the data is zero is still there.
The issue is, that there is no zero there, the data is just missing.

In order to see zeroes, you have to generate them, so the code in SVG.pm knows, where to start drawing them.
This can be done in FHEM with a reoccuring task (e.g. at every 10 Minutes), which generates a zero via the trigger or setreading FHEM command, if the last received data is older then say 5 Minutes (see the perl ReadingsAge function).

betateilchen

@Rudi: are there any intentions to add a "set ... addLog" command into FileLog similar to the solution in DbLog? This could be very helpful in such cases.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

rudolfkoenig

Zitat@Rudi: are there any intentions to add a "set ... addLog" command into FileLog similar to the solution in DbLog?
Not yet, as I dont yet see the advantage compared to setreading or trigger.
Feel free to enlighten me.

betateilchen

setreading and trigger will both start the complete notify loop, addLog does not start this loop.
In most cases of "missing values in the logfile" the notify loop is not needed (or wanted).
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

rudolfkoenig

I see, but I am not yet convinced, that the overhead in such cases makes a noticeable difference.

betateilchen

Zitat von: rudolfkoenig am 10 April 2023, 11:19:44This can be done in FHEM with a reoccuring task (e.g. at every 10 Minutes), which generates a zero via the trigger or setreading FHEM command, if the last received data is older then say 5 Minutes (see the perl ReadingsAge function).

FileLog already offers an addLog mechanism which can be configured by attribute:

    <a id="FileLog-attr-addLog"></a>
    <li>addLog<br>
        This attribute takes a comma-separated list of
        devspec:reading:maxInterval triples.  You may use regular expressions
        for reading. The last value of the reading will be written to the
        logfile, if after maxInterval seconds no event for this device/reading
        has arrived.
        </li><br>


Not the same philosophy as in DbLog, but helpful in similar problems like in this thread.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!