[gelöst] Hilfestellung zu komplizierter Logik

Begonnen von satprofi, 20 August 2017, 12:24:50

Vorheriges Thema - Nächstes Thema

satprofi

Hallo.
Ich möchte meine PV zum laden der Batterie folgendermassen steuern, was auch so teilweise klappt:

([Ueberschuss] >1000 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/20Amp.py&');;})
DOELSEIF ([Ueberschuss] >900 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/18Amp.py&');;})
DOELSEIF ([Ueberschuss] >800 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/16Amp.py&');;})
DOELSEIF ([Ueberschuss] >700 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/14Amp.py&');;})
DOELSEIF ([Ueberschuss] >600 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/12Amp.py&');;})
DOELSEIF ([Ueberschuss] >500 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/10Amp.py&');;})
DOELSEIF ([Ueberschuss] >400 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/8Amp.py&');;})
DOELSEIF ([Ueberschuss] >300 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/6Amp.py&');;})
DOELSEIF ([Ueberschuss] >200 and [Lader] eq "on" and ($mday!=28)) ({system('python2 /usr/local/bin/4Amp.py&');;})
DOELSEIF (([Ueberschuss] >100 and [Lader] eq "on" and ($mday!=28)) or ([Lader] eq "off")) ({system('python2 /usr/local/bin/2Amp.py&');;})


Hier werden bei überschreiten vom Wert Überschuss der ladestrom angesteuert. Wenn ich jetzt 1100W überschuss habe, startet cmd1. Aber jetzt kommt das komplizierte. Die Ladung drückt mir den Überschuss auf 100, was DOIF mit dem cmd10 quittiert. Dadurch steigt der Überschuss wieder auf 1100, und das spiel beginnt von vorne. Wie schaffe ich es , das cmd1 erst dann gestoppt wird wenn der über schuss -1 fällt, die ladung stoppt, dadurch ein neuer wert von z.B. 500 errechnet wird und DOIF mit cmd 6 startet.
Der Lader wird mit extra DOIF gesteuert

([Ueberschuss] >100) (set Lader on)
DOELSEIF (($mday!=28 and [Ueberschuss] <1)) (set Lader off)


zusätzlich frage ich auch den Ladestrom ab, vielleicht sollte man den zusätzlich verknüpfen.

LG
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

Ich glaube der Lösung schon nahe zu sein.


((([Ueberschuss] >1000 and [Lader] eq "on") or ([Ueberschuss] <1000 and [Xtender_Batt_A] >20)) and ($mday!=28)) ("python2 /usr/local/bin/25Amp.py")


Jetzt startet das Ding bei Überschuss ab 1000W, wenn der Überschuss auf unter 1000 fällt, der Strom aber höher 20A ist , tut sich nichts.
Erst wenn der Überschuss ins minus fällt wird der Lader gestoppt, und das Spiel beginnt von neuem.
Ist zwar noch nicht optimal, aber dürfte so mal klappen.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

Per

Du kannst deinen Off-Zweig ganz nach oben stellen und in die On-Zweige ein OR [Ladestrom]>XY einfügen.

satprofi

Aha, danke. werds mir durchdenken.
habe es jetzt vorläufig so

([06:00-18:00] and (($month >10 or $month <3) and ($mday==28))) ("python2 /usr/local/bin/20Amp.py")
DOELSEIF ((([Ueberschuss] >1400 and [Lader] eq "on" and [Wert_I:A] !=25) or (([Ueberschuss] >10 and [Ueberschuss] <1500) and [Xtender_Batt_A] >24))) ("python2 /usr/local/bin/25Amp.py")
DOELSEIF ((([Ueberschuss] >1200 and [Lader] eq "on" and [Wert_I:A] !=22) or (([Ueberschuss] >10 and [Ueberschuss] <1500) and [Xtender_Batt_A] >22))) ("python2 /usr/local/bin/22Amp.py")
DOELSEIF ((([Ueberschuss] >1100 and [Lader] eq "on" and [Wert_I:A] !=20) or (([Ueberschuss] >10 and [Ueberschuss] <1500) and [Xtender_Batt_A] >20))) ("python2 /usr/local/bin/20Amp.py")
DOELSEIF ((([Ueberschuss] >1000 and [Lader] eq "on" and [Wert_I:A] !=18) or (([Ueberschuss] >10 and [Ueberschuss] <1500) and [Xtender_Batt_A] >18))) ("python2 /usr/local/bin/18Amp.py")
...
...
...
DOELSE

gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram