Hallo,
ich habe mich dieser Tage mit dem Statistics Modul angefreundet und bin begeistert.
Versuche nun jedoch ein Lösung für einen Betriebsstundenzähler zu definieren und irgenwie klappt das nicht so wie ich das will.
define Statistik3 statistics TestLampe
attr Statistik3 durationReadings myStatus
attr Statistik3 ignoreDefaultAssignments 1
attr Statistik3 room NeuTest
attr Statistik3 singularReadings TestLampe:myStatus:DurationMyStatus:(Hour|Day|Month|Year)
und die Readings dazu...
myStatus on 2015-12-27 11:54:05
statMyStatusDay off 00:00:00 off: 00:01:35 off_Count 00:00:01 off_Count: 2 on: 00:06:32 on_Count: 3 (since: 2015-12-27_11:45:58) 2015-12-27 11:54:05
statMyStatusMonth off 00:00:00 off: 00:01:35 off_Count 00:00:01 off_Count: 2 on: 00:06:32 on_Count: 3 (since: 2015-12-27_11:45:58) 2015-12-27 11:54:05
statMyStatusYear off 00:00:00 off: 00:01:35 off_Count 00:00:01 off_Count: 2 on: 00:06:32 on_Count: 3 (since: 2015-12-27_11:45:58) 2015-12-27 11:54:05
state on 2015-12-27 11:50:08
Zitat
singularReadings <GerätRegExp:GeräteWertRegExp:Statistiktyp:Zeitraum>
• Statistiktyp: Min|Avg|Max|Delta|DurationState|Tendency
• Zeitraum: Hour|Day|Month|Year|1h|2h|3h|6h
Regulärer Ausdruck statistischer Werte, die zusätzlich auch als einzelne Werte gespeichert werden sollen. Erleichtert die Erzeugung von Plots und anderer Auswertungen (notify).
Für "duration"-Gerätewerte muss der Name des jeweiligen Statuswertes als Statistiktypeingesetzt werden.
heißt das dann...
Zitatattr Statistik3 singularReadings TestLampe:myStatus:DurationMyStatus:(Hour|Day|Month|Year)
Ok, es scheint ja zu funktionieren.
Allerdings vermisse ich Hour.
Zitatoff 00:00:00 off: 00:04:25 off_Count 00:00:01 off_Count: 6 on: 00:26:22 on_Count: 6
Warum steht off - off 00:00:00 off: 00:04:25 - einmal ohne Zeit und einmal mit Zeit in den Readings?
Warum steht off_Count - off_Count 00:00:01 off_Count: 6 - mit Zeit und als Zahl ind den Readings?
Danke für jeden Tipp.
Grüße
Knut
Scheint wohl auch damit zu tun zu haben welcher Status zuerst vorlag, denn nach einem Reset taucht nun on/on_Count 2x auf.
Zitatoff: 00:08:22 off_Count: 2 on 00:00:00 on: 00:03:27 on_Count 00:00:01 on_Count: 1 (since: 2015-12-27_15:36:25)
Grüße