nachdem das Script so schön funktioniert hat, hab ich es für den zweiten Zähler erweitert:
Code
>D
sw=0
eg_gesamt=0
eg_ht=1825219
eg_nt=892708
og_gesamt=0
og_ht=578166
og_nt=240565
>B
->sensor53 r
spinm(14 P)
eg_gesamt=eg_ht+eg_nt
=>sensor53 c1 %eg_gesamt%
og_gesamt=og_ht+og_nt
=>sensor53 c2 %og_gesamt%
>W
bu(sw "HT" "NT")
EG HT Counts: {m} %eg_ht%
EG NT Counts: {m} %eg_nt%
==============================
OG HT Counts: {m} %og_ht%
OG NT Counts: {m} %og_nt%
>M 2
+1,5,c,0,100,EG
+2,4,c,0,100,OG
1,1-0:1.8.0*255(@1,Umdrehungen,,eg_counts,0
1,1-0:1.8.0*255(@75,Verbrauch,KWh,eg_verbrauch,2
1,=h==============================
2,1-0:1.8.0*255(@1,Umdrehungen,,og_counts,0
2,1-0:1.8.0*255(@75,Verbrauch,KWh,og_verbrauch,2
2,=h==============================
#
>T
eg_gesamt=EG#eg_counts
og_gesamt=OG#og_counts
>F
;Pin durch den HT oder NT definiert wird
sw=pin[14]
if chg[eg_gesamt]>0 {
;HT
if sw==1 {
eg_ht=eg_gesamt-eg_nt
print EG HT: %eg_ht%
}
else {
; NT
eg_nt=eg_gesamt-eg_ht
print EG NT: %eg_nt%
}
if chg[og_gesamt]>0 {
;HT
if sw==1 {
og_ht=og_gesamt-og_nt
print OG HT: %og_ht%
}
else {
; NT
og_nt=og_gesamt-og_ht
print OG NT: %og_nt%
}
Alles anzeigen
Sollte so doch passen.
Problem ist jetzt aber: "EG" funktioniert problemlos, "OG" aber nicht.
og_ht und og_nt updaten nicht wenn og_gesamt sich ändert. In der Konsole wird auch nichts von "OG HT:..." angezeigt.
ABER: Wenn ich sensor53 c2 in die Konsole eingebe -> zack, og_ht updated sich auf die richtige Zahl!
Bug?
Ich verzweifel noch daran