fhem cpu Auslastung bis zu 87%

Begonnen von heinzfo, 11 Oktober 2017, 20:45:45

Vorheriges Thema - Nächstes Thema

heinzfo

Hallo

Ich betrachte im ssh terminal mit den Befehl top die FHEM cpu Auslastung.

Ein mal in der Minute erreicht die Auslastung rund 87%
In disem Moment dauert der Seitenaufbau von FHEM Seiten im LAN recht lange.
Das ist erst neuerdings aufgetreten und war bisher nicht zu beobachten.

Wie kann ich herausfinden woran das liegt?

Beste Grüße
Heinz

schka17

Z.b. Mit strace beobachten was zu dem Zeitpunkt passiert (wenn die last in einem childprocess erzeugt wird ists ein bischen komplizierter), dann gibts da noch apptime


Sent from my iPad using Tapatalk
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000

heinzfo

Danke

Habe es herausgefunden, es liegt am lesen und auswerten der Stromzähler alle 60sec, das habe ich kürzlich eingebaut.

So wie es aussieht brauche ich eine stärkere HW als den momentan verwendeten RPi2  :'(

Grüße
Heinz

CoolTux

Wie liest Du denn den Stromzähler aus? Kann mir nicht vorstellen das ein Pi2 nicht reicht.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

heinzfo

Ich bin mal so mutig und paste den code hier rein, auch wenn jetzt mancher die Hände über dem Kopf zusammelschlägt.


##------- Waschen Stromkosten
define WaschenStromkostenGesamt dummy
attr WaschenStromkostenGesamt group Waschen-Stromkosten
attr WaschenStromkostenGesamt room Stromkosten
attr WaschenStromkostenGesamt sortby 01
attr WaschenStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WaschenStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WaschenStromkostenGesamt","Kosten",0))]->[0])}
attr WaschenStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("WaschenStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WaschenStromkostenGesamt","Verbrauch",0)*0.2575}
define WaschenStromkostenJahr dummy
attr WaschenStromkostenJahr group Waschen-Stromkosten
attr WaschenStromkostenJahr room Stromkosten
attr WaschenStromkostenJahr sortby 02
attr WaschenStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WaschenStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WaschenStromkostenJahr","Kosten",0))]->[0])}
attr WaschenStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("WaschenStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WaschenStromkostenJahr","Verbrauch",0)*0.2575}
define WaschenStromkostenMonat dummy
attr WaschenStromkostenMonat group Waschen-Stromkosten
attr WaschenStromkostenMonat room Stromkosten
attr WaschenStromkostenMonat sortby 03
attr WaschenStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WaschenStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WaschenStromkostenMonat","Kosten",0))]->[0])}
attr WaschenStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("WaschenStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WaschenStromkostenMonat","Verbrauch",0)*0.2575}
define WaschenStromkostenTag dummy
attr WaschenStromkostenTag group Waschen-Stromkosten
attr WaschenStromkostenTag room Stromkosten
attr WaschenStromkostenTag sortby 04
attr WaschenStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WaschenStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WaschenStromkostenTag","Kosten",0))]->[0])}
attr WaschenStromkostenTag userReadings Kosten {ReadingsVal("WaschenStromkostenTag","Verbrauch",0)*0.2575}
define atWaschenStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Waschen_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Waschen_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading WaschenStromkostenGestern Verbrauch $b");;\
fhem("setreading WaschenStromkostenTag Verbrauch $a");;\
fhem("setreading WaschenStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading WaschenStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading WaschenStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Waschen_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading WaschenStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading WaschenStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading WaschenStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading WaschenStromkostenJahr Verbrauch 0")}}
attr atWaschenStromkosten disable 0
attr atWaschenStromkosten room Stromkosten
attr atWaschenStromkosten sortby 07
define GroupWaschenStromkosten readingsGroup < >,<Verbrauch>,<Kosten>\
WaschenStromkostenGesamt:Verbrauch,Kosten\
WaschenStromkostenJahr:Verbrauch,Kosten\
WaschenStromkostenMonat:Verbrauch,Kosten\
WaschenStromkostenTag:Verbrauch,Kosten
attr GroupWaschenStromkosten room Stromkosten
attr GroupWaschenStromkosten style style="font-size:18px"
attr GroupWaschenStromkosten valueFormat {Kosten => "%.2f €", Verbrauch => "%.2f kWh"}
attr GroupWaschenStromkosten valueStyle {\
if($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1800)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1080)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 0) \
{'style="color:green"'}\
elsif($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 460)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 275)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 150)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 90)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 38)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 23)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 5)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 3)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Kosten" && $VALUE > 1.25)\
{'style="color:red"'}\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Kosten" && $VALUE > 0.75)\
{'style="color:orange"'}\
elsif($DEVICE eq "WaschenStromkostenTag" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'} }

##------- Trocknen Stromkosten
define TrocknenStromkostenGesamt dummy
attr TrocknenStromkostenGesamt group Trocknen-Stromkosten
attr TrocknenStromkostenGesamt room Stromkosten
attr TrocknenStromkostenGesamt sortby 01
attr TrocknenStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("TrocknenStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("TrocknenStromkostenGesamt","Kosten",0))]->[0])}
attr TrocknenStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("TrocknenStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("TrocknenStromkostenGesamt","Verbrauch",0)*0.2575}
define TrocknenStromkostenJahr dummy
attr TrocknenStromkostenJahr group Trocknen-Stromkosten
attr TrocknenStromkostenJahr room Stromkosten
attr TrocknenStromkostenJahr sortby 02
attr TrocknenStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("TrocknenStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("TrocknenStromkostenJahr","Kosten",0))]->[0])}
attr TrocknenStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("TrocknenStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("TrocknenStromkostenJahr","Verbrauch",0)*0.2575}
define TrocknenStromkostenMonat dummy
attr TrocknenStromkostenMonat group Trocknen-Stromkosten
attr TrocknenStromkostenMonat room Stromkosten
attr TrocknenStromkostenMonat sortby 03
attr TrocknenStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("TrocknenStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("TrocknenStromkostenMonat","Kosten",0))]->[0])}
attr TrocknenStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("TrocknenStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("TrocknenStromkostenMonat","Verbrauch",0)*0.2575}
define TrocknenStromkostenTag dummy
attr TrocknenStromkostenTag group Trocknen-Stromkosten
attr TrocknenStromkostenTag room Stromkosten
attr TrocknenStromkostenTag sortby 04
attr TrocknenStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("TrocknenStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("TrocknenStromkostenTag","Kosten",0))]->[0])}
attr TrocknenStromkostenTag userReadings Kosten {ReadingsVal("TrocknenStromkostenTag","Verbrauch",0)*0.2575}
define atTrocknenStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Trocknen_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Trocknen_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading TrocknenStromkostenGestern Verbrauch $b");;\
fhem("setreading TrocknenStromkostenTag Verbrauch $a");;\
fhem("setreading TrocknenStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading TrocknenStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading TrocknenStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Trocknen_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading TrocknenStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading TrocknenStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading TrocknenStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading TrocknenStromkostenJahr Verbrauch 0")}}
attr atTrocknenStromkosten disable 0
attr atTrocknenStromkosten room Stromkosten
attr atTrocknenStromkosten sortby 08
define GroupTrocknenStromkosten readingsGroup < >,<Verbrauch>,<Kosten>\
TrocknenStromkostenGesamt:Verbrauch,Kosten\
TrocknenStromkostenJahr:Verbrauch,Kosten\
TrocknenStromkostenMonat:Verbrauch,Kosten\
TrocknenStromkostenTag:Verbrauch,Kosten
attr GroupTrocknenStromkosten room Stromkosten
attr GroupTrocknenStromkosten style style="font-size:18px"
attr GroupTrocknenStromkosten valueFormat {Kosten => "%.2f €", Verbrauch => "%.2f kWh"}
attr GroupTrocknenStromkosten valueStyle {\
if($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1800)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1080)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 0) \
{'style="color:green"'}\
elsif($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 460)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 275)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenJahr" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 150)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 90)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 38)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 23)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenMonat" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 5)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 3)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Kosten" && $VALUE > 1.25)\
{'style="color:red"'}\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Kosten" && $VALUE > 0.75)\
{'style="color:orange"'}\
elsif($DEVICE eq "TrocknenStromkostenTag" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'} }
##------- Ende

##------- AZ_Technikraum Stromkosten
define AZ_TechnikraumStromkostenGesamt dummy
attr AZ_TechnikraumStromkostenGesamt group AZ_Technikraum-Stromkosten
attr AZ_TechnikraumStromkostenGesamt room Stromkosten
attr AZ_TechnikraumStromkostenGesamt sortby 01
attr AZ_TechnikraumStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGesamt","Kosten",0))]->[0])}
attr AZ_TechnikraumStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("AZ_TechnikraumStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("AZ_TechnikraumStromkostenGesamt","Verbrauch",0)*0.2575}
define AZ_TechnikraumStromkostenJahr dummy
attr AZ_TechnikraumStromkostenJahr group AZ_Technikraum-Stromkosten
attr AZ_TechnikraumStromkostenJahr room Stromkosten
attr AZ_TechnikraumStromkostenJahr sortby 02
attr AZ_TechnikraumStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGesamt","Kosten",0))]->[0])}
attr AZ_TechnikraumStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("AZ_TechnikraumStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("AZ_TechnikraumStromkostenGesamt","Verbrauch",0)*0.2575}
define AZ_TechnikraumStromkostenMonat dummy
attr AZ_TechnikraumStromkostenMonat group AZ_Technikraum-Stromkosten
attr AZ_TechnikraumStromkostenMonat room Stromkosten
attr AZ_TechnikraumStromkostenMonat sortby 03
attr AZ_TechnikraumStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenMonat","Kosten",0))]->[0])}
attr AZ_TechnikraumStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("AZ_TechnikraumStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("AZ_TechnikraumStromkostenMonat","Verbrauch",0)*0.2575}
define AZ_TechnikraumStromkostenTag dummy
attr AZ_TechnikraumStromkostenTag group AZ_Technikraum-Stromkosten
attr AZ_TechnikraumStromkostenTag room Stromkosten
attr AZ_TechnikraumStromkostenTag sortby 04
attr AZ_TechnikraumStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenTag","Kosten",0))]->[0])}
attr AZ_TechnikraumStromkostenTag userReadings Kosten {ReadingsVal("AZ_TechnikraumStromkostenTag","Verbrauch",0)*0.2575}
define atAZ_TechnikraumStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("AZ_Technikraum_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("AZ_Technikraum_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading AZ_TechnikraumStromkostenGestern Verbrauch $b");;\
fhem("setreading AZ_TechnikraumStromkostenTag Verbrauch $a");;\
fhem("setreading AZ_TechnikraumStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading AZ_TechnikraumStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading AZ_TechnikraumStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics AZ_Technikraum_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading AZ_TechnikraumStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading AZ_TechnikraumStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading AZ_TechnikraumStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading AZ_TechnikraumStromkostenJahr Verbrauch 0")}}
attr atAZ_TechnikraumStromkosten disable 0
attr atAZ_TechnikraumStromkosten room Stromkosten
attr atAZ_TechnikraumStromkosten sortby 01
define GroupAZ_TechnikraumStromkosten readingsGroup < >,<Verbrauch>,<Kosten>\
AZ_TechnikraumStromkostenGesamt:Verbrauch,Kosten\
AZ_TechnikraumStromkostenJahr:Verbrauch,Kosten\
AZ_TechnikraumStromkostenMonat:Verbrauch,Kosten\
AZ_TechnikraumStromkostenTag:Verbrauch,Kosten
attr GroupAZ_TechnikraumStromkosten room Stromkosten
attr GroupAZ_TechnikraumStromkosten style style="font-size:18px"
attr GroupAZ_TechnikraumStromkosten valueFormat {Kosten => "%.2f €", Verbrauch => "%.2f kWh"}
attr GroupAZ_TechnikraumStromkosten valueStyle {\
if($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1800)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1080)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 0) \
{'style="color:green"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Kosten" && $VALUE > 460)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Kosten" && $VALUE > 275)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenJahr" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 150)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 90)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Kosten" && $VALUE > 38)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Kosten" && $VALUE > 23)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenMonat" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 5)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 3)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Kosten" && $VALUE > 1.25)\
{'style="color:red"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Kosten" && $VALUE > 0.75)\
{'style="color:orange"'}\
elsif($DEVICE eq "AZ_TechnikraumStromkostenTag" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'} }
##------- Ende

##------- Keller_Heizung Stromkosten
define Keller_HeizungStromkostenGesamt dummy
attr Keller_HeizungStromkostenGesamt group Keller_Heizung-Stromkosten
attr Keller_HeizungStromkostenGesamt room Stromkosten
attr Keller_HeizungStromkostenGesamt sortby 01
attr Keller_HeizungStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGesamt","Kosten",0))]->[0])}
attr Keller_HeizungStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("Keller_HeizungStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("Keller_HeizungStromkostenGesamt","Verbrauch",0)*0.2575}
define Keller_HeizungStromkostenJahr dummy
attr Keller_HeizungStromkostenJahr group Keller_Heizung-Stromkosten
attr Keller_HeizungStromkostenJahr room Stromkosten
attr Keller_HeizungStromkostenJahr sortby 02
attr Keller_HeizungStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGesamt","Kosten",0))]->[0])}
attr Keller_HeizungStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("Keller_HeizungStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("Keller_HeizungStromkostenGesamt","Verbrauch",0)*0.2575}
define Keller_HeizungStromkostenMonat dummy
attr Keller_HeizungStromkostenMonat group Keller_Heizung-Stromkosten
attr Keller_HeizungStromkostenMonat room Stromkosten
attr Keller_HeizungStromkostenMonat sortby 03
attr Keller_HeizungStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("Keller_HeizungStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("Keller_HeizungStromkostenMonat","Kosten",0))]->[0])}
attr Keller_HeizungStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("Keller_HeizungStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("Keller_HeizungStromkostenMonat","Verbrauch",0)*0.2575}
define Keller_HeizungStromkostenTag dummy
attr Keller_HeizungStromkostenTag group Keller_Heizung-Stromkosten
attr Keller_HeizungStromkostenTag room Stromkosten
attr Keller_HeizungStromkostenTag sortby 04
attr Keller_HeizungStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("Keller_HeizungStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("Keller_HeizungStromkostenTag","Kosten",0))]->[0])}
attr Keller_HeizungStromkostenTag userReadings Kosten {ReadingsVal("Keller_HeizungStromkostenTag","Verbrauch",0)*0.2575}
define atKeller_HeizungStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Keller_Heizung_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Keller_Heizung_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading Keller_HeizungStromkostenGestern Verbrauch $b");;\
fhem("setreading Keller_HeizungStromkostenTag Verbrauch $a");;\
fhem("setreading Keller_HeizungStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading Keller_HeizungStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading Keller_HeizungStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Keller_Heizung_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading Keller_HeizungStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading Keller_HeizungStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading Keller_HeizungStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading Keller_HeizungStromkostenJahr Verbrauch 0")}}
attr atKeller_HeizungStromkosten disable 0
attr atKeller_HeizungStromkosten room Stromkosten
attr atKeller_HeizungStromkosten sortby 05
define GroupKeller_HeizungStromkosten readingsGroup < >,<Verbrauch>,<Kosten>\
Keller_HeizungStromkostenGesamt:Verbrauch,Kosten\
Keller_HeizungStromkostenJahr:Verbrauch,Kosten\
Keller_HeizungStromkostenMonat:Verbrauch,Kosten\
Keller_HeizungStromkostenTag:Verbrauch,Kosten
attr GroupKeller_HeizungStromkosten room Stromkosten
attr GroupKeller_HeizungStromkosten style style="font-size:18px"
attr GroupKeller_HeizungStromkosten valueFormat {Kosten => "%.2f €", Verbrauch => "%.2f kWh"}
attr GroupKeller_HeizungStromkosten valueStyle {\
if($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1800)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 1080)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Verbrauch" && $VALUE > 0) \
{'style="color:green"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Kosten" && $VALUE > 460)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Kosten" && $VALUE > 275)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenJahr" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 150)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 90)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Kosten" && $VALUE > 38)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Kosten" && $VALUE > 23)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenMonat" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'}\
\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 5)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 3)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Verbrauch" && $VALUE > 0)\
{'style="color:green"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Kosten" && $VALUE > 1.25)\
{'style="color:red"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Kosten" && $VALUE > 0.75)\
{'style="color:orange"'}\
elsif($DEVICE eq "Keller_HeizungStromkostenTag" && $READING eq "Kosten" && $VALUE > 0)\
{'style="color:green"'} }
##------- Ende

##------- Gesamt Stromkosten

define StromkostenGesamt dummy
attr StromkostenGesamt group Gesamt-Stromkosten
attr StromkostenGesamt room Stromkosten
attr StromkostenGesamt sortby 01
attr StromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("StromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("StromkostenGesamt","Kosten",0))]->[0])}
attr StromkostenGesamt userReadings Kosten {ReadingsVal("StromkostenGesamt","Verbrauch",0)*0.2575}
define StromkostenJahr dummy
attr StromkostenJahr group Gesamt-Stromkosten
attr StromkostenJahr room Stromkosten
attr StromkostenJahr sortby 02
attr StromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("StromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("StromkostenJahr","Kosten",0))]->[0])}
attr StromkostenJahr userReadings Kosten {ReadingsVal("StromkostenJahr","Verbrauch",0)*0.2575}
define StromkostenMonat dummy
attr StromkostenMonat group Gesamt-Stromkosten
attr StromkostenMonat room Stromkosten
attr StromkostenMonat sortby 03
attr StromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("StromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("StromkostenMonat","Kosten",0))]->[0])}
attr StromkostenMonat userReadings Kosten {ReadingsVal("StromkostenMonat","Verbrauch",0)*0.2575}
define StromkostenTag dummy
attr StromkostenTag group Gesamt-Stromkosten
attr StromkostenTag room Stromkosten
attr StromkostenTag setList Verbrauch
attr StromkostenTag sortby 04
attr StromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("StromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("StromkostenTag","Kosten",0))]->[0])}
attr StromkostenTag userReadings Kosten {ReadingsVal("StromkostenTag","Verbrauch",0)*0.2575}
define atGesamtStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("WaschenStromkostenGesamt","Verbrauch",0));;\
my $b = (ReadingsVal("WaschenStromkostenJahr","Verbrauch",0));;\
my $c = (ReadingsVal("WaschenStromkostenMonat","Verbrauch",0));;\
my $d = (ReadingsVal("WaschenStromkostenTag","Verbrauch",0));;\
my $aa = (ReadingsVal("WaschenStromkostenGestern","Verbrauch",0));;\
\
my $e = (ReadingsVal("TrocknenStromkostenGesamt","Verbrauch",0));;\
my $f = (ReadingsVal("TrocknenStromkostenJahr","Verbrauch",0));;\
my $g = (ReadingsVal("TrocknenStromkostenMonat","Verbrauch",0));;\
my $h = (ReadingsVal("TrocknenStromkostenTag","Verbrauch",0));;\
my $ea = (ReadingsVal("TrocknenStromkostenGestern","Verbrauch",0));;\
\
my $i = (ReadingsVal("AZ_TechnikraumStromkostenGesamt","Verbrauch",0));;\
my $j = (ReadingsVal("AZ_TechnikraumStromkostenJahr","Verbrauch",0));;\
my $k = (ReadingsVal("AZ_TechnikraumStromkostenMonat","Verbrauch",0));;\
my $l = (ReadingsVal("AZ_TechnikraumStromkostenTag","Verbrauch",0));;\
my $ia = (ReadingsVal("AZ_TechnikraumStromkostenGestern","Verbrauch",0));;\
\
my $m = (ReadingsVal("Keller_HeizungStromkostenGesamt","Verbrauch",0));;\
my $n = (ReadingsVal("Keller_HeizungStromkostenJahr","Verbrauch",0));;\
my $o = (ReadingsVal("Keller_HeizungStromkostenMonat","Verbrauch",0));;\
my $p = (ReadingsVal("Keller_HeizungStromkostenTag","Verbrauch",0));;\
my $ma = (ReadingsVal("Keller_HeizungStromkostenGestern","Verbrauch",0));;\
\
my $q = (ReadingsVal("SpuelenStromkostenGesamt","Verbrauch",0));;\
my $r = (ReadingsVal("SpuelenStromkostenJahr","Verbrauch",0));;\
my $s = (ReadingsVal("SpuelenStromkostenMonat","Verbrauch",0));;\
my $t = (ReadingsVal("SpuelenStromkostenTag","Verbrauch",0));;\
my $qa = (ReadingsVal("SpuelenStromkostenGestern","Verbrauch",0));;\
\
my $u = (ReadingsVal("KuecheStromkostenGesamt","Verbrauch",0));;\
my $v = (ReadingsVal("KuecheStromkostenJahr","Verbrauch",0));;\
my $w = (ReadingsVal("KuecheStromkostenMonat","Verbrauch",0));;\
my $x = (ReadingsVal("KuecheStromkostenTag","Verbrauch",0));;\
my $ua = (ReadingsVal("KuecheStromkostenGestern","Verbrauch",0));;\
\
my $z = (ReadingsVal("KuecheStromkostenGesamt","Verbrauch",0));;\
my $za = (ReadingsVal("KuecheStromkostenJahr","Verbrauch",0));;\
my $zb = (ReadingsVal("KuecheStromkostenMonat","Verbrauch",0));;\
my $zc = (ReadingsVal("KuecheStromkostenTag","Verbrauch",0));;\
my $zd = (ReadingsVal("KuecheStromkostenGestern","Verbrauch",0));;\
\
my $xx = (ReadingsVal("PedelecStromkostenGesamt","Verbrauch",0));;\
my $xa = (ReadingsVal("PedelecStromkostenJahr","Verbrauch",0));;\
my $xb = (ReadingsVal("PedelecStromkostenMonat","Verbrauch",0));;\
my $xc = (ReadingsVal("PedelecStromkostenTag","Verbrauch",0));;\
my $xd = (ReadingsVal("PedelecStromkostenGestern","Verbrauch",0));;\
\
my $Gesamt = $a + $e + $i + $m + $q + $u + $z;;\
my $Jahr = $b + $f + $j + $n + $r + $v + $za ;;\
my $Monat = $c + $g + $k + $o + $s + $w + $zb;;\
my $Tag = $d + $h + $l + $p + $t + $x + $zc ;;\
my $Gestern = $aa + $ea + $ia + $ma + $qa + $ua + $zd;;\
\
fhem("setreading StromkostenGesamt Verbrauch $Gesamt");; \
fhem("setreading StromkostenJahr Verbrauch $Jahr");; \
fhem("setreading StromkostenMonat Verbrauch $Monat");; \
fhem("setreading StromkostenTag Verbrauch $Tag");;\
fhem("setreading StromkostenGestern Verbrauch $Gestern");;}
attr atGesamtStromkosten disable 0
attr atGesamtStromkosten room Stromkosten
attr atGesamtStromkosten sortby 09
define atSpuelenStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Spuelen_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Spuelen_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading SpuelenStromkostenGestern Verbrauch $b");;\
fhem("setreading SpuelenStromkostenTag Verbrauch $a");;\
fhem("setreading SpuelenStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading SpuelenStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading SpuelenStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Spuelen_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading SpuelenStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading SpuelenStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading SpuelenStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading SpuelenStromkostenJahr Verbrauch 0")}}
attr atSpuelenStromkosten room Stromkosten
attr atSpuelenStromkosten sortby 04
define SpuelenStromkostenTag dummy
attr SpuelenStromkostenTag group Spuelen-Stromkosten
attr SpuelenStromkostenTag room Stromkosten
attr SpuelenStromkostenTag sortby 04
attr SpuelenStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("SpuelenStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("SpuelenStromkostenTag","Kosten",0))]->[0])}
attr SpuelenStromkostenTag userReadings Kosten {ReadingsVal("SpuelenStromkostenTag","Verbrauch",0)*0.2575}
define SpuelenStromkostenMonat dummy
attr SpuelenStromkostenMonat group Spuelen-Stromkosten
attr SpuelenStromkostenMonat room Stromkosten
attr SpuelenStromkostenMonat sortby 03
attr SpuelenStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("SpuelenStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("SpuelenStromkostenMonat","Kosten",0))]->[0])}
attr SpuelenStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("SpuelenStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("SpuelenStromkostenMonat","Verbrauch",0)*0.2575}
define SpuelenStromkostenJahr dummy
attr SpuelenStromkostenJahr group Spuelen-Stromkosten
attr SpuelenStromkostenJahr room Stromkosten
attr SpuelenStromkostenJahr sortby 02
attr SpuelenStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("SpuelenStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("SpuelenStromkostenJahr","Kosten",0))]->[0])}
attr SpuelenStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("SpuelenStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("SpuelenStromkostenJahr","Verbrauch",0)*0.2575}
define SpuelenStromkostenGesamt dummy
attr SpuelenStromkostenGesamt group Spuelen-Stromkosten
attr SpuelenStromkostenGesamt room Stromkosten
attr SpuelenStromkostenGesamt sortby 01
attr SpuelenStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("SpuelenStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("SpuelenStromkostenGesamt","Kosten",0))]->[0])}
attr SpuelenStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("SpuelenStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("SpuelenStromkostenGesamt","Verbrauch",0)*0.2575}

define AZ_TechnikraumStromkostenGestern dummy
attr AZ_TechnikraumStromkostenGestern group AZ_Technikraum-Stromkosten
attr AZ_TechnikraumStromkostenGestern room Stromkosten
attr AZ_TechnikraumStromkostenGestern sortby 05
attr AZ_TechnikraumStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("AZ_TechnikraumStromkostenGestern","Kosten",0))]->[0])}
attr AZ_TechnikraumStromkostenGestern userReadings Kosten {ReadingsVal("AZ_TechnikraumStromkostenGestern","Verbrauch",0)*0.2575}
define StromkostenGestern dummy
attr StromkostenGestern group Gesamt-Stromkosten
attr StromkostenGestern room Stromkosten
attr StromkostenGestern sortby 05
attr StromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("StromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("StromkostenGestern","Kosten",0))]->[0])}
attr StromkostenGestern userReadings Kosten {ReadingsVal("StromkostenGestern","Verbrauch",0)*0.2575}

define SpuelenStromkostenGestern dummy
attr SpuelenStromkostenGestern group Spuelen-Stromkosten
attr SpuelenStromkostenGestern room Stromkosten
attr SpuelenStromkostenGestern sortby 05
attr SpuelenStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("SpuelenStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("SpuelenStromkostenGestern","Kosten",0))]->[0])}
attr SpuelenStromkostenGestern userReadings Kosten {ReadingsVal("SpuelenStromkostenGestern","Verbrauch",0)*0.2575}
define TrocknenStromkostenGestern dummy
attr TrocknenStromkostenGestern group Trocknen-Stromkosten
attr TrocknenStromkostenGestern room Stromkosten
attr TrocknenStromkostenGestern sortby 05
attr TrocknenStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("TrocknenStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("TrocknenStromkostenGestern","Kosten",0))]->[0])}
attr TrocknenStromkostenGestern userReadings Kosten {ReadingsVal("TrocknenStromkostenGestern","Verbrauch",0)*0.2575}
define WaschenStromkostenGestern dummy
attr WaschenStromkostenGestern group Waschen-Stromkosten
attr WaschenStromkostenGestern room Stromkosten
attr WaschenStromkostenGestern sortby 05
attr WaschenStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WaschenStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WaschenStromkostenGestern","Kosten",0))]->[0])}
attr WaschenStromkostenGestern userReadings Kosten {ReadingsVal("WaschenStromkostenGestern","Verbrauch",0)*0.2575}
define Keller_HeizungStromkostenGestern dummy
attr Keller_HeizungStromkostenGestern group Keller_Heizung-Stromkosten
attr Keller_HeizungStromkostenGestern room Stromkosten
attr Keller_HeizungStromkostenGestern sortby 05
attr Keller_HeizungStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("Keller_HeizungStromkostenGestern","Kosten",0))]->[0])}
attr Keller_HeizungStromkostenGestern userReadings Kosten {ReadingsVal("Keller_HeizungStromkostenGestern","Verbrauch",0)*0.2575}
define KuecheStromkostenGesamt dummy
attr KuecheStromkostenGesamt group Kueche-Stromkosten
attr KuecheStromkostenGesamt room Stromkosten
attr KuecheStromkostenGesamt sortby 01
attr KuecheStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("KuecheStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("KuecheStromkostenGesamt","Kosten",0))]->[0])}
attr KuecheStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("KuecheStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("KuecheStromkostenGesamt","Verbrauch",0)*0.2575}
define KuecheStromkostenJahr dummy
attr KuecheStromkostenJahr group Kueche-Stromkosten
attr KuecheStromkostenJahr room Stromkosten
attr KuecheStromkostenJahr sortby 02
attr KuecheStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("KuecheStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("KuecheStromkostenJahr","Kosten",0))]->[0])}
attr KuecheStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("KuecheStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("KuecheStromkostenJahr","Verbrauch",0)*0.2575}
define KuecheStromkostenMonat dummy
attr KuecheStromkostenMonat group Kueche-Stromkosten
attr KuecheStromkostenMonat room Stromkosten
attr KuecheStromkostenMonat sortby 03
attr KuecheStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("KuecheStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("KuecheStromkostenMonat","Kosten",0))]->[0])}
attr KuecheStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("KuecheStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("KuecheStromkostenMonat","Verbrauch",0)*0.2575}
define KuecheStromkostenTag dummy
attr KuecheStromkostenTag group Kueche-Stromkosten
attr KuecheStromkostenTag room Stromkosten
attr KuecheStromkostenTag sortby 04
attr KuecheStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("KuecheStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("KuecheStromkostenTag","Kosten",0))]->[0])}
attr KuecheStromkostenTag userReadings Kosten {ReadingsVal("KuecheStromkostenTag","Verbrauch",0)*0.2575}
define KuecheStromkostenGestern dummy
attr KuecheStromkostenGestern group Kueche-Stromkosten
attr KuecheStromkostenGestern room Stromkosten
attr KuecheStromkostenGestern sortby 05
attr KuecheStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("KuecheStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("KuecheStromkostenGestern","Kosten",0))]->[0])}
attr KuecheStromkostenGestern userReadings Kosten {ReadingsVal("KuecheStromkostenGestern","Verbrauch",0)*0.2575}
define WohnzimmerStromkostenGesamt dummy
attr WohnzimmerStromkostenGesamt group Wohnzimmer-Stromkosten
attr WohnzimmerStromkostenGesamt room Stromkosten
attr WohnzimmerStromkostenGesamt sortby 01
attr WohnzimmerStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WohnzimmerStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WohnzimmerStromkostenGesamt","Kosten",0))]->[0])}
attr WohnzimmerStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("WohnzimmerStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WohnzimmerStromkostenGesamt","Verbrauch",0)*0.2575}
define WohnzimmerStromkostenJahr dummy
attr WohnzimmerStromkostenJahr group Wohnzimmer-Stromkosten
attr WohnzimmerStromkostenJahr room Stromkosten
attr WohnzimmerStromkostenJahr sortby 02
attr WohnzimmerStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WohnzimmerStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WohnzimmerStromkostenJahr","Kosten",0))]->[0])}
attr WohnzimmerStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("WohnzimmerStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WohnzimmerStromkostenJahr","Verbrauch",0)*0.2575}
define WohnzimmerStromkostenMonat dummy
attr WohnzimmerStromkostenMonat group Wohnzimmer-Stromkosten
attr WohnzimmerStromkostenMonat room Stromkosten
attr WohnzimmerStromkostenMonat sortby 03
attr WohnzimmerStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WohnzimmerStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WohnzimmerStromkostenMonat","Kosten",0))]->[0])}
attr WohnzimmerStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("WohnzimmerStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("WohnzimmerStromkostenMonat","Verbrauch",0)*0.2575}
define WohnzimmerStromkostenTag dummy
attr WohnzimmerStromkostenTag group Wohnzimmer-Stromkosten
attr WohnzimmerStromkostenTag room Stromkosten
attr WohnzimmerStromkostenTag sortby 04
attr WohnzimmerStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WohnzimmerStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WohnzimmerStromkostenTag","Kosten",0))]->[0])}
attr WohnzimmerStromkostenTag userReadings Kosten {ReadingsVal("WohnzimmerStromkostenTag","Verbrauch",0)*0.2575}
define WohnzimmerStromkostenGestern dummy
attr WohnzimmerStromkostenGestern group Wohnzimmer-Stromkosten
attr WohnzimmerStromkostenGestern room Stromkosten
attr WohnzimmerStromkostenGestern sortby 05
attr WohnzimmerStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("WohnzimmerStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("WohnzimmerStromkostenGestern","Kosten",0))]->[0])}
attr WohnzimmerStromkostenGestern userReadings Kosten {ReadingsVal("WohnzimmerStromkostenGestern","Verbrauch",0)*0.2575}
define atKuecheStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Kueche_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Kueche_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading KuecheStromkostenGestern Verbrauch $b");;\
fhem("setreading KuecheStromkostenTag Verbrauch $a");;\
fhem("setreading KuecheStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading KuecheStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading KuecheStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Kueche_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading KuecheStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading KuecheStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading KuecheStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading KuecheStromkostenJahr Verbrauch 0")}}
attr atKuecheStromkosten room Stromkosten
attr atKuecheStromkosten sortby 03
define atWohnzimmerStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Wohnzimmer_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Wohnzimmer_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading WohnzimmerStromkostenGestern Verbrauch $b");;\
fhem("setreading WohnzimmerStromkostenTag Verbrauch $a");;\
fhem("setreading WohnzimmerStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading WohnzimmerStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading WohnzimmerStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Wohnzimmer_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading WohnzimmerStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading WohnzimmerStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading WohnzimmerStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading WohnzimmerStromkostenJahr Verbrauch 0")}}
attr atWohnzimmerStromkosten room Stromkosten
attr atWohnzimmerStromkosten sortby 02
define PedelecStromkostenGesamt dummy
attr PedelecStromkostenGesamt group Pedelec-Stromkosten
attr PedelecStromkostenGesamt room Stromkosten
attr PedelecStromkostenGesamt sortby 01
attr PedelecStromkostenGesamt stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("PedelecStromkostenGesamt","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("PedelecStromkostenGesamt","Kosten",0))]->[0])}
attr PedelecStromkostenGesamt userReadings Verbrauch monotonic \
{ReadingsVal("PedelecStromkostenGesamt","Tagesverbrauch",0)},\
Kosten {ReadingsVal("PedelecStromkostenGesamt","Verbrauch",0)*0.2575}
define PedelecStromkostenJahr dummy
attr PedelecStromkostenJahr group Pedelec-Stromkosten
attr PedelecStromkostenJahr room Stromkosten
attr PedelecStromkostenJahr sortby 02
attr PedelecStromkostenJahr stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("PedelecStromkostenJahr","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("PedelecStromkostenJahr","Kosten",0))]->[0])}
attr PedelecStromkostenJahr userReadings Verbrauch monotonic \
{ReadingsVal("PedelecStromkostenJahr","Tagesverbrauch",0)},\
Kosten {ReadingsVal("PedelecStromkostenJahr","Verbrauch",0)*0.2575}
define PedelecStromkostenMonat dummy
attr PedelecStromkostenMonat group Pedelec-Stromkosten
attr PedelecStromkostenMonat room Stromkosten
attr PedelecStromkostenMonat sortby 03
attr PedelecStromkostenMonat stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("PedelecStromkostenMonat","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("PedelecStromkostenMonat","Kosten",0))]->[0])}
attr PedelecStromkostenMonat userReadings Verbrauch monotonic \
{ReadingsVal("PedelecStromkostenMonat","Tagesverbrauch",0)},\
Kosten {ReadingsVal("PedelecStromkostenMonat","Verbrauch",0)*0.2575}
define PedelecStromkostenTag dummy
attr PedelecStromkostenTag group Pedelec-Stromkosten
attr PedelecStromkostenTag room Stromkosten
attr PedelecStromkostenTag sortby 04
attr PedelecStromkostenTag stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("PedelecStromkostenTag","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("PedelecStromkostenTag","Kosten",0))]->[0])}
attr PedelecStromkostenTag userReadings Kosten {ReadingsVal("PedelecStromkostenTag","Verbrauch",0)*0.2575}
define PedelecStromkostenGestern dummy
attr PedelecStromkostenGestern group Pedelec-Stromkosten
attr PedelecStromkostenGestern room Stromkosten
attr PedelecStromkostenGestern sortby 05
attr PedelecStromkostenGestern stateFormat {sprintf("%.2f kWh - %.2f €",\
[split(" ",ReadingsVal("PedelecStromkostenGestern","Verbrauch",0))]->[0],\
[split(" ",ReadingsVal("PedelecStromkostenGestern","Kosten",0))]->[0])}
attr PedelecStromkostenGestern userReadings Kosten {ReadingsVal("PedelecStromkostenGestern","Verbrauch",0)*0.2575}
define atPedelecStromkosten at +*00:01:00 {\
my $a = (ReadingsVal("Pedelec_Pwr","statEnergyCalcDay",0)/1000);;\
my $b = (ReadingsVal("Pedelec_Pwr","statEnergyCalcDayLast",0)/1000);;\
\
fhem("setreading PedelecStromkostenGestern Verbrauch $b");;\
fhem("setreading PedelecStromkostenTag Verbrauch $a");;\
fhem("setreading PedelecStromkostenMonat Tagesverbrauch $a");;\
fhem("setreading PedelecStromkostenJahr Tagesverbrauch $a");;\
fhem("setreading PedelecStromkostenGesamt Tagesverbrauch $a");;\
\
if(($hour==0) && ($min==0)){\
fhem("set myStatDevice resetStatistics Pedelec_Pwr")}\
\
if(($hour==23) && ($min==59)){\
fhem("setreading PedelecStromkostenGestern Verbrauch 0")}\
\
if(($hour==0) && ($min==0)){\
fhem("setreading PedelecStromkostenTag Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($mday==1)){\
fhem("setreading PedelecStromkostenMonat Verbrauch 0")}\
\
if(($hour==0) && ($min==0) && ($yday==1)){\
fhem("setreading PedelecStromkostenJahr Verbrauch 0")}}
attr atPedelecStromkosten room Stromkosten
attr atPedelecStromkosten sortby 08
define FileLog_Keller_Heizung_Sw FileLog ./log/Keller_Heizung_Sw-%Y-%m.log Keller_Heizung_Sw
define EnergyPowerUpAction notify Keller_Heizung_Sw.on set YogaSwitch on;; set Steckdose_Drucker on;; set HeinzMobil send *Netzspannung wieder vorhanden!*
attr EnergyPowerUpAction alias EnergyPowerUpAction > Yoga Tablet & Drucker - FS20 einschalten
attr EnergyPowerUpAction group 1_Yoga
attr EnergyPowerUpAction icon message_socket_disabled
attr EnergyPowerUpAction room IT_Equipment
define atResetStromVerbrauch at *23:00:00 {\
fhem("sleep 3;; set myStatDevice resetStatistics .*_Pwr");;\
fhem("sleep 3;; deletereading .*_Pwr statEnergy.*");;\
fhem("sleep 3;; setreading .*Stromkosten.* Verbrauch 0");;\
fhem("sleep 3;; set myStatDevice doStatistics")\
}
attr atResetStromVerbrauch comment define execResetStromVerbrauch at 2017-07-31T23:59:00 set atResetStromVerbrauch execNow\
attr execResetStromVerbrauch room Stromkosten\
attr execResetStromVerbrauch sortby 11
attr atResetStromVerbrauch disable 1
attr atResetStromVerbrauch room Stromkosten
attr atResetStromVerbrauch sortby 10
define CUL_2 CUL /dev/ttyACM2@9600 1234
##------- Ende

CoolTux

Da kann ich leider rein gar nichts erkennen. Sorry. Besser wäre ein list oder wenigstens ein  Raw definition
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Beta-User

Wie kommen denn aktualisierte Werte auf den PI?

Ich kann nur eine ganze Menge dummy-Devices erkennen, die irgendwie mit berechneten Werten gefüllt werden.

FHEM2FHEM? (Vermute da die Ursachen)
GPIOs?
Arducounter?
...

Gruß, Beta-User
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

heinzfo

#7
Habe keines der vermuteten  module laufen.

Weil ...Sromkosten immer mit höheren Werten auftaucht hatte ich das vermutet.
Und auch noch CUL_1 der liest die HM Stromzähler aus.

apptime ergibt folgendes ergebniss:

name                  function              max  count    total  average maxDly TS Max call     param Max call
CUL_1                 CUL_Read             1713     19    10536   554.53      0 12.10. 12:01:32 HASH(CUL_1)
tmr-at_Exec           HASH(0x4dc0930)      1219      2     2434  1217.00   5930 12.10. 12:01:30 HASH(atPedelecStromkosten)
tmr-at_Exec           HASH(0x4dbc938)      1171      2     2249  1124.50   3012 12.10. 12:01:27 HASH(atGesamtStromkosten)
tmr-at_Exec           HASH(0x4dbfa10)      1164      2     1651   825.50   5514 12.10. 12:02:28 HASH(atWohnzimmerStromkosten)
tmr-at_Exec           HASH(0x4dba7f8)      1086      2     1722   861.00   1068 12.10. 12:01:24 HASH(atAZ_TechnikraumStromkosten)
tmr-at_Exec           HASH(0x4dbf1b0)      1083      2     1583   791.50   4444 12.10. 12:01:28 HASH(atKuecheStromkosten)
tmr-at_Exec           HASH(0x4dbba78)      1072      2     1722   861.00   2027 12.10. 12:01:26 HASH(atKeller_HeizungStromkosten)
tmr-at_Exec           HASH(0x4d5ff50)       683      2     1322   661.00     22 12.10. 12:02:23 HASH(atWaschenStromkosten)
tmr-at_Exec           HASH(0x4dbc818)       495      2      988   494.00   4167 12.10. 12:02:26 HASH(atSpuelenStromkosten)
tmr-at_Exec           HASH(0x4db9c08)       489      2      977   488.50    657 12.10. 12:02:23 HASH(atTrocknenStromkosten)
tmr-at_Exec           HASH(0x40647a8)       445     10     2487   248.70   5838 12.10. 12:01:16 HASH(HerdNotAus)
tmr-Astro_Update      HASH(0x4c050b0)       406      2      784   392.00    325 12.10. 12:01:49 HASH(AstroNbg)
PedelecWattSet        notify_Exec           395      1      395   395.00      0 12.10. 12:01:31 HASH(PedelecWattSet); HASH(Pedelec_Pwr)
tmr-SYSMON_Update     HASH(0x4062798)       272      2      507   253.50    187 12.10. 12:02:48 HASH(RPiSysmon)
HeizungWohnen         structure_Notify      265    233      553     2.37      0 12.10. 12:02:08 HASH(HeizungWohnen); HASH(HeizungWz_Climate)
myStatDevice          statistics_Notify     262    233     1243     5.33      0 12.10. 12:01:40 HASH(myStatDevice); HASH(Waschen_Pwr)
WEB                   FW_Read               258     55     6317   114.85      0 12.10. 12:01:48 HASH(WEB)
gcmheinz              gcmsend_notify        258    233    17890    76.78      0 12.10. 12:02:44 HASH(gcmheinz); HASH(Winconnect_Laptop)
TrocknenWattSet       notify_Exec           204      1      204   204.00      0 12.10. 12:02:11 HASH(TrocknenWattSet); HASH(Trocknen_Pwr)
WaschenWattSet        notify_Exec           203      1      203   203.00      0 12.10. 12:01:41 HASH(WaschenWattSet); HASH(Waschen_Pwr)
TrocknenWatt          dummy_Set             194      1      194   194.00      0 12.10. 12:02:11 HASH(TrocknenWatt); TrocknenWatt;


nochmal apptime

name                             function                 max  count    total  average  maxDly   TS Max   call       param Max call
CUL_1                            CUL_Read                2697    286   198713   694.80       0   12.10.   12:04:07   HASH(CUL_1)
tmr-Calendar_PollChild           HASH(0x4b85f68)         2191      2     4353  2176.50      13   12.10.   12:04:22   HASH(GoogleKalenderHeinz)
tmr-at_Exec                      HASH(0x4dc0930)         1341     32    39340  1229.38    7940   12.10.   12:04:30   HASH(atPedelecStromkosten)
tmr-at_Exec                      HASH(0x4dbf1b0)         1212     32    24773   774.16    6302   12.10.   12:23:30   HASH(atKuecheStromkosten)
tmr-at_Exec                      HASH(0x4dbc938)         1196     32    33841  1057.53    4887   12.10.   12:24:26   HASH(atGesamtStromkosten)
tmr-at_Exec                      HASH(0x4dba7f8)         1179     32    25602   800.06    2804   12.10.   12:26:24   HASH(atAZ_TechnikraumStromkosten)
GoogleKalenderHeinzView          CALVIEW_Notify          1173   3980     2375     0.60       0   12.10.   12:04:22   HASH(GoogleKalenderHeinzView); HASH(GoogleKalenderHeinz)
tmr-at_Exec                      HASH(0x4dbfa10)         1164     32    23484   733.88    7501   12.10.   12:02:28   HASH(atWohnzimmerStromkosten)
tmr-PRESENCE_StartLocalScan      HASH(0x374fb20)         1160     31     3287   106.03    4768   12.10.   12:03:49   HASH(FeinstaubSensor_Ost)
tmr-at_Exec                      HASH(0x4db9c08)         1143     32    21634   676.06    1996   12.10.   12:23:25   HASH(atTrocknenStromkosten)
tmr-at_Exec                      HASH(0x4dbba78)         1132     32    26842   838.81    3854   12.10.   12:05:26   HASH(atKeller_HeizungStromkosten)
tmr-PRESENCE_StartLocalScan      HASH(0x3741cb0)         1086     31     3136   101.16    1756   12.10.   12:03:46   HASH(HamaIR110)
tmr-PRESENCE_StartLocalScan      HASH(0x369d4a0)         1074     31     2688    86.71    3714   12.10.   12:03:48   HASH(S4Gabi)
tmr-PRESENCE_StartLocalScan      HASH(0x36e6d88)          978     31     3023    97.52    2928   12.10.   12:03:47   HASH(TechniSat)
tmr-Astro_Update                 HASH(0x4c050b0)          907     31    19563   631.06    1117   12.10.   12:03:51   HASH(AstroNbg)
tmr-PRESENCE_StartLocalScan      HASH(0x3719180)          683     31     2070    66.77    1156   12.10.   12:03:44   HASH(Synology)
tmr-at_Exec                      HASH(0x4d5ff50)          683     32    17197   537.41    1445   12.10.   12:02:23   HASH(atWaschenStromkosten)
tmr-PRESENCE_StartLocalScan      HASH(0x364b080)          649     31     1990    64.19     691   12.10.   12:03:43   HASH(S4Heinz)
myStatDevice                     statistics_Notify        613   3980    36484     9.17       0   12.10.   12:04:16   HASH(myStatDevice); HASH(MySpeedtest)
PedelecWattSet                   notify_Exec              563     13     5448   419.08       0   12.10.   12:04:06   HASH(PedelecWattSet); HASH(Pedelec_Pwr)
tmr-at_Exec                      HASH(0x4dbc818)          507     32    15721   491.28    6011   12.10.   12:23:29   HASH(atSpuelenStromkosten)

CoolTux

So ich habe das jetzt mal zerlegt.
Jede Minute rufst Du 8 "Funktionen" auf die Berechnungen machen. Und zwar gleichzeitig. Das ist ganz schön heftig.
Eigentlich geht es Dir doch um Statistiken, Stunde, Tag Woche Monat Jahr. Warum nimmst Du nicht das Statistics Modul


https://fhem.de/commandref_DE.html#statistics
https://wiki.fhem.de/wiki/Statistics
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hollo

Für Tages-/Wochen-/Monats-/Jahres-Berechung sind natürlich minutengenaue Werte erforderlich.  ::)

Dafür würden doch auch stündliche Abfragen reichen.
Oder Du loggst in Deinem Wunschintervall die Werte und berechnest die anderen Dinge 1x täglich nacheinander.
Das statistics-Modul soll da klasse sein, hab ich aber noch nicht probiert.
FHEM 6.x auf RPi 3B Buster
Protokolle: Homematic, Z-Wave, MQTT, Modbus
Temp/Feuchte: JeeLink-Clone und LGW mit LaCrosse/IT
sonstiges: Linux-Server, Dreambox, "RSS-Tablet"

heinzfo

#10
Ich bin jetzt auf einen RPi3 und raspian Stretch umgestiegen.
Geht alles schön schnell, vor allem der Seitenaufbau und SVG, ein deutlicher unterschied zum RPi2 :-)

Ich beobachte mit TOP und sehe das root und fhem immer 99-100% CPU last zeigen  :o

Mit sudo /etc/init.d/fhem stop habe ich fhem gestoppt und
mit sudo /etc/init.d/fhem status kommt die Ausgabe fhem is not running

Aber TOP zeigt immer noch diese hohe root und fhem CPU Last, wie kann das sein?  ::)

Habe noch mal apptime laufen lassen, da schaut doch normal aus, oder?
name                                     function                               max  count    total  average maxDly TS Max call     param Max call
WEBphone                                 FW_Read                                428      9     1146   127.33      0 19.10. 20:39:04 HASH(WEBphone)
CUL_0                                    CUL_Read                               323      1      323   323.00      0 19.10. 20:38:46 HASH(CUL_0)
CUL_2                                    CUL_Read                               148     17      964    56.71      0 19.10. 20:38:52 HASH(CUL_2)
tmr-at_Exec                              HASH(0x470cf48)                        110      2      189    94.50    367 19.10. 20:38:16 HASH(atKuecheStromkosten)
WEB                                      FW_Read                                 94    110     6282    57.11      0 19.10. 20:38:17 HASH(WEB)
WEB_192.168.178.36_56512                 FW_Read                                 92      3      154    51.33      0 19.10. 20:39:04 HASH(WEB_192.168.178.36_56512)
tmr-at_Exec                              HASH(0x4639dd0)                         78      2      151    75.50    130 19.10. 20:39:15 HASH(atAZ_TechnikraumStromkosten)
tmr-at_Exec                              HASH(0x46e9e70)                         78      2      152    76.00    248 19.10. 20:39:16 HASH(atGesamtStromkosten)
tmr-at_Exec                              HASH(0x46df400)                         77      2      150    75.00    189 19.10. 20:39:15 HASH(atKeller_HeizungStromkosten)
tmr-at_Exec                              HASH(0x470ce88)                         77      2      150    75.00    447 19.10. 20:39:16 HASH(atWohnzimmerStromkosten)
tmr-at_Exec                              HASH(0x46a6c80)                         76      2      148    74.00      2 19.10. 20:39:15 HASH(atWaschenStromkosten)
tmr-at_Exec                              HASH(0x46a8aa8)                         76      2      148    74.00     72 19.10. 20:39:15 HASH(atTrocknenStromkosten)
tmr-at_Exec                              HASH(0x46ea230)                         76      2      148    74.00    323 19.10. 20:39:16 HASH(atSpuelenStromkosten)
tmr-at_Exec                              HASH(0x4714058)                         76      2      148    74.00    507 19.10. 20:39:16 HASH(atPedelecStromkosten)
WEBphone_87.148.40.45_48524              FW_Read                                 73      1       73    73.00      0 19.10. 20:39:04 HASH(WEBphone_87.148.40.45_48524)
tmr-Astro_Update                         HASH(0x455b908)                         56      2      109    54.50      2 19.10. 20:39:15 HASH(AstroNbg)
tmr-WINCONNECT_GetStatus                 HASH(0x472f420)                         47      2       49    24.50     17 19.10. 20:38:17 HASH(Winconnect_Desktop)
tmr-at_Exec                              HASH(0x3d652d0)                         47      8      139    17.38     13 19.10. 20:38:33 HASH(HerdNotAus)
WEBphone_87.148.40.45_48526              FW_Read                                 43      1       43    43.00      0 19.10. 20:39:05 HASH(WEBphone_87.148.40.45_48526)
WEBphone_87.148.40.45_48527              FW_Read                                 43      1       43    43.00      0 19.10. 20:39:05 HASH(WEBphone_87.148.40.45_48527)
WEBphone_87.148.40.45_48523              FW_Read                                 42      2       51    25.50      0 19.10. 20:39:05 HASH(WEBphone_87.148.40.45_48523)


Beste Grüße
Heinz

Hollo

Welche Antwort erwartest Du jetzt?

Du hast statt Ursachenforschung und Vorschlagsumsetzung die Rechenleistung erhöht.
Damit wird es etwas besser, löst aber nicht das grundsätzliche Problem.
Außerdem bringt es neue "Probleme" bzw. Veränderungen ins Spiel; aus Deinem CUL_1 scheint ja jetzt CUL_0 und CUL_2 geworden zu sein?

Wenn Du stretch frisch aufgesetzt hast, ist da standardmäßig nix mit /etc/init.d.
Hast Du mal das Intervall Deiner Funktionsaufrufe verringert, um Unterschiede erkennen zu können?
FHEM 6.x auf RPi 3B Buster
Protokolle: Homematic, Z-Wave, MQTT, Modbus
Temp/Feuchte: JeeLink-Clone und LGW mit LaCrosse/IT
sonstiges: Linux-Server, Dreambox, "RSS-Tablet"

heinzfo

Hallo Hollo

Der Umstieg Jessie zu Stretch ist noch auf dem RPi2 erfolgt.
Mit dem RPi2 und Stretch sehe ich die hohe CPU Last nicht mehr, und eher selten für eine Sekunde fhem mit 75%.
Die beschriebenen Verzögerungen habe ich nicht mehr.

Dann zum RPi3 gewechsel und die hohe CPU Last gesehen.

Heute Morgen habe ich mit dem RPi3 dann noch mal update, dist-upgrade und reboot durchgeführt.
Mit top fhem CPU ab und an 25%, nach stop von fhem ist es auch mit top nicht mehr zu sehen.

Warum das so war?

Danke und Grüße
Heinz