Hauptmenü

doif auf cmd triggern

Begonnen von satprofi, 21 August 2017, 08:33:52

Vorheriges Thema - Nächstes Thema

satprofi

hallo. ist es möglich doif auf eigenen status abzufragen und diesen in neues doelseif zu verknüpfen?



Gesendet von meinem ONEPLUS A5000 mit Tapatalk

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

Per

#1
Ja, ist es. Musst nur aufpassen, ob du es triggernd (attr selftrigger) oder nur lesend ([?$SELF:cmd]) haben möchtest.

satprofi

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

satprofi

#3
Hallo.
habe folgendes jetzt

define Ladestrom DOIF ((([Ueberschuss] >1400 and [Lader] eq "on" and [Wert_I:A] !=25) or (([Ueberschuss] >10 and [Ueberschuss] <2500) 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 ([Ladestrom:state] eq "cmd_1" [Ueberschuss] <0) ("python2 /usr/local/bin/22Amp.py")
DOELSEIF ([Ladestrom:state] eq "cmd_1" [Ueberschuss] <0) ("python2 /usr/local/bin/20Amp.py")
DOELSEIF ([Ladestrom] eq "cmd_3" [Ueberschuss] <0) ("python2 /usr/local/bin/18Amp.py")
DOELSE


aber in den "Probably associated with" scheint das eigene DOIF nicht auf.
Vorhaben: Wenn bei cmd_1 der Ueberschuss unter 0 fällt, soll auf cmd_2 geswitcht werden, wenn auf cmd_2 auch der wert unter 0 ist auf cmd_3.

klappt das überhaupt so?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

Brockmann

Zitat von: satprofi am 21 August 2017, 16:36:37
aber in den "Probably associated with" scheint das eigene DOIF nicht auf.
Warum sollte es? Das wäre ungefähr so sinnvoll wie die Aussage, dass Du zu den Menschen gehörst, die Du kennst.

Zitat von: satprofi am 21 August 2017, 16:36:37
klappt das überhaupt so?
Eher nicht. Zwischen "cmd_..." und [Ueberschuss] muss jeweils ein and.
Und in der zweiten dieser Zeile sollte es vermutlich "cmd_2" heißen?

Ansonsten: Das DOELSE am Ende ist ein Kandidat für unerwünschte Nebeneffekte. Ist es wirklich nötig?

satprofi

Hallo.
danke für den Hinweis, irgendwann sieht man den Wald vor lauter Bäume nicht mehr.
Es klappt, und ich habe es dahingehend abgeändert:


DOELSEIF ([Ueberschuss] >500 and [Lader] eq "on" and [Wert_I:A] !=8) ("python2 /usr/local/bin/8Amp.py")
DOELSEIF ([Ueberschuss] >400 and [Lader] eq "on" and [Wert_I:A] !=6) ("python2 /usr/local/bin/6Amp.py")
DOELSEIF ([Ueberschuss] >300 and [Lader] eq "on" and [Wert_I:A] !=4) ("python2 /usr/local/bin/4Amp.py")
DOELSEIF (([Ueberschuss] >200 and [Lader] eq "on" and [Wert_I:A] >2.5) or ([Lader] eq "off" and [Wert_I:A] >2)) ("python2 /usr/local/bin/2Amp.py")
DOELSEIF ([Ladestrom:state] eq "cmd_1" and [Ueberschuss] <0) ("python2 /usr/local/bin/6Amp.py")
DOELSEIF (([Ladestrom:state] eq "cmd_2" or [Ladestrom:state] eq "cmd_6") and [Ueberschuss] <0) ("python2 /usr/local/bin/4Amp.py")
DOELSEIF (([Ladestrom:state] eq "cmd_3" or [Ladestrom:state] eq "cmd_7") and [Ueberschuss] <0) ("python2 /usr/local/bin/2Amp.py")


jetzt startet das Spiel bei mehr als 500W, wenn jetzt der Uberschuss unter 0 fällt triggert cmd_1, wenn es weiterhin unter 0 bleibt triggert cmd_6, und so weiter.

damit ist auch mein weiterer thread erledigt
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

so, habe es noch vereinfacht

DOELSEIF ([Ueberschuss] >500 and [Lader] eq "on" and [Wert_I:A] !=8) ("python2 /usr/local/bin/8Amp.py")
DOELSEIF ([Ueberschuss] >400 and [Lader] eq "on" and [Wert_I:A] !=6) ("python2 /usr/local/bin/6Amp.py")
DOELSEIF ([Ueberschuss] >300 and [Lader] eq "on" and [Wert_I:A] !=4) ("python2 /usr/local/bin/4Amp.py")
DOELSEIF (([Ueberschuss] >200 and [Lader] eq "on" and [Wert_I:A] >2.5) or ([Lader] eq "off" and [Wert_I:A] >2)) ("python2 /usr/local/bin/2Amp.py")
DOELSEIF ([Ladestrom:state] eq "8A" and [Ueberschuss] <0) ("python2 /usr/local/bin/6Amp.py")
DOELSEIF ([Ladestrom:state] eq "6A" and [Ueberschuss] <0) ("python2 /usr/local/bin/4Amp.py")
DOELSEIF ([Ladestrom:state] eq "4A" and [Ueberschuss] <0) ("python2 /usr/local/bin/2Amp.py")


Man muss cmdState auf attr cmdState 8A|6A|4A|2A setzen
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram