Hallo FHEM Team,
habe kürzlich das statistics Modul in Betrieb genommen und logge damit u.a. Heizung und Energiezähler. Ziel ist es stündlich, täglich und monatlich Werte zu erfassen. Das funktionierte mit der Grundeinstellung auch wunderbar und es gab immer zum Zeitpunkt xx:59:55 neue Werte. Allerdings werden da die Werte immer alle hintereinander geschrieben udn ich bekomme keine SVG Plots gezeichnet. Daher habe ich auch singularreadings genutzt und in einem zweiten statistics Modul noch eine Delta Berechnung.
Das statistics Modul schreibt mir nun aber das Log intensiv voll, binnen ein paar Stunden/Tagen schon MByte weise an Logs. Das ist nicht in meinem Sinne, mir reicht es völlig aus, wenn es zum Zeitpunkt xx:59:55 neue Werte gibt. Ja, damit ist das aktuelle Delta nicht aussagefähig, aber das ist mir egal.
Habe bereits ein
event-min-interval .*:1800
in den beiden statistics Modulen (eins für Min/Avg/Max und das zweite für Delta) gesetzt. Aber ohne Erfolg. Daher habe ich die singularreadings schon wieder entfernt, das bringt so nichts... Anbei mal ein Beispiel aus dem Log:
[...]
das hier ist gewollt (wobei es mit Einzelwerten/singularreadings noch schöner wäre)
[...]
2023-11-19_06:59:55 MQTT2_Gaszaehler statistics_ZaehlerstandHourLast: Min: 2274.433 Avg: 2274.502 Max: 2274.599
2023-11-19_06:59:55 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalHourLast: Min: 276.762 Avg: 276.786 Max: 276.813
2023-11-19_06:59:55 MQTT2_Stromzaehler statistics_ZaehlerstandHourLast: Min: 28885.3 Avg: 28885.5 Max: 28885.6
[...]
das hier nicht und müllt alles voll...
[...]
2023-11-19_10:11:26 MQTT2_Stromzaehler statisticsDelta_Zaehlerstand: Hour: 28885.9 Day: 28885.9 Month: 28885.9 Year: 28885.9 (since: )
2023-11-19_10:11:26 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandHour: 28885.9
2023-11-19_10:11:26 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandDay: 28885.9
2023-11-19_10:11:26 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandMonth: 28885.9
2023-11-19_10:12:05 MQTT2_Stromzaehler statistics_ZaehlerstandHourMax: 28886.6
2023-11-19_10:12:05 MQTT2_Stromzaehler statisticsDelta_Zaehlerstand: Hour: 28886.0 Day: 28886.0 Month: 28886.0 Year: 28886.0 (since: )
2023-11-19_10:12:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandHour: 28886.0
2023-11-19_10:12:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandDay: 28886.0
2023-11-19_10:12:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandMonth: 28886.0
[...]
Sobald ich Delta und/oder singularreadings nutze, wird das Log zugemüllt. Kann man das irgendwie alles auf eine stündliche Aktualisierung zum Zeitpunkt xx:59:55 eingrenzen?
Habe die Frage schon einmal gefunden, aber auch ohne Antwort...
https://forum.fhem.de/index.php?topic=41697.msg339590#msg339590
Zitat von: Betonklotz am 19 November 2023, 10:21:50Ziel ist es stündlich, täglich und monatlich Werte zu erfassen. Das funktionierte mit der Grundeinstellung auch wunderbar und es gab immer zum Zeitpunkt xx:59:55 neue Werte. Allerdings werden da die Werte immer alle hintereinander geschrieben udn ich bekomme keine SVG Plots gezeichnet.
userReadings -> split
(evtl. auch logProxy https://wiki.fhem.de/wiki/LogProxy)
Zitat von: Betonklotz am 19 November 2023, 10:21:50in den beiden statistics Modulen (eins für Min/Avg/Max und das zweite für Delta) gesetzt. Aber ohne Erfolg. Daher habe ich die singularreadings schon wieder entfernt, das bringt so nichts... Anbei mal ein Beispiel aus dem Log:
Warum beim statistics Device (nicht Modul) und nicht bei dem Device/den Devices wo dann die statistics Readings "ankommen" -> da kommen die Events, da dann einschränken...
Hilfreich wäre gewesen:
list eines der "Original-Devices"
list des statistics Devices
list FileLog/DBLog (wobei bei DB bin ich raus)
Gruß, Joachim
Zitat von: MadMax-FHEM am 19 November 2023, 10:44:51list eines der "Original-Devices"
list des statistics Devices
list FileLog
Daran soll es nicht scheitern. Hatte gehofft, dass dies ein "bekanntes" Problem ist und nur eine Kleinigkeit/Eisntellung ist die ich nicht finde. Anbei die Infos:
Erst einmal einer der Zähler (hier ein Shelly zur Energiemessung des Serverracks), die anderen sind ähnlich, tw. aber auch mit OCR via AI on the edge für einen alten Ferraris Zähler:
define MQTT2_StromServerrack MQTT2_DEVICE StromServerrack
attr MQTT2_StromServerrack autocreate 0
attr MQTT2_StromServerrack devicetopic StromServerrack
attr MQTT2_StromServerrack event-on-change-reading .*
attr MQTT2_StromServerrack icon message_socket
attr MQTT2_StromServerrack readingList StromServerrack/STATE:.* { json2nameValue($EVENT,'STATE_',$JSONMAP) }\
StromServerrack/SENSOR:.* { json2nameValue($EVENT,'SENSOR_',$JSONMAP) }\
StromServerrack/LWT:.* LWT\
StromServerrack/INFO2:.* { json2nameValue($EVENT,'INFO_',$JSONMAP) }
attr MQTT2_StromServerrack room MQTT2_DEVICE
attr MQTT2_StromServerrack setList on StromServerrack/cmnd/Power ON\
off StromServerrack/cmnd/Power OFF
attr MQTT2_StromServerrack setStateList on off
attr MQTT2_StromServerrack stateFormat {\
my $text = ' uptime: '.ReadingsVal($name,"STATE_Uptime","unbekannt").\
sprintf(" ; ; ; ; ;Verbräuche: aktuell: %.1fW;; Tag: %.2fkWh;; Gestern: %.3fkWh;; Gesamt: %.4fkWh", ReadingsNum($name,"SENSOR_ENERGY_Power","-1"), ReadingsNum($name,"SENSOR_ENERGY_Today","-1"), ReadingsNum($name,"SENSOR_ENERGY_Yesterday","-1"), ReadingsNum($name,"SENSOR_ENERGY_Total","-1"));;;;\
my $onl = ReadingsVal($name,"LWT","unbekannt") eq "Online"?"10px-kreis-gruen":"10px-kreis-rot";;;;\
my $light = ReadingsVal($name,"STATE_POWER","OFF");;;;\
"<div><a href=\"http://".ReadingsVal($name,"Host",ReadingsVal($name,"INFO_Info2_Hostname","none")).".ioti \"target=\"_blank\">".FW_makeImage($onl).FW_makeImage($light)."$text<b></b>"\
}
# CID StromServerrack
# DEF StromServerrack
# FUUID 6465ed9c-f33f-a38a-af32-8fce7ec97a506b3e
# IODev MQTT2_FHEM_Server
# LASTInputDev MQTT2_FHEM_Server
# MQTT2_FHEM_Server_CONN MQTT2_FHEM_Server_192.168.130.7_61380
# MQTT2_FHEM_Server_MSGCNT 379
# MQTT2_FHEM_Server_TIME 2023-11-19 11:14:14
# MSGCNT 379
# NAME MQTT2_StromServerrack
# NR 196
# STATE <div><a href="http://strom.ioti "target="_blank"><img class=' 10px-kreis-gruen' src="/fhem/images/default/10px-kreis-gruen.png" alt="10px-kreis-gruen" title="10px-kreis-gruen"><svg class=" ON" data-txt="ON" version="1.0" xmlns="http://www.w3.org/2000/svg" width="468pt" height="537pt" viewBox="0 0 468 537" preserveAspectRatio="xMidYMid meet"> <metadata> Created by potrace 1.8, written by Peter Selinger 2001-2007 </metadata> <g transform="translate(0,537) scale(0.181395,-0.181395)" stroke="none"> <path d="M957 2932 c-14 -16 -17 -43 -17 -174 0 -135 2 -157 18 -171 28 -25 72 -26 96 -1 13 13 16 43 16 173 0 140 -2 160 -18 174 -25 22 -75 21 -95 -1z"/> <path d="M1506 2928 c-13 -18 -16 -53 -16 -174 0 -138 2 -152 20 -169 24 -22 77 -22 99 0 13 12 17 44 19 151 4 147 1 174 -24 198 -24 24 -80 20 -98 -6z"/> <path d="M278 2834 c-29 -15 -44 -50 -34 -81 3 -11 73 -85 154 -166 127 -126 153 -147 180 -147 34 0 72 38 72 73 0 34 -312 341 -342 337 -2 -1 -15 -7 -30 -16z"/> <path d="M2235 2840 c-34 -14 -315 -305 -315 -327 0 -35 38 -73 72 -73 27 0 53 21 180 148 82 81 151 157 155 170 12 51 -44 100 -92 82z"/> <path d="M1039 2257 c-70 -20 -136 -63 -174 -115 -65 -87 -65 -91 -65 -643 0 -479 1 -500 21 -553 25 -67 87 -134 160 -173 l54 -28 250 0 c235 0 253 1 296 21 63 29 125 94 158 163 l26 56 0 520 0 520 -28 56 c-32 66 -99 132 -165 162 -43 20 -65 22 -267 24 -153 2 -234 -2 -266 -10z m486 -146 c48 -22 69 -44 90 -94 13 -31 15 -107 15 -517 0 -526 0 -523 -59 -573 -48 -40 -90 -47 -299 -47 -205 0 -226 4 -280 54 -51 46 -50 40 -53 567 l-3 495 23 40 c24 43 64 72 115 85 17 4 117 7 221 8 164 0 195 -2 230 -18z"/> <path d="M2110 2123 c-49 -19 -64 -68 -34 -111 15 -22 19 -22 238 -22 211 0 224 1 241 20 23 25 24 76 1 98 -14 15 -44 17 -224 19 -114 1 -214 -1 -222 -4z"/> <path d="M16 2098 c-22 -31 -20 -71 5 -94 19 -17 39 -19 240 -19 236 0 241 1 254 55 4 18 0 34 -15 53 l-21 27 -224 0 c-220 0 -224 0 -239 -22z"/> <path d="M26 1559 c-32 -25 -35 -70 -6 -99 19 -19 33 -20 238 -20 207 0 220 1 237 20 26 29 24 79 -4 102 -21 16 -44 18 -231 18 -195 0 -209 -1 -234 -21z"/> <path d="M2080 1560 c-23 -23 -26 -68 -6 -96 13 -18 30 -19 233 -22 203 -3 221 -2 243 16 32 26 32 78 1 104 -21 16 -44 18 -237 18 -201 0 -215 -1 -234 -20z"/> <path d="M20 1010 c-29 -29 -26 -74 7 -100 26 -20 36 -21 240 -18 184 3 215 5 229 20 23 22 22 73 -1 98 -17 19 -30 20 -237 20 -205 0 -219 -1 -238 -20z"/> <path d="M2077 1012 c-22 -25 -21 -75 1 -95 16 -15 48 -17 238 -17 120 0 224 4 231 8 32 20 32 94 0 114 -7 4 -111 8 -233 8 -201 0 -222 -2 -237 -18z"/> <path d="M998 693 c-36 -41 -30 -95 11 -108 60 -19 520 -91 539 -84 53 20 66 99 19 119 -28 12 -482 90 -524 90 -16 0 -37 -8 -45 -17z"/> <path d="M1023 530 c-41 -17 -58 -85 -28 -110 15 -12 492 -100 543 -100 33 0 62 34 62 74 0 18 -6 38 -13 44 -6 6 -120 29 -252 51 -132 23 -251 43 -265 46 -14 2 -35 0 -47 -5z"/> <path d="M1023 360 c-46 -18 -59 -90 -20 -114 21 -13 478 -96 531 -96 14 0 35 9 46 20 26 26 27 85 2 99 -10 5 -126 28 -258 51 -131 22 -248 42 -259 44 -11 2 -30 0 -42 -4z"/> <path d="M1101 154 c-26 -33 -27 -55 -3 -82 13 -16 51 -26 176 -47 158 -27 159 -27 185 -7 31 22 41 81 18 101 -16 13 -271 61 -323 61 -23 0 -39 -8 -53 -26z"/> </g> </svg> uptime: 115T20:16:19 Verbräuche: aktuell: 50.0W; Tag: 0.57kWh; Gestern: 1.230kWh; Gesamt: 277.0290kWh<b></b>
# TYPE MQTT2_DEVICE
# eventCount 396
# READINGS:
# 2023-07-26 16:00:25 INFO_Info2_Hostname strom
# 2023-07-26 16:00:25 INFO_Info2_IPAddress 192.168.130.7
# 2023-07-26 16:00:25 INFO_Info2_WebServerMode Admin
# 2023-11-18 19:30:44 IODev MQTT2_FHEM_Server
# 2023-11-18 19:30:44 LWT Online
# 2023-11-19 11:14:14 SENSOR_ANALOG_Temperature1 43.2
# 2023-11-19 11:14:14 SENSOR_ENERGY_ApparentPower 57
# 2023-11-19 11:14:14 SENSOR_ENERGY_Current 0.222
# 2023-11-19 11:14:14 SENSOR_ENERGY_Factor 0.88
# 2023-11-19 11:14:14 SENSOR_ENERGY_Frequency 50
# 2023-11-19 11:14:14 SENSOR_ENERGY_Period 4
# 2023-11-19 11:14:14 SENSOR_ENERGY_Power 50
# 2023-11-19 11:14:14 SENSOR_ENERGY_ReactivePower 5
# 2023-11-19 11:14:14 SENSOR_ENERGY_Today 0.572
# 2023-11-19 11:14:14 SENSOR_ENERGY_Total 277.029
# 2023-11-19 11:14:14 SENSOR_ENERGY_TotalStartTime 2023-04-01T19:17:55
# 2023-11-19 11:14:14 SENSOR_ENERGY_Voltage 234
# 2023-11-19 11:14:14 SENSOR_ENERGY_Yesterday 1.230
# 2023-11-19 11:14:14 SENSOR_Switch1 OFF
# 2023-11-19 11:14:14 SENSOR_TempUnit C
# 2023-11-19 11:14:14 SENSOR_Time 2023-11-19T11:14:13
# 2023-11-19 11:14:14 STATE_Berry_HeapUsed 3
# 2023-11-19 11:14:14 STATE_Berry_Objects 43
# 2023-11-19 11:14:14 STATE_Heap 134
# 2023-11-19 11:14:14 STATE_LoadAvg 19
# 2023-11-19 11:14:14 STATE_MqttCount 53
# 2023-11-19 11:14:14 STATE_POWER ON
# 2023-11-19 11:14:14 STATE_Sleep 50
# 2023-11-19 11:14:14 STATE_SleepMode Dynamic
# 2023-11-19 11:14:14 STATE_Time 2023-11-19T11:14:13
# 2023-11-19 11:14:14 STATE_Uptime 115T20:16:19
# 2023-11-19 11:14:14 STATE_UptimeSec 10008979
# 2023-11-19 11:14:14 STATE_Wifi_AP 1
# 2023-11-19 11:14:14 STATE_Wifi_BSSId 80:BC:37:69:56:92
# 2023-11-19 11:14:14 STATE_Wifi_Channel 11
# 2023-11-19 11:14:14 STATE_Wifi_Downtime 0T00:30:30
# 2023-11-19 11:14:14 STATE_Wifi_LinkCount 38
# 2023-11-19 11:14:14 STATE_Wifi_Mode 11n
# 2023-11-19 11:14:14 STATE_Wifi_RSSI 56
# 2023-11-19 11:14:14 STATE_Wifi_SSId xyz
# 2023-11-19 11:14:14 STATE_Wifi_Signal -72
# 2023-07-24 13:10:48 state set_on
# 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_Total Hour: 0.013 Day: 0.763 Month: 0.763 Year: 0.763 (since: )
# 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalDay 0.763
# 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalHour 0.013
# 2023-11-19 10:59:55 statisticsDelta_SENSOR_ENERGY_TotalHourLast 0.750
# 2023-11-19 10:59:55 statisticsDelta_SENSOR_ENERGY_TotalLast Hour: 0.750 Day: - Month: - Year: - (since: )
# 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalMonth 0.763
# 2023-11-18 20:19:15 statistics_SENSOR_ENERGY_Total Hour: 0.017 Day: 1.040 Month: 1.040 Year: 1.040 (since: 2023-11-18 )
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalDay Min: 276.456 Avg: 276.741 Max: 277.029
# 2023-11-18 23:59:55 statistics_SENSOR_ENERGY_TotalDayLast Min: 0.000 Avg: 275.837 Max: 276.456
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalDayMax 277.029
# 2023-11-18 23:59:55 statistics_SENSOR_ENERGY_TotalDayMaxLast 276.456
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalHour Min: 277.016 Avg: 277.021 Max: 277.029
# 2023-11-19 10:59:55 statistics_SENSOR_ENERGY_TotalHourLast Min: 276.965 Avg: 276.989 Max: 277.016
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalHourMax 277.029
# 2023-11-19 10:59:55 statistics_SENSOR_ENERGY_TotalHourMaxLast 277.016
# 2023-11-18 19:59:55 statistics_SENSOR_ENERGY_TotalLast Hour: 0.052 Day: 0.228 Month: - Year: - (since: 2023-11-17_19:33:53 )
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalMonth Min: 0.000 Avg: 272.967 Max: 277.029 (since: )
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalMonthMax 277.029
# 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalYear Min: 268.906 Avg: 272.967 Max: 277.029 (since: 2023-11-12_20:34:19 )
# 2023-11-17 19:30:15 statistics_StateDay on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
# 2023-11-17 19:30:15 statistics_StateMonth on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
# 2023-11-17 19:30:15 statistics_StateYear on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
# 2023-11-18 19:31:44 subscriptions StromServerrack/cmnd/# cmnd/StromServerrack_fb/# tasmotas/cmnd/#
# helper:
# _98_statistics myStatDeviceDelta
#
setstate MQTT2_StromServerrack <div><a href="http://strom.ioti "target="_blank"><img class=' 10px-kreis-gruen' src="/fhem/images/default/10px-kreis-gruen.png" alt="10px-kreis-gruen" title="10px-kreis-gruen"><svg class=" ON" data-txt="ON" version="1.0" xmlns="http://www.w3.org/2000/svg" width="468pt" height="537pt" viewBox="0 0 468 537" preserveAspectRatio="xMidYMid meet"> <metadata> Created by potrace 1.8, written by Peter Selinger 2001-2007 </metadata> <g transform="translate(0,537) scale(0.181395,-0.181395)" stroke="none"> <path d="M957 2932 c-14 -16 -17 -43 -17 -174 0 -135 2 -157 18 -171 28 -25 72 -26 96 -1 13 13 16 43 16 173 0 140 -2 160 -18 174 -25 22 -75 21 -95 -1z"/> <path d="M1506 2928 c-13 -18 -16 -53 -16 -174 0 -138 2 -152 20 -169 24 -22 77 -22 99 0 13 12 17 44 19 151 4 147 1 174 -24 198 -24 24 -80 20 -98 -6z"/> <path d="M278 2834 c-29 -15 -44 -50 -34 -81 3 -11 73 -85 154 -166 127 -126 153 -147 180 -147 34 0 72 38 72 73 0 34 -312 341 -342 337 -2 -1 -15 -7 -30 -16z"/> <path d="M2235 2840 c-34 -14 -315 -305 -315 -327 0 -35 38 -73 72 -73 27 0 53 21 180 148 82 81 151 157 155 170 12 51 -44 100 -92 82z"/> <path d="M1039 2257 c-70 -20 -136 -63 -174 -115 -65 -87 -65 -91 -65 -643 0 -479 1 -500 21 -553 25 -67 87 -134 160 -173 l54 -28 250 0 c235 0 253 1 296 21 63 29 125 94 158 163 l26 56 0 520 0 520 -28 56 c-32 66 -99 132 -165 162 -43 20 -65 22 -267 24 -153 2 -234 -2 -266 -10z m486 -146 c48 -22 69 -44 90 -94 13 -31 15 -107 15 -517 0 -526 0 -523 -59 -573 -48 -40 -90 -47 -299 -47 -205 0 -226 4 -280 54 -51 46 -50 40 -53 567 l-3 495 23 40 c24 43 64 72 115 85 17 4 117 7 221 8 164 0 195 -2 230 -18z"/> <path d="M2110 2123 c-49 -19 -64 -68 -34 -111 15 -22 19 -22 238 -22 211 0 224 1 241 20 23 25 24 76 1 98 -14 15 -44 17 -224 19 -114 1 -214 -1 -222 -4z"/> <path d="M16 2098 c-22 -31 -20 -71 5 -94 19 -17 39 -19 240 -19 236 0 241 1 254 55 4 18 0 34 -15 53 l-21 27 -224 0 c-220 0 -224 0 -239 -22z"/> <path d="M26 1559 c-32 -25 -35 -70 -6 -99 19 -19 33 -20 238 -20 207 0 220 1 237 20 26 29 24 79 -4 102 -21 16 -44 18 -231 18 -195 0 -209 -1 -234 -21z"/> <path d="M2080 1560 c-23 -23 -26 -68 -6 -96 13 -18 30 -19 233 -22 203 -3 221 -2 243 16 32 26 32 78 1 104 -21 16 -44 18 -237 18 -201 0 -215 -1 -234 -20z"/> <path d="M20 1010 c-29 -29 -26 -74 7 -100 26 -20 36 -21 240 -18 184 3 215 5 229 20 23 22 22 73 -1 98 -17 19 -30 20 -237 20 -205 0 -219 -1 -238 -20z"/> <path d="M2077 1012 c-22 -25 -21 -75 1 -95 16 -15 48 -17 238 -17 120 0 224 4 231 8 32 20 32 94 0 114 -7 4 -111 8 -233 8 -201 0 -222 -2 -237 -18z"/> <path d="M998 693 c-36 -41 -30 -95 11 -108 60 -19 520 -91 539 -84 53 20 66 99 19 119 -28 12 -482 90 -524 90 -16 0 -37 -8 -45 -17z"/> <path d="M1023 530 c-41 -17 -58 -85 -28 -110 15 -12 492 -100 543 -100 33 0 62 34 62 74 0 18 -6 38 -13 44 -6 6 -120 29 -252 51 -132 23 -251 43 -265 46 -14 2 -35 0 -47 -5z"/> <path d="M1023 360 c-46 -18 -59 -90 -20 -114 21 -13 478 -96 531 -96 14 0 35 9 46 20 26 26 27 85 2 99 -10 5 -126 28 -258 51 -131 22 -248 42 -259 44 -11 2 -30 0 -42 -4z"/> <path d="M1101 154 c-26 -33 -27 -55 -3 -82 13 -16 51 -26 176 -47 158 -27 159 -27 185 -7 31 22 41 81 18 101 -16 13 -271 61 -323 61 -23 0 -39 -8 -53 -26z"/> </g> </svg> uptime: 115T20:16:19 ; ; ; ; ;Verbräuche: aktuell: 50.0W;; Tag: 0.57kWh;; Gestern: 1.230kWh;; Gesamt: 277.0290kWh<b></b>
setstate MQTT2_StromServerrack 2023-07-26 16:00:25 INFO_Info2_Hostname strom
setstate MQTT2_StromServerrack 2023-07-26 16:00:25 INFO_Info2_IPAddress 192.168.130.7
setstate MQTT2_StromServerrack 2023-07-26 16:00:25 INFO_Info2_WebServerMode Admin
setstate MQTT2_StromServerrack 2023-11-18 19:30:44 IODev MQTT2_FHEM_Server
setstate MQTT2_StromServerrack 2023-11-18 19:30:44 LWT Online
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ANALOG_Temperature1 43.2
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_ApparentPower 57
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Current 0.222
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Factor 0.88
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Frequency 50
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Period 4
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Power 50
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_ReactivePower 5
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Today 0.572
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Total 277.029
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_TotalStartTime 2023-04-01T19:17:55
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Voltage 234
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_ENERGY_Yesterday 1.230
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_Switch1 OFF
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_TempUnit C
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 SENSOR_Time 2023-11-19T11:14:13
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Berry_HeapUsed 3
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Berry_Objects 43
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Heap 134
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_LoadAvg 19
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_MqttCount 53
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_POWER ON
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Sleep 50
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_SleepMode Dynamic
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Time 2023-11-19T11:14:13
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Uptime 115T20:16:19
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_UptimeSec 10008979
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_AP 1
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_BSSId 80:BC:37:69:56:92
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_Channel 11
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_Downtime 0T00:30:30
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_LinkCount 38
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_Mode 11n
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_RSSI 56
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_SSId xyz
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 STATE_Wifi_Signal -72
setstate MQTT2_StromServerrack 2023-07-24 13:10:48 state set_on
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_Total Hour: 0.013 Day: 0.763 Month: 0.763 Year: 0.763 (since: )
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalDay 0.763
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalHour 0.013
setstate MQTT2_StromServerrack 2023-11-19 10:59:55 statisticsDelta_SENSOR_ENERGY_TotalHourLast 0.750
setstate MQTT2_StromServerrack 2023-11-19 10:59:55 statisticsDelta_SENSOR_ENERGY_TotalLast Hour: 0.750 Day: - Month: - Year: - (since: )
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statisticsDelta_SENSOR_ENERGY_TotalMonth 0.763
setstate MQTT2_StromServerrack 2023-11-18 20:19:15 statistics_SENSOR_ENERGY_Total Hour: 0.017 Day: 1.040 Month: 1.040 Year: 1.040 (since: 2023-11-18 )
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalDay Min: 276.456 Avg: 276.741 Max: 277.029
setstate MQTT2_StromServerrack 2023-11-18 23:59:55 statistics_SENSOR_ENERGY_TotalDayLast Min: 0.000 Avg: 275.837 Max: 276.456
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalDayMax 277.029
setstate MQTT2_StromServerrack 2023-11-18 23:59:55 statistics_SENSOR_ENERGY_TotalDayMaxLast 276.456
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalHour Min: 277.016 Avg: 277.021 Max: 277.029
setstate MQTT2_StromServerrack 2023-11-19 10:59:55 statistics_SENSOR_ENERGY_TotalHourLast Min: 276.965 Avg: 276.989 Max: 277.016
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalHourMax 277.029
setstate MQTT2_StromServerrack 2023-11-19 10:59:55 statistics_SENSOR_ENERGY_TotalHourMaxLast 277.016
setstate MQTT2_StromServerrack 2023-11-18 19:59:55 statistics_SENSOR_ENERGY_TotalLast Hour: 0.052 Day: 0.228 Month: - Year: - (since: 2023-11-17_19:33:53 )
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalMonth Min: 0.000 Avg: 272.967 Max: 277.029 (since: )
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalMonthMax 277.029
setstate MQTT2_StromServerrack 2023-11-19 11:14:14 statistics_SENSOR_ENERGY_TotalYear Min: 268.906 Avg: 272.967 Max: 277.029 (since: 2023-11-12_20:34:19 )
setstate MQTT2_StromServerrack 2023-11-17 19:30:15 statistics_StateDay on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
setstate MQTT2_StromServerrack 2023-11-17 19:30:15 statistics_StateMonth on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
setstate MQTT2_StromServerrack 2023-11-17 19:30:15 statistics_StateYear on: 00:00:00 on_Count: 1 (since: 2023-11-17_19:30:15)
setstate MQTT2_StromServerrack 2023-11-18 19:31:44 subscriptions StromServerrack/cmnd/# cmnd/StromServerrack_fb/# tasmotas/cmnd/#
Die beiden statistics device, das erste für min/avg/max (ich habe es nicht geschafft, dass "Delta" auch mit läft, daher für Delta ein zweites Device)
define myStatDevice statistics MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack statistics_
attr myStatDevice ignoreDefaultAssignments 1
attr myStatDevice minAvgMaxReadings Zaehlerstand,SENSOR_ENERGY_Total
attr myStatDevice room System->System
attr myStatDevice singularReadings MQTT2_Gaszaehler:Zaehlerstand:Max:(Hour|Day|Month)|\
MQTT2_Stromzaehler:Zaehlerstand:Max:(Hour|Day|Month)|\
MQTT2_StromServerrack:SENSOR_ENERGY_Total:Max:(Hour|Day|Month)
# DEF MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack statistics_
# DEV_REGEXP MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack
# FUUID 65511212-f33f-a38a-4a13-f0cf5cdfbf1fc7b4
# NAME myStatDevice
# NOTIFYDEV global,MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack
# NR 229
# NTFY_ORDER 10-myStatDevice
# PREFIX statistics_
# STATE Updated stats for: MQTT2_Gaszaehler
# TYPE statistics
# eventCount 4856
# READINGS:
# 2023-11-18 19:30:55 monitoredDevicesMQTT2_DEVICE MQTT2_Gaszaehler,MQTT2_StromServerrack,MQTT2_Stromzaehler
# 2023-11-19 10:59:55 nextPeriodChangeCalc 2023-11-19 11:59:55
# 2023-11-19 11:23:51 state Updated stats for: MQTT2_Gaszaehler
# fhem:
# modulVersion $Date: 2023-10-22 16:27:28 +0200 (Sun, 22 Oct 2023) $
# nextPeriodChangeTime 1700391595
#
setstate myStatDevice Updated stats for: MQTT2_Gaszaehler
setstate myStatDevice 2023-11-17 19:29:05 .MQTT2_Gaszaehler:Zaehlerstand LastValue: 2271.115 ShowDate: 7 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:23:51 .MQTT2_Gaszaehler:ZaehlerstandDay Sum: 93347783.87 Time: 41036 LastValue: 2275.577 LastTime: 1700389431 ShowDate: 0 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:23:51 .MQTT2_Gaszaehler:ZaehlerstandHour Sum: 3267707.27 Time: 1436 LastValue: 2275.577 LastTime: 1700389431 ShowDate: 0 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:23:51 .MQTT2_Gaszaehler:ZaehlerstandMonth Sum: 1301255729.504 Time: 574354 LastValue: 2275.577 LastTime: 1700389431 ShowDate: 1 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:23:51 .MQTT2_Gaszaehler:ZaehlerstandYear Sum: 1301255729.504 Time: 574354 LastValue: 2275.577 LastTime: 1700389431 ShowDate: 1 DecPlaces: 3
setstate myStatDevice 2023-11-17 19:29:16 .MQTT2_StromServerrack:SENSOR_ENERGY_Total LastValue: 274.998 ShowDate: 7 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:19:14 .MQTT2_StromServerrack:SENSOR_ENERGY_TotalDay Sum: 11279782.404 Time: 40759 LastValue: 277.033 LastTime: 1700389154 ShowDate: 0 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:19:14 .MQTT2_StromServerrack:SENSOR_ENERGY_TotalHour Sum: 321069.344 Time: 1159 LastValue: 277.033 LastTime: 1700389154 ShowDate: 0 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:19:14 .MQTT2_StromServerrack:SENSOR_ENERGY_TotalMonth Sum: 156000714.562 Time: 571495 LastValue: 277.033 LastTime: 1700389154 ShowDate: 1 DecPlaces: 3
setstate myStatDevice 2023-11-19 11:19:14 .MQTT2_StromServerrack:SENSOR_ENERGY_TotalYear Sum: 156000714.562 Time: 571495 LastValue: 277.033 LastTime: 1700389154 ShowDate: 1 DecPlaces: 3
setstate myStatDevice 2023-11-17 19:30:13 .MQTT2_Stromzaehler:Zaehlerstand LastValue: 28840 ShowDate: 7 DecPlaces: 1
setstate myStatDevice 2023-11-19 11:22:05 .MQTT2_Stromzaehler:ZaehlerstandDay Sum: 1182278687.4 Time: 40930 LastValue: 28887.1 LastTime: 1700389325 ShowDate: 0 DecPlaces: 1
setstate myStatDevice 2023-11-19 11:22:05 .MQTT2_Stromzaehler:ZaehlerstandHour Sum: 38419770 Time: 1330 LastValue: 28887.1 LastTime: 1700389325 ShowDate: 0 DecPlaces: 1
setstate myStatDevice 2023-11-19 11:22:05 .MQTT2_Stromzaehler:ZaehlerstandMonth Sum: 16269531509.6 Time: 574248 LastValue: 28887.1 LastTime: 1700389325 ShowDate: 1 DecPlaces: 1
setstate myStatDevice 2023-11-19 11:22:05 .MQTT2_Stromzaehler:ZaehlerstandYear Sum: 16269531509.6 Time: 574248 LastValue: 28887.1 LastTime: 1700389325 ShowDate: 1 DecPlaces: 1
setstate myStatDevice 2023-11-18 19:30:55 monitoredDevicesMQTT2_DEVICE MQTT2_Gaszaehler,MQTT2_StromServerrack,MQTT2_Stromzaehler
setstate myStatDevice 2023-11-19 10:59:55 nextPeriodChangeCalc 2023-11-19 11:59:55
setstate myStatDevice 2023-11-19 11:23:51 state Updated stats for: MQTT2_Gaszaehler
Und das Device für die Delta Berechnung:
define myStatDeviceDelta statistics MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack statisticsDelta_
attr myStatDeviceDelta deltaReadings Zaehlerstand,SENSOR_ENERGY_Total
attr myStatDeviceDelta ignoreDefaultAssignments 1
attr myStatDeviceDelta room System->System
attr myStatDeviceDelta singularReadings MQTT2_Gaszaehler:Zaehlerstand:Delta:(Hour|Day|Month)|\
MQTT2_Stromzaehler:Zaehlerstand:Delta:(Hour|Day|Month)|\
MQTT2_StromServerrack:SENSOR_ENERGY_Total:Delta:(Hour|Day|Month)
# DEF MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack statisticsDelta_
# DEV_REGEXP MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack
# FUUID 6557b0e7-f33f-a38a-9a15-7d2342cf85a50908
# NAME myStatDeviceDelta
# NOTIFYDEV global,MQTT2_Stromzaehler|MQTT2_Gaszaehler|MQTT2_StromServerrack
# NR 232
# NTFY_ORDER 10-myStatDeviceDelta
# PREFIX statisticsDelta_
# STATE Updated stats for: MQTT2_Stromzaehler
# TYPE statistics
# eventCount 264
# READINGS:
# 2023-11-18 19:30:55 monitoredDevicesMQTT2_DEVICE MQTT2_Gaszaehler,MQTT2_StromServerrack,MQTT2_Stromzaehler
# 2023-11-19 10:59:55 nextPeriodChangeCalc 2023-11-19 11:59:55
# 2023-11-19 11:26:35 state Updated stats for: MQTT2_Stromzaehler
# fhem:
# modulVersion $Date: 2023-10-22 16:27:28 +0200 (Sun, 22 Oct 2023) $
# nextPeriodChangeTime 1700391595
#
setstate myStatDeviceDelta Updated stats for: MQTT2_Stromzaehler
setstate myStatDeviceDelta 2023-11-19 11:23:57 .MQTT2_Gaszaehler:Zaehlerstand LastValue: 2275.593 ShowDate: 5 DecPlaces: 3
setstate myStatDeviceDelta 2023-11-19 11:24:14 .MQTT2_StromServerrack:SENSOR_ENERGY_Total LastValue: 277.037 ShowDate: 5 DecPlaces: 3
setstate myStatDeviceDelta 2023-11-17 19:30:15 .MQTT2_StromServerrack:stateDay lastState: on showDate: 1 on_Count: 1 (since: 2023-11-17_19:30:15) on: 0 lastTime: 1700245815
setstate myStatDeviceDelta 2023-11-17 19:30:15 .MQTT2_StromServerrack:stateMonth (since: 2023-11-17_19:30:15) lastState: on showDate: 1 on_Count: 1 lastTime: 1700245815 on: 0
setstate myStatDeviceDelta 2023-11-17 19:30:15 .MQTT2_StromServerrack:stateYear (since: 2023-11-17_19:30:15) lastState: on showDate: 1 on_Count: 1 lastTime: 1700245815 on: 0
setstate myStatDeviceDelta 2023-11-19 11:26:35 .MQTT2_Stromzaehler:Zaehlerstand LastValue: 28887.1 ShowDate: 5 DecPlaces: 1
setstate myStatDeviceDelta 2023-11-18 19:30:55 monitoredDevicesMQTT2_DEVICE MQTT2_Gaszaehler,MQTT2_StromServerrack,MQTT2_Stromzaehler
setstate myStatDeviceDelta 2023-11-19 10:59:55 nextPeriodChangeCalc 2023-11-19 11:59:55
setstate myStatDeviceDelta 2023-11-19 11:26:35 state Updated stats for: MQTT2_Stromzaehler
Und dann noch das Log:
define FileLog_Zaehlerstaende FileLog ./log/Zaehlerstaende-%Y-%m.log MQTT2_Gaszaehler:statistics_.*|MQTT2_Gaszaehler:statisticsDelta_.*|MQTT2_Stromzaehler:statistics_.*|MQTT2_Stromzaehler:statisticsDelta_.*|MQTT2_StromServerrack:statistics_.*|MQTT2_StromServerrack:statisticsDelta_.*
attr FileLog_Zaehlerstaende createGluedFile 1
attr FileLog_Zaehlerstaende logtype text
attr FileLog_Zaehlerstaende room Infos
# DEF ./log/Zaehlerstaende-%Y-%m.log MQTT2_Gaszaehler:statistics_.*|MQTT2_Gaszaehler:statisticsDelta_.*|MQTT2_Stromzaehler:statistics_.*|MQTT2_Stromzaehler:statisticsDelta_.*|MQTT2_StromServerrack:statistics_.*|MQTT2_StromServerrack:statisticsDelta_.*
# FD 55
# FUUID 6551209d-f33f-a38a-f593-134c7e7e88a8561c
# NAME FileLog_Zaehlerstaende
# NOTIFYDEV MQTT2_Stromzaehler,MQTT2_Gaszaehler,MQTT2_StromServerrack
# NR 231
# NTFY_ORDER 50-FileLog_Zaehlerstaende
# REGEXP MQTT2_Gaszaehler:statistics_.*|MQTT2_Gaszaehler:statisticsDelta_.*|MQTT2_Stromzaehler:statistics_.*|MQTT2_Stromzaehler:statisticsDelta_.*|MQTT2_StromServerrack:statistics_.*|MQTT2_StromServerrack:statisticsDelta_.*
# STATE active
# TYPE FileLog
# currentlogfile ./log/Zaehlerstaende-2023-11.log
# logfile ./log/Zaehlerstaende-%Y-%m.log
# READINGS:
# 2023-11-19 11:27:05 linesInTheFile 23798
#
setstate FileLog_Zaehlerstaende active
setstate FileLog_Zaehlerstaende 2023-11-19 11:27:05 linesInTheFile 23798
Und noch mal ein Beispiellogauszug/Inhalt
2023-11-19_11:19:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalHourMax: 277.033
2023-11-19_11:19:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalDayMax: 277.033
2023-11-19_11:19:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalMonthMax: 277.033
2023-11-19_11:19:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_Total: Hour: 0.017 Day: 0.767 Month: 0.767 Year: 0.767 (since: )
2023-11-19_11:19:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalHour: 0.017
2023-11-19_11:19:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalDay: 0.767
2023-11-19_11:19:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalMonth: 0.767
2023-11-19_11:23:57 MQTT2_Gaszaehler statistics_ZaehlerstandHourMax: 2275.593
2023-11-19_11:23:57 MQTT2_Gaszaehler statistics_ZaehlerstandDayMax: 2275.593
2023-11-19_11:23:57 MQTT2_Gaszaehler statistics_ZaehlerstandMonthMax: 2275.593
2023-11-19_11:23:57 MQTT2_Gaszaehler statisticsDelta_Zaehlerstand: Hour: 0.047 Day: 1.317 Month: 1.317 Year: 1.317 (since: )
2023-11-19_11:23:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandHour: 0.047
2023-11-19_11:23:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandDay: 1.317
2023-11-19_11:23:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandMonth: 1.317
2023-11-19_11:24:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalHourMax: 277.037
2023-11-19_11:24:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalDayMax: 277.037
2023-11-19_11:24:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalMonthMax: 277.037
2023-11-19_11:24:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_Total: Hour: 0.021 Day: 0.771 Month: 0.771 Year: 0.771 (since: )
2023-11-19_11:24:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalHour: 0.021
2023-11-19_11:24:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalDay: 0.771
2023-11-19_11:24:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalMonth: 0.771
2023-11-19_11:27:05 MQTT2_Stromzaehler statistics_ZaehlerstandHourMax: 28887.2
2023-11-19_11:27:05 MQTT2_Stromzaehler statisticsDelta_Zaehlerstand: Hour: 0.2 Day: 28886.7 Month: 28886.7 Year: 28886.7 (since: )
2023-11-19_11:27:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandHour: 0.2
2023-11-19_11:27:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandDay: 28886.7
2023-11-19_11:27:05 MQTT2_Stromzaehler statisticsDelta_ZaehlerstandMonth: 28886.7
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandHourMax: 2275.607
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandDayMax: 2275.607
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandMonthMax: 2275.607
2023-11-19_11:28:57 MQTT2_Gaszaehler statisticsDelta_Zaehlerstand: Hour: 0.061 Day: 1.331 Month: 1.331 Year: 1.331 (since: )
2023-11-19_11:28:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandHour: 0.061
2023-11-19_11:28:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandDay: 1.331
2023-11-19_11:28:57 MQTT2_Gaszaehler statisticsDelta_ZaehlerstandMonth: 1.331
2023-11-19_11:29:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalHourMax: 277.042
2023-11-19_11:29:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalDayMax: 277.042
2023-11-19_11:29:14 MQTT2_StromServerrack statistics_SENSOR_ENERGY_TotalMonthMax: 277.042
2023-11-19_11:29:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_Total: Hour: 0.026 Day: 0.776 Month: 0.776 Year: 0.776 (since: )
2023-11-19_11:29:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalHour: 0.026
2023-11-19_11:29:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalDay: 0.776
2023-11-19_11:29:14 MQTT2_StromServerrack statisticsDelta_SENSOR_ENERGY_TotalMonth: 0.776
Zitat von: Betonklotz am 19 November 2023, 11:28:54Daran soll es nicht scheitern. Hatte gehofft, dass dies ein "bekanntes" Problem ist und nur eine Kleinigkeit/Eisntellung ist die ich nicht finde. Anbei die Infos:
Es ist ja kein Problem, evtl. "falsche" Anwendung?
Ich sehe die erwähnten event-min-... nicht?
Hast du nun schon mal versucht das bei dem Device zu setzen, wo auch die Readings sind?
Also z.B. in deinem MQTT2_StromServerrack Device?
Ansonsten eben wieder wie du es zuvor hattest und dann eben mittels userReadings die Werte aus dem einen Reading auseinanderdröseln: split
Gruß, Joachim
Ohne das hier im Detail gelesen zu haben.
Sinnvoll ist immer nur die *Last zu loggen.
Die werden einmal stündlich / monatlich / jährlich erzeugt.
Die laufenden Statistics-Readings im Prinzip bei jedem Update des zugrunde liegenden Readings. Das ist dann ggfs. viel. ;)
Gruß Ralf
Es wäre jetzt zu überlegen, wie sinnvoll es ist, das statistics bei Speichern der singularreadings ein Event erzeugt.
Die min/avg/max readings werden zwar bei jedem Update des readings aktualisiert, es wird aber kein Event erzeugt. Nur das "last" erzeugt dann einmal pro periode ein Event.
Das ist nicht konsistent mit Delta, welches bei jedem Update ein Event erzeugt.
Ich denke man sollte
1. Bei Delta auch nur für das "Last" ein Event erzeugen
2. Bei den Singularreadings nur beim Periodenwechsel ein Event erzeugen.
Die Werte werden deswegen ja trotzdem aktualisiert, aber eben ohne Event.
Ich bin jetzt nur Aushilfsmaintainer für das Modul und verstehe es sicher nicht vollumfänglich, aber mir scheint die Änderung trivial. Ich hänge meinen Vorschlag einfach mal an.
Hmm, nur beim Periodenwechsel...
Ich "überwache" mittels average meinen Kühl-/Gefrierschrank...
Kurzzeitig mit average/h und langfristig mit average/d (denke ich)...
Nur bei Periodenwechsel wäre mir zu grob...
Oder verstehe ich da was falsch?
Gruß, Joachim
Hi Joachim,
mit der Änderung bekommst du für Avg/h immer nur zur vollen Stunde ein Event (eben wie bei ..Last)
Der Wert wird schon noch aktualisiert, d.h. man könnte ihn immer noch periodisch abfragen, aber das passt ja dann wohl nicht zu deinem Anwendungsfall, bei dem du wahrscheinlich dann einen Alarm auf einen Grenzwert hast.
Ich persönlich fände dafür das Statistics Modul allerdings zu überladen und würde das eher mit der eingebauten Avg Funktion von DOIF lösen.
Und schon haben wir zwei orthogonale Anwendungsfälle und lassen es besser wie es ist.
Für Betonklotz wäre da wohl die beste Lösung entweder die entsprechenden Events auf stündlich zu begrenzen
event-min-interval statDelta.*:3600
bzw. auf die "Last" readings zu gehen und alle anderen ruhig zu stellen
event-on-update-reading .*Last
Jörg
Zitat von: Adimarantis am 19 November 2023, 14:30:05Der Wert wird schon noch aktualisiert, d.h. man könnte ihn immer noch periodisch abfragen, aber das passt ja dann wohl nicht zu deinem Anwendungsfall, bei dem du wahrscheinlich dann einen Alarm auf einen Grenzwert hast.
Jep, so isses... 8)
Zitat von: Adimarantis am 19 November 2023, 14:30:05Ich persönlich fände dafür das Statistics Modul allerdings zu überladen und würde das eher mit der eingebauten Avg Funktion von DOIF lösen.
Ja, DOIF. Hmm, ist dann noch eine Syntax mit vielen Attributen, die die "Programmierung" usw. "beeinflussen" und man (ich) oft nicht weiß (wüsste) woran es liegt (DEF, "Programmierung"/Syntax oder Attribute)...
Da sind mir Dinge wie ein simples notify/at und dann einfach glatt in Perl programmieren lieber/einsichtiger ;)
Zitat von: Adimarantis am 19 November 2023, 14:30:05Und schon haben wir zwei orthogonale Anwendungsfälle und lassen es besser wie es ist.
Danke! :)
(wobei gut ein at zu basteln was dann die Werte abruft, um dann das vorhandene notify zu triggern wäre jetzt auch kein Hexenwerk / ähnlich um Kurven zu "verbessern")
Gruß, Joachim
Danke für eure Antworten
Bei den einzelnen Stromzählern/Devices soll ja durchaus alles geloggt werden. Da werden die Logs nach drei Monaten weggeworfen, nur das was ich längerfristig behalten möchte kommt in eine extra (Log-)Datei. Von daher würde ich das am Device selber nicht einschränken wollen. Mein Prinzip ist im Grunde alles zu loggen, damit ich z.B. eine Chance habe bei Fehlern eingreifen zu können, bzw. zu sehen was passiert ist. Das wird halt nach drei Monaten gelöscht. In einer zweiten Logdatei zu dem Device sammel ich dann die "interessanten" Meldungen.
Da die Angabe am statistics Device keinen Erfolg brachte, habe ich es da wieder gelöscht.
Wenn ich zudem event-min-interval statDelta.*:3600 am Device setze, kommen doch nur noch die Delta Statistiken einmal pro h durch, der Rest wird unterdrückt, oder? Aber das soll ja geloggt (und für 3 Monate aufgehoben) werden.
Ist vermutlich wie MadMax schon sagt: das statistics Modul ist nichts für mich. Habe mir jetzt auch mal den Quellcode angesehen: das ist zu hoch für mich, bzw. da fehlt mir Doku um da durchzusteigen :-)
Bin da wohl mit meinem Anwendungsfall zu speziell: wollte "nur" den min, max, Mittel und Delta Wert einmal die Stunde (Tag, Monat) haben. Vermutlich es für so einfache Dinge besser, bei einer Änderung die Werte abzuspeichern und dann über ein at zur Zeit xx:59:55 einmal ein Ereignis zu erzeugen um es ins Log zu schreiben. Setze ich mich nächstes WE mal dran, das sollte ich hinbekommen.
neben event-min-interval statDelta.*:3600 gibt es ja noch event-on-update-reading...
(und event-on-change-reading)
Gruß, Joachim
Zitat von: Betonklotz am 19 November 2023, 15:39:53Bin da wohl mit meinem Anwendungsfall zu speziell: wollte "nur" den min, max, Mittel und Delta Wert einmal die Stunde (Tag, Monat) haben.
Genau das kriegst du doch, wenn du die "..Last" Werte loggsts und die anderen ignorierst.
Gruß
Jörg
Zitat von: Adimarantis am 19 November 2023, 17:06:25Genau das kriegst du doch, wenn du die "..Last" Werte loggsts und die anderen ignorierst.
Gruß
Jörg
Danke vielmals, das ist vermutlich die Lösung.
Den normalen Log lasse ich weiter auf .* laufen, den zweiten für die gewünschten Werte habe ich auf
MQTT2_Gaszaehler:statistics.*Last|MQTT2_Stromzaehler:statistics.*Last|MQTT2_StromServerrack:statistics.*Last
eingeschränkt. Mal sehen was er mir um 19:01 Uhr sagt
...und was ganz anderes: kann ich im define eines Logfiles auch RegEx für den Devicenmanen nutzen, also z.B. so etwas wie
(.G.+_Heizung_HM......$):(statistics.*Last)
Hintergrund: aktuell muss ich da zig Heizkörper aufzählen und musste bei jedem nun den Unterstrich rausnehmen und "Last" anhängen. Wenn ich den Devicenamen so schreibe, dann wollte er ihn nicht, ein
list .G.+_Heizung_HM......$
erwischt sie hingegen alle.
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandHourMax: 2275.607
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandDayMax: 2275.607
2023-11-19_11:28:57 MQTT2_Gaszaehler statistics_ZaehlerstandMonthMax: 2275.607
Auch Max (oder Min) macht für mich bei Zählerständen eigentlich keinen Sinn.
Zum Abfragezeitpunkt ist es immer der MAX-Wert.
Für einen Temperatur-Verlauf z. B. macht es Sinn.
Gruß Ralf
Zitat von: RalfRog am 19 November 2023, 18:52:32Auch Max (oder Min) macht für mich bei Zählerständen eigentlich keinen Sinn.
Zum Abfragezeitpunkt ist es immer der MAX-Wert.
Deswegen haben die Zähler ja auch in den Singular Readings nur ein Max und Delta :-)
Wesentlich nerviger finde ich, dass tw. Logs nicht ankommen. einmal aus dem device selbst, Readings sind alle (min, max, Avg) da:
define EG_Wohnzimmer_Heizung
[...]
# READINGS:
[...]
# 2023-11-19 18:59:55 statistics_Measured-tempDay Min: 19.3 Avg: 21.3 Max: 23.6
# 2023-11-19 18:59:55 statistics_Measured-tempDayAvg 21.3
# 2023-11-18 23:59:55 statistics_Measured-tempDayAvgLast 21.5
# 2023-11-18 23:59:55 statistics_Measured-tempDayLast Min: 19.5 Avg: 21.5 Max: 22.7
# 2023-11-19 18:59:55 statistics_Measured-tempDayMax 23.6
# 2023-11-18 23:59:55 statistics_Measured-tempDayMaxLast 22.7
# 2023-11-19 18:59:55 statistics_Measured-tempDayMin 19.3
# 2023-11-18 23:59:55 statistics_Measured-tempDayMinLast 19.5
# 2023-11-19 18:59:55 statistics_Measured-tempHour Min: 21.6 Avg: 21.6 Max: 21.6
# 2023-11-19 18:59:55 statistics_Measured-tempHourAvg 21.6
# 2023-11-19 18:59:55 statistics_Measured-tempHourAvgLast 21.5
# 2023-11-19 18:59:55 statistics_Measured-tempHourLast Min: 21.4 Avg: 21.5 Max: 21.7
# 2023-11-19 18:59:55 statistics_Measured-tempHourMax 21.6
# 2023-11-19 18:59:55 statistics_Measured-tempHourMaxLast 21.7
# 2023-11-19 18:59:55 statistics_Measured-tempHourMin 21.6
# 2023-11-19 18:59:55 statistics_Measured-tempHourMinLast 21.4
# 2023-11-19 18:59:55 statistics_Measured-tempMonth Min: 19.3 Avg: 21.5 Max: 23.6 (since: 2023-11-17_18:14:37 )
# 2023-11-19 18:59:55 statistics_Measured-tempMonthAvg 21.5
# 2023-11-19 18:59:55 statistics_Measured-tempMonthMax 23.6
# 2023-11-19 18:59:55 statistics_Measured-tempMonthMin 19.3
# 2023-11-19 18:59:55 statistics_Measured-tempYear Min: 19.3 Avg: 21.5 Max: 23.6 (since: 2023-11-17_18:14:37 )
[...]
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempDay Min: 19.3 Avg: 21.3 Max: 23.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempDayAvg 21.3
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-18 23:59:55 statistics_Measured-tempDayAvgLast 21.5
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-18 23:59:55 statistics_Measured-tempDayLast Min: 19.5 Avg: 21.5 Max: 22.7
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempDayMax 23.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-18 23:59:55 statistics_Measured-tempDayMaxLast 22.7
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempDayMin 19.3
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-18 23:59:55 statistics_Measured-tempDayMinLast 19.5
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHour Min: 21.6 Avg: 21.6 Max: 21.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourAvg 21.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourAvgLast 21.5
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourLast Min: 21.4 Avg: 21.5 Max: 21.7
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourMax 21.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourMaxLast 21.7
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourMin 21.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempHourMinLast 21.4
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempMonth Min: 19.3 Avg: 21.5 Max: 23.6 (since: 2023-11-17_18:14:37 )
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempMonthAvg 21.5
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempMonthMax 23.6
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempMonthMin 19.3
setstate EG_Wohnzimmer_Heizung_HM2E86F8 2023-11-19 18:59:55 statistics_Measured-tempYear Min: 19.3 Avg: 21.5 Max: 23.6 (since: 2023-11-17_18:14:37 )
Im Log kommen sie aber nicht an, im wohnzimmer fehlt der Min.-Wert:
[...]
2023-11-19_18:59:55 EG_Kueche_Heizung statistics_Measured-tempHourMaxLast: 20.9
2023-11-19_18:59:55 EG_Toilette_Heizung statistics_Measured-tempHourLast: Min: 18.8 Avg: 19.0 Max: 19.2
2023-11-19_18:59:55 EG_Toilette_Heizung statistics_Measured-tempHourMinLast: 18.8
2023-11-19_18:59:55 EG_Toilette_Heizung statistics_Measured-tempHourAvgLast: 19.0
2023-11-19_18:59:55 EG_Toilette_Heizung statistics_Measured-tempHourMaxLast: 19.2
2023-11-19_18:59:55 EG_Wohnzimmer_Heizung statistics_Measured-tempHourLast: Min: 21.4 Avg: 21.5 Max: 21.7
2023-11-19_18:59:55 EG_Wohnzimmer_Heizung statistics_Measured-tempHourAvgLast: 21.5
2023-11-19_18:59:55 EG_Wohnzimmer_Heizung statistics_Measured-tempHourMaxLast: 21.7
2023-11-19_18:59:55 OG_Arbeitszimmer_Heizung statistics_Measured-tempHourLast: Min: 21.5 Avg: 22.2 Max: 22.4
2023-11-19_18:59:55 OG_Arbeitszimmer_Heizung statistics_Measured-tempHourMinLast: 21.5
2023-11-19_18:59:55 OG_Arbeitszimmer_Heizung statistics_Measured-tempHourAvgLast: 22.2
[...]
Und auch im Filelog des Device selber fehlt der Min...Last Wert:
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourLast: Min: 21.4 Avg: 21.7 Max: 21.9
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourMin: 21.5
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourAvg: 21.5
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourAvgLast: 21.7
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourMax: 21.5
2023-11-19_17:59:55 EG_Wohnzimmer_Heizung_HM2E86F8 statistics_Measured-tempHourMaxLast: 21.9
Lt. #5 (Adimarantis)
ZitatDie min/avg/max readings werden zwar bei jedem Update des readings aktualisiert, es wird aber kein Event erzeugt. Nur das "last" erzeugt dann einmal pro periode ein Event.
Das ist dann der Grund warum nichts im Log landet.
Steht zwar nicht in der CommandRef aber ich meine dazu mal was gelesen zu haben (evtl. WIKI).
Nein, das "kann" es eigentlich nicht sein, bzw. wäre maximal inkosistent. Die max, maxLast, avg, avgLast usw. Werte sind ja alle da und an anderen Devices kommen auch alle. Es fehlen hier nur die Min. Werte. Und gerade mal genauer geschaut: an einem anderen Device fehlt der Max Wert... Und auch bei der 20Uhr Aktualisierung fehlen die.
Gebe langsam auf, mit der Fehlersuche und ärgern geht mehr Zeit drauf, als selber eine myUtils anzulegen.
Gerade mal quick and dirty was ausprobiert: kommt man über ein Notify das z.B. {neue_Temperatur_gemessen("$NAME")} aufruft an den nötigen Hash des Devices?
# Device bestimmen von dem der Funktionsaufruf ausgelöst wurde
my ($aufrufendes_device) = @_;
my ($aufrufendes_device_hash) = $defs->{$aufrufendes_device};
# ja, wurde erreicht -> abspeichern im Reading ohne ein Event auszulösen
my ($rv_hour) = readingsSingleUpdate ($aufrufendes_device_hash, "max_temp_hour", $neuer_temp_wert, 0);
Denn das scheitert grandios...
Global symbol "$defs" requires explicit package name (did you forget to declare "my $defs"?) at ./FHEM/99_myHeizungswerteUtils.pm line 34
argh, vergesst die Frage
my ($aufrufendes_device_hash) = $defs{$aufrufendes_device};
und alles wird gut. FHEM meckert zwar weiter, läuft aber wie es soll
Und ich dachte (ok, da ist der Fehler am Anfang des Satzes), ich könnte einfach ein paar Berechnungen übernehmen. Aber wenn ich z.B. so etwas lese
if ($hidden[3]>0) {$stat[3] = $hidden[1] / $hidden[3];} # Avg
wird mir schlecht. Also ja, sicher weiß jeder was an den Positionen gespeichert ist, ist auch völlig unnötig das zu kommentieren...
Ich gebe auf, nächstes Wochenende wird das umgesetzt wie ich es benötige.