DOIF Fenterkontakt Rollosteuerung last state

Begonnen von skuggy, 28 November 2015, 12:08:34

Vorheriges Thema - Nächstes Thema

skuggy

Hallo zusammen,

ich hab dieses Beispiel kopiert und es funktioniert bei einem Fenster. http://forum.fhem.de/index.php/topic,42619.msg350114.html#msg350114

Mein Problem ist, ich habe 2 Fenster im Bad aber nur einen Fenstersensor. Ich habe versucht das o.a. Beispiel anzupassen, leider komme ich nicht weiter. Anbei der Code und das List vom DOIF.

([Bad.Rollo.links] eq "runter" and [Bad.Fensterkontakt] eq "open") (setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on) DOELSEIF ([Bad.Rollo.links] <= 80 and [Bad.Fensterkontakt] eq "open") (setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on) DOELSEIF ([Bad.Rollo.links:last_state] eq "runter" and [Bad.Fensterkontakt] eq "closed") (set Bad.Rollo.links [Bad.Rollo.links:last_state], set Bad.Rollo.rechts [Bad.Rollo.rechts:last_state]) DOELSEIF ([Bad.Rollo.links:last_state] <=100 and [Bad.Fensterkontakt] eq "closed") (set Bad.Rollo.links [Bad.Rollo.links:last_state], set Bad.Rollo.rechts [Bad.Rollo.rechts:last_state])

Internals:
   CFGFN
   DEF        ([Bad.Rollo.links] eq "runter" and [Bad.Fensterkontakt] eq "open") (setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on) DOELSEIF ([Bad.Rollo.links] <= 80 and [Bad.Fensterkontakt] eq "open") (setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on) DOELSEIF ([Bad.Rollo.links eq "runter" and [Bad.Fensterkontakt] eq "closed") (set Bad.Rollo.links [Bad.Rollo.links set Bad.Rollo.rechts [Bad.Rollo.rechts DOELSEIF ([Bad.Rollo.links <=100 and [Bad.Fensterkontakt] eq "closed") (set Bad.Rollo.links [Bad.Rollo.links set Bad.Rollo.rechts [Bad.Rollo.rechts
   NAME       RolloFensterBad
   NR         6435
   NTFY_ORDER 50-RolloFensterBad
   STATE      cmd_4
   TYPE       DOIF
   Readings:
     2015-11-28 11   Device          Bad.Rollo.links
     2015-11-28 11   cmd_event       Bad.Rollo.links
     2015-11-28 11   cmd_nr          4
     2015-11-28 11   e_Bad.Rollo.links_STATE 1.5
     2015-11-28 11   e_Bad.Rollo.links_last_state 1.5
     2015-11-28 11   error            set Bad.Rollo.rechts set_on set Bad.Rollo.links on: Unknown argument set_on, choose one of assignHmKey clear deviceRename down fwUpdate getConfig getDevInfo getRegRaw getSerial getVersion inhibit off on pair pct peerBulk peerIODev press raw regBulk regSet reset sign statusRequest stop toggle toggleDir unpair up
     2015-11-28 11   state           cmd_4
   Condition:
     0          InternalDoIf('Bad.Rollo.links','STATE','') eq "runter" and InternalDoIf('Bad.Fensterkontakt','STATE','') eq "open"
     1          InternalDoIf('Bad.Rollo.links','STATE','') <= 80 and InternalDoIf('Bad.Fensterkontakt','STATE','') eq "open"
     2          ReadingValDoIf('Bad.Rollo.links','last_state','') eq "runter" and InternalDoIf('Bad.Fensterkontakt','STATE','') eq "closed"
     3          ReadingValDoIf('Bad.Rollo.links','last_state','') <=100 and InternalDoIf('Bad.Fensterkontakt','STATE','') eq "closed"
   Devices:
     0           Bad.Rollo.links Bad.Fensterkontakt
     1           Bad.Rollo.links Bad.Fensterkontakt
     2           Bad.Rollo.links Bad.Fensterkontakt
     3           Bad.Rollo.links Bad.Fensterkontakt
     all         Bad.Rollo.links Bad.Fensterkontakt
   Do:
     0:
       0          setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on
     1:
       0          setreading Bad.Rollo.links last_state [Bad.Rollo.links], setreading Bad.Rollo.rechts last_state [Bad.Rollo.rechts], set Bad.Rollo.links on, set Bad.Rollo.rechts on
     2:
       0          set Bad.Rollo.links [Bad.Rollo.links set Bad.Rollo.rechts [Bad.Rollo.rechts
     3:
       0          set Bad.Rollo.links [Bad.Rollo.links set Bad.Rollo.rechts [Bad.Rollo.rechts
   Helper:
     globalinit 1
     last_timer 0
     sleeptimer -1
   Internals:
     0           Bad.Rollo.links Bad.Fensterkontakt
     1           Bad.Rollo.links Bad.Fensterkontakt
     2           Bad.Fensterkontakt
     3           Bad.Fensterkontakt
     all         Bad.Rollo.links Bad.Fensterkontakt
   Itimer:
   Readings:
     2           Bad.Rollo.links
     3           Bad.Rollo.links
     all         Bad.Rollo.links
   State:
   Timerfunc:
   Trigger:
Attributes:
   room       Bad


Vielen Dank für die Hilfe
...Gruß skuggy

FHEM 5.6 auf Raspberry Pi 2, HM-CFG-LAN, 8x HM-LC-Bl1PBU-FM, 5 x HM-CC-RT-DN, 1 x HM-LC-Sw1-Ba-PCB, 1 x HM-RC-4-2, 1 x JeeLink Clone, 10 x TX29DTH-IT, Fritzbox 7270

Ellert

Hast Du Dir die Fehlermeldung angesehen?
Zitat2015-11-28 11   error            set Bad.Rollo.rechts set_on set Bad.Rollo.links on: Unknown argument set_on, choose one of assignHmKey clear deviceRename down fwUpdate getConfig getDevInfo getRegRaw getSerial getVersion inhibit off on pair pct peerBulk peerIODev press raw regBulk regSet reset sign statusRequest stop toggle toggleDir unpair up
Dort steht
ZitatUnknown argument set_on
. Es werden nur diese Argumente
ZitatassignHmKey clear deviceRename down fwUpdate getConfig getDevInfo getRegRaw getSerial getVersion inhibit off on pair pct peerBulk peerIODev press raw regBulk regSet reset sign statusRequest stop toggle toggleDir unpair up
verarbeitet. set_on ist ein Zwischenzustand, in der deutschen Commandref steht dazu
ZitatBei Devices, die mit Zwischenzuständen arbeiten, insbesondere HM-Komponenten (Zwischenzustand: set_on, set_off), sollte die Definition möglichst genau formuliert werden, um unerwünschte Effekte zu vermeiden
. Ich vermute last_state ist deshalb problematisch, weil der Zustand set_on immer dem Zustand on vorausgeht.

Damian

Zitat von: Ellert am 28 November 2015, 19:35:43
Hast Du Dir die Fehlermeldung angesehen?  Dort steht . Es werden nur diese Argumente  verarbeitet. set_on ist ein Zwischenzustand, in der deutschen Commandref steht dazu . Ich vermute last_state ist deshalb problematisch, weil der Zustand set_on immer dem Zustand on vorausgeht.


Ja. Das wird das Problem sein. Evtl. statt auf "runter" auf "on" explizit abfragen. Die Zwischenzustände bei HM sind immer komplizierter zu handhaben.


Gruß

Damian
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

skuggy

Zitat von: Damian am 28 November 2015, 20:22:17

Ja. Das wird das Problem sein. Evtl. statt auf "runter" auf "on" explizit abfragen. Die Zwischenzustände bei HM sind immer komplizierter zu handhaben.


Gruß

Damian

Vielen Dank für eure Hilfe, hab statt runter off genommen und es funktioniert.

...Gruß skuggy

FHEM 5.6 auf Raspberry Pi 2, HM-CFG-LAN, 8x HM-LC-Bl1PBU-FM, 5 x HM-CC-RT-DN, 1 x HM-LC-Sw1-Ba-PCB, 1 x HM-RC-4-2, 1 x JeeLink Clone, 10 x TX29DTH-IT, Fritzbox 7270

skuggy

Hallo zusammen,

ich muss meinen alten Beitrag noch mal rauskramen...

Das DOIF macht erstmal was es soll. Leider kommt jetzt wieder die dunkle Jahreszeit.

Die Rollo´s werden mit Sonnenuntergang runtergefahren, leider kommt es immer wieder vor, dass das Rollo noch oben ist weil das Bad lüftet. Dann wird das Rollo runterfahren, es soll aber in diesem Fall oben bleiben und erst runter fahren wenn das Fenster geschlossen wird.

Leider finde ich nicht den richtigen Ansatz eine Lösung in das vorhande DOIF einzubauen...

Danke für eure Hilfe

...Gruß skuggy

FHEM 5.6 auf Raspberry Pi 2, HM-CFG-LAN, 8x HM-LC-Bl1PBU-FM, 5 x HM-CC-RT-DN, 1 x HM-LC-Sw1-Ba-PCB, 1 x HM-RC-4-2, 1 x JeeLink Clone, 10 x TX29DTH-IT, Fritzbox 7270

Ellert

#5
Im Prinzip geht es so, in den Zweig für Rollo "zu"  Folgendes einbauen

IF ([Fenster] eq "offen") (setreading $SELF spaeterzu 1) ELSE (set Rollo zu)

und einen DOELSEIF-Zweig einbauen

DOELSEIF ([Fenster] "zu" and [?$SELF:spaeterzu]) (set Rollo zu)

ggf notexist "0" setzen