FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: homer am 02 April 2013, 18:54:28

Titel: Plotting more than one device in a graph
Beitrag von: homer am 02 April 2013, 18:54:28
Hello all.

Can anyone advise how best to plot more data from more than one device on a graph? I have a number of Oregon temperature sensors and would like to plot these in 1 graph. I would also like to plot the measured temperature from an ELV Max radiator valve in the same graph as the Oregon thermometer in the same room.

Thanks
Homer
Titel: Aw: Plotting more than one device in a graph
Beitrag von: UliM am 02 April 2013, 19:20:16
Hi Homer,
you'll need to define a filelog that contains all sensors/data you'd like to plot, as one plot-definition can refer to one log only.

An example can be found e.g. here:
http://forum.fhem.de/index.php?t=msg&goto=30321&rid=86&srch=fht-own#msg_30321 (//forum.fhem.de/index.php?t=msg&goto=30321&rid=86&srch=fht-own#msg_30321)

Cheers,
Uli
Titel: Aw: Plotting more than one device in a graph
Beitrag von: homer am 02 April 2013, 20:25:54
Thansk Ulim,

I've tried this:

define FLTest FileLog ./log/testlog-%Y-%m.log (Study:(desiredTemperature|temperature).*| Roaming:.*T:.*)

and the logfile reports this:

wrong syntax: define <name> FileLog filename regexp

Study is an ELV radiator valve, and Roaming is an Oregon temperature sensor.

Am I misunderstanding the setup?

Thanks
Homer
Titel: Aw: Plotting more than one device in a graph
Beitrag von: Niko am 03 April 2013, 09:27:25
For me

define BrEnergy_fl FileLog ./log/BrEnergy-%Y.log PV01:(Pac).*|PV02:(Pac).*

worked.
Titel: Aw: Plotting more than one device in a graph
Beitrag von: Puschel74 am 03 April 2013, 10:38:54
Hello,

sorry, but my english is not so good.

Here a Link:
Link (http://forum.fhem.de/index.php?topic=10439.0)

Greets
Titel: Aw: Plotting more than one device in a graph
Beitrag von: homer am 04 April 2013, 19:19:45
Thanks everyone for your help. To summarise, I had a ELV Max radiator valve (called Study) and an Oregon temperature sensor called Roaming, and I have managed to get these 2 devices plotted onto 1 graph with the following:

in flem.cfg:
define FLTest FileLog ./log/testlog-%Y-%m.log Study:(desiredTemperature|temperature).*|Roaming:(T:).*
attr FLTest logtype temp4temp4temp4:Temp/Temp/Temp,text
define StudyConsolidated weblink fileplot FLTest:temp4temp4temp4:CURRENT
attr StudyConsolidated room Plots

which created a logfile like this:
2013-04-03_22:09:56 Roaming T: 16.9 BAT: ok
2013-04-03_22:10:04 Study desiredTemperature: 14.0
2013-04-03_22:10:04 Study temperature: 19.6
2013-04-03_22:10:35 Roaming T: 16.9 BAT: ok
2013-04-03_22:11:04 Study desiredTemperature: 14.0
2013-04-03_22:11:04 Study temperature: 19.6
2013-04-03_22:11:14 Roaming T: 16.9 BAT: ok
2013-04-03_22:11:53 Roaming T: 16.9 BAT: ok
2013-04-03_22:12:05 Study desiredTemperature: 14.0
2013-04-03_22:12:05 Study temperature: 19.6
2013-04-03_22:12:32 Roaming T: 16.9 BAT: ok
2013-04-03_22:13:05 Study desiredTemperature: 14.0
2013-04-03_22:13:05 Study temperature: 19.6
2013-04-03_22:13:11 Roaming T: 16.9 BAT: ok
2013-04-03_22:13:50 Roaming T: 16.9 BAT: ok
2013-04-03_22:14:05 Study desiredTemperature: 14.0
2013-04-03_22:14:05 Study temperature: 19.6

I created a temp4temp4temp4.gplot file, like this:
# Attribute 'small' is useful for gnuplot/-scroll only,
# if plotsize is less than 800,400
#set terminal png transparent small size <SIZE> crop

set terminal png transparent size <SIZE> crop

set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set ytics nomirror
set y2tics
#set ytics
set title '<L1>'
set grid xtics y2tics

set y2label "Temperature in C"
set y2label "Temperature in C"


#FileLog 4:temperature:0:
#FileLog 4:T\x3a:0:
#FileLog 4:desiredTemperature:0:

plot \
  "< egrep "Study temperature" <IN>"\
        axes x1y1 title 'Measured temperature' with lines,\
  "< egrep "Roaming T:" <IN>"\
        axes x1y1 title 'Actual temperature' with lines,\
  "< egrep "desiredTemperature:" <IN>"\
        axes x1y1 title 'Desired temperature' with lines\


I know this gplot file is custom (not generic) but it does give me the graph I was wanting.

Does anyone have any comments? It's difficult to determine if I'm doing this the right way because (as a number of people have commented) the google translate isn't great (!!) and my understanding of German is even worse! I really thank all of you non-native English speakers out there who take the time to read my posts and try to help. Fhem is starting to control my home in a great way. I just need to understand it better (and perl etc).

Finally, if anyone has any comments on the above, and how I could add a fourth plot (the boiler status) that would be great. The boiler switch is a Homeeasy appliance switch (that I plan to modifiy). It's setup is:

define boiler TRX_LIGHT AC 0017B62607 BOILERCONTROL
attr boiler room Heating

How can I get the on/off status from a log file into a graph?

Thanks
Homer