FHEM > English Corner
SVG plots
(1/1)
jacko:
I am trying to generate what I thought would be a really simple plot of a device's state over time, in this case a heating element that turns on and off depending on the temperature. The plot should look like a square wave.
I have configured the SVG element as in the attached image ("Plot Editor settings"), triggering off the state changes to the Heater Relay.
The closest I can get is to use "points" style and imagine the lines! ("Points plot" attachment).
The logfile contains the following entries
--- Code: ---get fl_Air_temp CURRENT INT 2022-03-03_00:00:00 2022-03-03_23:59:59 "1":HeaterRelay.on:: "0.2":HeaterRelay.off::
2022-03-03_09:48:46 1
2022-03-03_12:59:04 1
2022-03-03_15:48:18 1
2022-03-03_17:02:14 1
#"1":HeaterRelay.on::
2022-03-03_09:47:58 0.2
2022-03-03_09:48:47 0.2
2022-03-03_13:14:15 0.2
2022-03-03_16:02:59 0.2
2022-03-03_17:18:45 0.2
#"0.2":HeaterRelay.off::
--- Ende Code ---
To compound things, I can't even find where the .gplot file is stored!?!?!
Any pointers would be appreciated.
rudolfkoenig:
--- Zitat ---I am trying to generate what I thought would be a really simple plot of a device's state over time, in this case a heating element that turns on and off depending on the temperature. The plot should look like a square wave.
--- Ende Zitat ---
This question is coming up regularly, but finding the answer via a search engine is not really straightforward.
The solution is to generate numbers from the strings with a "Function", $fld[2]=~"on"?1:0.2 should work in your case.
Dont forget the correct Regexp, though.
--- Zitat ---To compound things, I can't even find where the .gplot file is stored!?!?!
--- Ende Zitat ---
Looks like you're on the beginning end of unix-expertship :)
Try to search for it with:
--- Code: ---find /opt/fhem -name \*.gplot
--- Ende Code ---
or
--- Code: ---grep -rl HeaterRelay /opt/fhem
--- Ende Code ---
jacko:
Thanks for the pointer. I have now got the graph working (and learned a few more things about fhem on the way).
For the record, I had to select the wildcard state, in this case HeaterRelay.*, and the "steps" plot-type.
I also found the .gplot file. Perhaps as an enhancement request the actual name of the .gplot file could be displayed on the graph configuration page?
Cheers.
Prof. Dr. Peter Henning:
--- Zitat --- Perhaps as an enhancement request the actual name of the .gplot file could be displayed on the graph configuration page?
--- Ende Zitat ---
Take a closer look and you'll see that this is already the case.
Regards
pah
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln