FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: Maui am 30 Mai 2018, 13:22:43

Titel: [Gelöst] Statistics "spinnt"
Beitrag von: Maui am 30 Mai 2018, 13:22:43
Moin, da die Frage sicherlich dumm und einfach ist, stelle ich sie mal erstmal hier.
Ich habe für den Hamster einen Reed-Switch mit Wemos und ESP-Easy. Dort den Reed als Pulse Counter eingerichtet. Das Zählen klappt auch super. Allerdings würde ich gerne das statistics-Modul nutzen, um einfach zu sehen, wieviel der kleine in jeder Nacht gelaufen ist. Ich nutze statistics bereits für meinen Gaszähler-Counter und meinen Aussentemp-Sensor.
Beim Hamster krieg ichs aber nicht gebacken. Ich habe ein UserReading auf den Total des Counters, damit er beim Stromverlust weiter zählt in FHEM.
TotalPers monotonic {ReadingsVal("ESPEasy_bockwurst_reed","Total",0)}
Das klappt auch so gut. Was ich jetzt gerne hätte, wäre das Delta von 1 Nacht, also irgendwas von 11:00-11:00 auf das Reading TotalPers.
Ich dachte mir dann nehme ich statistics und nutze dayChangeTime. Dort dann noch ein singularReadings
ESPEasy_bockwurst_reed:TotalPers:Delta:Day


Allerdings klappt es nicht wie gewünscht. Ich kriege nur ein Arschlanges Reading erstellt von statistics, zB bei statStateDayLast

Cou:_0.00_Tot:_185686.00: 00:13:06 Cou:_0.00_Tot:_185686.00_Count: 1 Cou:_0.00_Tot:_185753.00: 00:01:00 Cou:_0.00_Tot:_185753.00_Count: 1 Cou:_0.00_Tot:_185827.00: 00:18:02 Cou:_0.00_Tot:_185827.00_Count: 1 Cou:_0.00_Tot:_185864.00: 00:28:03 Cou:_0.00_Tot:_185864.00_Count: 1 Cou:_0.00_Tot:_186092.00: 00:10:02 Cou:_0.00_Tot:_186092.00_Count: 1 Cou:_0.00_Tot:_186154.00: 00:23:04 Cou:_0.00_Tot:_186154.00_Count: 1 Cou:_0.00_Tot:_186173.00: 01:08:07 Cou:_0.00_Tot:_186173.00_Count: 1 Cou:_0.00_Tot:_186207.00: 00:30:02 Cou:_0.00_Tot:_186207.00_Count: 1 Cou:_0.00_Tot:_186214.00: 08:09:29 Cou:_0.00_Tot:_186214.00_Count: 1 Cou:_0.00_Tot:_186215.00: 05:03:21 Cou:_0.00_Tot:_186215.00_Count: 1 Cou:_0.00_Tot:_186216.00: 05:21:42 Cou:_0.00_Tot:_186216.00_Count: 2 Cou:_0.00_Tot:_186244.00: 00:03:01 Cou:_0.00_Tot:_186244.00_Count: 1 Cou:_0.00_Tot:_186319.00: 00:02:02 Cou:_0.00_Tot:_186319.00_Count: 1 Cou:_0.00_Tot:_186461.00: 00:07:02 Cou:_0.00_Tot:_186461.00_Count: 1 Cou:_0.00_Tot:_186614.00: 00:04:01 Cou:_0.00_Tot:_186614.00_Count: 1 Cou:_0.00_Tot:_186784.00: 00:12:02 Cou:_0.00_Tot:_186784.00_Count: 1 Cou:_0.00_Tot:_186966.00: 00:02:01 Cou:_0.00_Tot:_186966.00_Count: 1 Cou:_0.00_Tot:_187052.00: 00:04:02 Cou:_0.00_Tot:_187052.00_Count: 1 Cou:_0.00_Tot:_187177.00: 00:06:01 Cou:_0.00_Tot:_187177.00_Count: 1 Cou:_0.00_Tot:_187326.00: 00:05:01 Cou:_0.00_Tot:_187326.00_Count: 1 Cou:_0.00_Tot:_187478.00: 00:07:02 Cou:_0.00_Tot:_187478.00_Count: 1 Cou:_0.00_Tot:_187598.00: 00:03:02 Cou:_0.00_Tot:_187598.00_Count: 1 Cou:_0.00_Tot:_187727.00: 00:01:42 Cou:_0.00_Tot:_187727.00_Count: 1 Cou:_1.00_Tot:_186215.00: 00:01:00 Cou:_1.00_Tot:_186215.00_Count: 1 Cou:_1.00_Tot:_186216.00: 00:01:00 Cou:_1.00_Tot:_186216.00_Count: 1 Cou:_1.00_Tot:_187327.00: 00:01:00 Cou:_1.00_Tot:_187327.00_Count: 1 Cou:_10.00_Tot:_186164.00: 00:00:59 Cou:_10.00_Tot:_186164.00_Count: 1 Cou:_10.00_Tot:_186183.00: 00:00:59 Cou:_10.00_Tot:_186183.00_Count: 1 Cou:_10.00_Tot:_186319.00: 00:01:00 Cou:_10.00_Tot:_186319.00_Count: 1 Cou:_12.00_Tot:_186104.00: 00:01:01 Cou:_12.00_Tot:_186104.00_Count: 1 Cou:_14.00_Tot:_186798.00: 00:01:01 Cou:_14.00_Tot:_186798.00_Count: 1 Cou:_15.00_Tot:_186119.00: 00:01:00 Cou:_15.00_Tot:_186119.00_Count: 1 Cou:_18.00_Tot:_185864.00: 00:01:00 Cou:_18.00_Tot:_185864.00_Count: 1 Cou:_19.00_Tot:_185824.00: 00:01:00 Cou:_19.00_Tot:_185824.00_Count: 1 Cou:_19.00_Tot:_185846.00: 00:01:01 Cou:_19.00_Tot:_185846.00_Count: 1 Cou:_2.00_Tot:_185955.00: 00:01:01 Cou:_2.00_Tot:_185955.00_Count: 1 Cou:_21.00_Tot:_186092.00: 00:01:01 Cou:_21.00_Tot:_186092.00_Count: 1 Cou:_23.00_Tot:_185978.00: 00:01:00 Cou:_23.00_Tot:_185978.00_Count: 1 Cou:_24.00_Tot:_185753.00: 00:01:00 Cou:_24.00_Tot:_185753.00_Count: 1 Cou:_24.00_Tot:_186002.00: 00:00:59 Cou:_24.00_Tot:_186002.00_Count: 1 Cou:_24.00_Tot:_186207.00: 00:01:00 Cou:_24.00_Tot:_186207.00_Count: 1 Cou:_25.00_Tot:_186966.00: 00:01:01 Cou:_25.00_Tot:_186966.00_Count: 1 Cou:_25.00_Tot:_187326.00: 00:01:00 Cou:_25.00_Tot:_187326.00_Count: 1 Cou:_27.00_Tot:_187598.00: 00:01:00 Cou:_27.00_Tot:_187598.00_Count: 1 Cou:_28.00_Tot:_186244.00: 00:01:00 Cou:_28.00_Tot:_186244.00_Count: 1 Cou:_3.00_Tot:_185827.00: 00:01:00 Cou:_3.00_Tot:_185827.00_Count: 1 Cou:_30.00_Tot:_186996.00: 00:01:00 Cou:_30.00_Tot:_186996.00_Count: 1 Cou:_30.00_Tot:_187516.00: 00:01:02 Cou:_30.00_Tot:_187516.00_Count: 1 Cou:_31.00_Tot:_187403.00: 00:01:01 Cou:_31.00_Tot:_187403.00_Count: 1 Cou:_32.00_Tot:_186034.00: 00:01:01 Cou:_32.00_Tot:_186034.00_Count: 1 Cou:_32.00_Tot:_186071.00: 00:01:00 Cou:_32.00_Tot:_186071.00_Count: 1 Cou:_33.00_Tot:_187177.00: 00:01:00 Cou:_33.00_Tot:_187177.00_Count: 1 Cou:_34.00_Tot:_187437.00: 00:01:00 Cou:_34.00_Tot:_187437.00_Count: 1 Cou:_34.00_Tot:_187681.00: 00:01:00 Cou:_34.00_Tot:_187681.00_Count: 1 Cou:_35.00_Tot:_186154.00: 00:00:59 Cou:_35.00_Tot:_186154.00_Count: 1 Cou:_36.00_Tot:_186410.00: 00:00:58 Cou:_36.00_Tot:_186410.00_Count: 1 Cou:_37.00_Tot:_185953.00: 00:01:00 Cou:_37.00_Tot:_185953.00_Count: 1 Cou:_37.00_Tot:_186614.00: 00:01:00 Cou:_37.00_Tot:_186614.00_Count: 1 Cou:_39.00_Tot:_187216.00: 00:01:02 Cou:_39.00_Tot:_187216.00_Count: 1 Cou:_39.00_Tot:_187301.00: 00:00:59 Cou:_39.00_Tot:_187301.00_Count: 1 Cou:_4.00_Tot:_187052.00: 00:01:00 Cou:_4.00_Tot:_187052.00_Count: 1 Cou:_40.00_Tot:_186941.00: 00:01:01 Cou:_40.00_Tot:_186941.00_Count: 1 Cou:_41.00_Tot:_187478.00: 00:01:00 Cou:_41.00_Tot:_187478.00_Count: 1 Cou:_41.00_Tot:_187647.00: 00:01:01 Cou:_41.00_Tot:_187647.00_Count: 1 Cou:_43.00_Tot:_185729.00: 00:01:00 Cou:_43.00_Tot:_185729.00_Count: 1 Cou:_43.00_Tot:_185805.00: 00:01:00 Cou:_43.00_Tot:_185805.00_Count: 1 Cou:_43.00_Tot:_185916.00: 00:01:00 Cou:_43.00_Tot:_185916.00_Count: 1 Cou:_45.00_Tot:_187097.00: 00:01:00 Cou:_45.00_Tot:_187097.00_Count: 1 Cou:_45.00_Tot:_187372.00: 00:01:00 Cou:_45.00_Tot:_187372.00_Count: 1 Cou:_46.00_Tot:_187262.00: 00:01:01 Cou:_46.00_Tot:_187262.00_Count: 1 Cou:_46.00_Tot:_187727.00: 00:01:00 Cou:_46.00_Tot:_187727.00_Count: 1 Cou:_47.00_Tot:_187144.00: 00:00:59 Cou:_47.00_Tot:_187144.00_Count: 1 Cou:_5.00_Tot:_186039.00: 00:01:01 Cou:_5.00_Tot:_186039.00_Count: 1 Cou:_50.00_Tot:_186901.00: 00:00:58 Cou:_50.00_Tot:_186901.00_Count: 1 Cou:_51.00_Tot:_186461.00: 00:01:00 Cou:_51.00_Tot:_186461.00_Count: 1 Cou:_51.00_Tot:_186665.00: 00:01:00 Cou:_51.00_Tot:_186665.00_Count: 1 Cou:_52.00_Tot:_187048.00: 00:01:00 Cou:_52.00_Tot:_187048.00_Count: 1 Cou:_53.00_Tot:_186577.00: 00:01:01 Cou:_53.00_Tot:_186577.00_Count: 1 Cou:_53.00_Tot:_186775.00: 00:01:00 Cou:_53.00_Tot:_186775.00_Count: 1 Cou:_53.00_Tot:_186851.00: 00:01:02 Cou:_53.00_Tot:_186851.00_Count: 1 Cou:_55.00_Tot:_186374.00: 00:01:02 Cou:_55.00_Tot:_186374.00_Count: 1 Cou:_55.00_Tot:_186524.00: 00:01:00 Cou:_55.00_Tot:_186524.00_Count: 1 Cou:_55.00_Tot:_187571.00: 00:00:59 Cou:_55.00_Tot:_187571.00_Count: 1 Cou:_57.00_Tot:_186722.00: 00:01:00 Cou:_57.00_Tot:_186722.00_Count: 1 Cou:_59.00_Tot:_186309.00: 00:00:59 Cou:_59.00_Tot:_186309.00_Count: 1 Cou:_6.00_Tot:_186250.00: 00:01:01 Cou:_6.00_Tot:_186250.00_Count: 1 Cou:_7.00_Tot:_186214.00: 00:01:01 Cou:_7.00_Tot:_186214.00_Count: 1 Cou:_8.00_Tot:_186469.00: 00:01:00 Cou:_8.00_Tot:_186469.00_Count: 1 Cou:_8.00_Tot:_187486.00: 00:01:00 Cou:_8.00_Tot:_187486.00_Count: 1 Cou:_8.00_Tot:_187606.00: 00:01:01 Cou:_8.00_Tot:_187606.00_Count: 1 Cou:_9.00_Tot:_185762.00: 00:01:02 Cou:_9.00_Tot:_185762.00_Count: 1 Cou:_9.00_Tot:_185873.00: 00:01:01 Cou:_9.00_Tot:_185873.00_Count: 1 Cou:_9.00_Tot:_186173.00: 00:01:00 Cou:_9.00_Tot:_186173.00_Count: 1 Cou:_9.00_Tot:_186784.00: 00:01:00 Cou:_9.00_Tot:_186784.00_Count: 1 absent: 00:05:48 absent_Count: 1


Ich bin auch offen für andere Ansätze, muss dafür kein statistics-Modul nehmen.
Titel: Antw:Statistics "spinnt"
Beitrag von: Prof. Dr. Peter Henning am 30 Mai 2018, 21:28:13
Dieses Längenmaß ist hier nicht bekannt.

pah
Titel: Antw:Statistics "spinnt"
Beitrag von: Maui am 30 Mai 2018, 22:50:54
Was würden wir hier in dem Forum nur ohne dich machen  ::)
Titel: Antw:[Gelöst] Statistics "spinnt"
Beitrag von: Maui am 31 Mai 2018, 08:51:28
Falls jmd später drüber stolpert.
Ich mach es jetzt zu Fuß. Setze per at und setreading den Wert einmal am Tag fest.
Per userReadings berechne ich dann die Differenz und bevor der Wert wieder überschrieben wird per setreading schicke ich ihn mir per Telegram.