DOIF: Initialisierung der verwendeten Readings

Begonnen von WumpE, 28 Juli 2015, 10:47:15

Vorheriges Thema - Nächstes Thema

WumpE

Hallo Leute,

ich hatte heute morgen das Problem das meine Rollos nicht gefahren sind, weil ich gestern abend an meiner Rolladensteuerung etwas geändert habe. Den Fehler konnte ich eingrenzen und weiss das die Dummyvariable Rollos_Automatik nicht als e_Rollos_Automatik im DOIF stand, weil sie ihren status nicht geändert hat.

Nach dem Speichern der Konfiguration wird ja die DOIF neu initialisiert. Jetzt habe ich Dummys für bestimmte Bedingungen genutzt, aber solange der Dummy seinen Status nicht ändert bekommt DOIF davon nix mit und das event_reading im DOIF fehlt. Wie kann man das elegant lösen, das die Event_Readings bei der Initialisierung abgerufen werden?

Hier mal ein Beispiel eines einzelnen Rollos

([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "off" and ([06:00|8] or [07:30|7]) and [BU_RA:pct] < 30)(set BU_RA 30)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Hitzeschutz] eq "on" and [10:00-19:00] and [BU_RA:pct] > 30 and [BU_TR_Climate:measured-temp] > 22)(set BU_RA 30)
DOELSEIF
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and (([19:01]) or ([Rollos_Hitzeschutz] eq "off" and [10:00-19:00])))(set BU_RA 100)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "off" and [Rollos_Hitzeschutz] eq "off" and ([08:00-12:00] or [15:00-18:00]) and [BU_RA:pct] < 100)(set BU_RA 100)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "on" and [BU_RA:pct] > 25)(set BU_RA 0)


CMD_1 = Wecken
CMD_2 = Hitzeschutz aber nur wenn Raumtemp über 22°C und in der Zeit von 10-19 Uhr da Südseite
CMD_3 = Hitzschutz aufheben
CMD_4 = Rollos definitiv aufmachen 8-12 und 15-18
CMD_5 = Sichtschutz Nachts, aber nur wenn das Rollo bis 25% offen ist (Belüftung)

Hitzeschutz sieht so aus
([XX_TS:temperature]>20 and [XX_MS:brightness]>209)(set Rollos_Hitzeschutz on) DOELSE (set Rollos_Hitzeschutz off)

Sichtschutz so
([XX_MS:brightness]<140)(set Rollos_Sichtschutz on) DOELSE (set Rollos_Sichtschutz off)

Rollos_Automatik ist ein Dummy mit on|off status

Frage 2: CMD_3 im oberen DOIF
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and (([19:01]) or ([Rollos_Hitzeschutz] eq "off" and [10:00-19:00])))(set BU_RA 100)

kann man hier die Zeitspanne negieren? Weil so:
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and ([Rollos_Hitzeschutz] eq "off" or ![10:00-19:00]))(set BU_RA 100)
wäre mir das viel lieber.
Sprich wenn die Hitzeschutzvariable off geht oder es ausserhalb der Zeitspanne ist soll er das Rollo hochfahren wenn es bei 30% steht

Gruß Stefan
Über Mich: Stefan, Informatiker, Systementwicklung Prozessleittechnik
Server: NUC7i5 - Debian Docker
Container: FHEM,DEBMATIC,EMQX,NODERED,SONOS2MQTT,TRAEFIK,HOMEBRIDGE,DECONZ
Aktoren/Sensoren: HM-RF, HM-IP, EnergyCam, Shelly, MiLight, Hue, SONOS, OEG KMS-D+, Echo's, Worx
Frontends: Smartvisu 2.9

Loredo

Du kannst mit dem Befehl "trigger dummyDevice status" manuell ein Event auslösen, auf dass das Doif dann reagiert. Alternativ kannst du natürlich auch den Status des Dummy neu setzen. Wenn du dabei den selben Status wie den aktuellen nutzt, wird nur dann ein Event erzeugt, wenn du im Dummy das Attribut event-on-update-reading entsprechend gesetzt hast.
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

Damian

Zitat von: WumpE am 28 Juli 2015, 10:47:15
Hallo Leute,

ich hatte heute morgen das Problem das meine Rollos nicht gefahren sind, weil ich gestern abend an meiner Rolladensteuerung etwas geändert habe. Den Fehler konnte ich eingrenzen und weiss das die Dummyvariable Rollos_Automatik nicht als e_Rollos_Automatik im DOIF stand, weil sie ihren status nicht geändert hat.

Nach dem Speichern der Konfiguration wird ja die DOIF neu initialisiert. Jetzt habe ich Dummys für bestimmte Bedingungen genutzt, aber solange der Dummy seinen Status nicht ändert bekommt DOIF davon nix mit und das event_reading im DOIF fehlt. Wie kann man das elegant lösen, das die Event_Readings bei der Initialisierung abgerufen werden?

Hier mal ein Beispiel eines einzelnen Rollos

([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "off" and ([06:00|8] or [07:30|7]) and [BU_RA:pct] < 30)(set BU_RA 30)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Hitzeschutz] eq "on" and [10:00-19:00] and [BU_RA:pct] > 30 and [BU_TR_Climate:measured-temp] > 22)(set BU_RA 30)
DOELSEIF
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and (([19:01]) or ([Rollos_Hitzeschutz] eq "off" and [10:00-19:00])))(set BU_RA 100)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "off" and [Rollos_Hitzeschutz] eq "off" and ([08:00-12:00] or [15:00-18:00]) and [BU_RA:pct] < 100)(set BU_RA 100)
DOELSEIF
([Rollos_Automatik] eq "on" and [Rollos_Sichtschutz] eq "on" and [BU_RA:pct] > 25)(set BU_RA 0)


CMD_1 = Wecken
CMD_2 = Hitzeschutz aber nur wenn Raumtemp über 22°C und in der Zeit von 10-19 Uhr da Südseite
CMD_3 = Hitzschutz aufheben
CMD_4 = Rollos definitiv aufmachen 8-12 und 15-18
CMD_5 = Sichtschutz Nachts, aber nur wenn das Rollo bis 25% offen ist (Belüftung)

Hitzeschutz sieht so aus
([XX_TS:temperature]>20 and [XX_MS:brightness]>209)(set Rollos_Hitzeschutz on) DOELSE (set Rollos_Hitzeschutz off)

Sichtschutz so
([XX_MS:brightness]<140)(set Rollos_Sichtschutz on) DOELSE (set Rollos_Sichtschutz off)

Rollos_Automatik ist ein Dummy mit on|off status

Frage 2: CMD_3 im oberen DOIF
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and (([19:01]) or ([Rollos_Hitzeschutz] eq "off" and [10:00-19:00])))(set BU_RA 100)

kann man hier die Zeitspanne negieren? Weil so:
([Rollos_Automatik] eq "on" and [BU_RA:pct] == 30 and ([Rollos_Hitzeschutz] eq "off" or ![10:00-19:00]))(set BU_RA 100)
wäre mir das viel lieber.
Sprich wenn die Hitzeschutzvariable off geht oder es ausserhalb der Zeitspanne ist soll er das Rollo hochfahren wenn es bei 30% steht

Gruß Stefan

Die event_Readings haben nur informativen Charakter für den User. Sie werden von DOIF nicht ausgewertet. Du kannst mit dem Attribut initialize, das Modul nach dem Hochfahren initialisieren lassen, so dass der alte Zustand gelöscht wird und der nächste Trigger auch ohne do always zur Ausführung führt.

Du kann übrigens alle Perl-Operatoren insb. ! nutzen, da DOIF nichts anderes als "erweitertes" Perl ist.

Gruß

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

WumpE

Also wenn die event Readings nur informativen charakter haben, dann habe ich den Fehler wohl noch nicht gefunden :(

Gut also das mit der negierten zeit werde ich mal testen
Über Mich: Stefan, Informatiker, Systementwicklung Prozessleittechnik
Server: NUC7i5 - Debian Docker
Container: FHEM,DEBMATIC,EMQX,NODERED,SONOS2MQTT,TRAEFIK,HOMEBRIDGE,DECONZ
Aktoren/Sensoren: HM-RF, HM-IP, EnergyCam, Shelly, MiLight, Hue, SONOS, OEG KMS-D+, Echo's, Worx
Frontends: Smartvisu 2.9

WumpE

Fehler ist gefunden, Punkt 6:00 Uhr war die Helligkeit bei 130 somit war der Sichtschutz noch aktiv und die Bedingung somit falsch.

hab es jetzt so gebaut, das er in der Zeitspanne von 6:00-8:00 wecken soll, wenn es draussen hell wird

@Damian, die negierung der Zeit funktioniert auch, danke dir nochmal

Gruß Stefan
Über Mich: Stefan, Informatiker, Systementwicklung Prozessleittechnik
Server: NUC7i5 - Debian Docker
Container: FHEM,DEBMATIC,EMQX,NODERED,SONOS2MQTT,TRAEFIK,HOMEBRIDGE,DECONZ
Aktoren/Sensoren: HM-RF, HM-IP, EnergyCam, Shelly, MiLight, Hue, SONOS, OEG KMS-D+, Echo's, Worx
Frontends: Smartvisu 2.9