FHEM Forum

FHEM => English Corner => Thema gestartet von: @lex99 am 09 April 2023, 20:58:56

Titel: SVG Plot that won't connect the dots
Beitrag von: @lex99 am 09 April 2023, 20:58:56
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 ?

2023-04-09 20_57_02-Home, Sweet Home — Mozilla Firefox.jpg
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: Gisbert am 09 April 2023, 22:10:35
Hi @lex99,

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

Regards
Gisbert
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: @lex99 am 09 April 2023, 22:19:44
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.
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: Gisbert am 10 April 2023, 07:59:59
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
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: rudolfkoenig am 10 April 2023, 11:19:44
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).
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: betateilchen am 11 April 2023, 17:02:10
@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.
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: rudolfkoenig am 11 April 2023, 17:05:20
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.
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: betateilchen am 11 April 2023, 17:15:19
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).
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: rudolfkoenig am 11 April 2023, 17:25:25
I see, but I am not yet convinced, that the overhead in such cases makes a noticeable difference.
Titel: Aw: SVG Plot that won't connect the dots
Beitrag von: betateilchen am 11 April 2023, 20:25:14
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.