Moin zusammen,
ich probiere gerade an einer variablen Zeitschaltung meiner Rollos aus.
Aus mehrern Themen habe ich mir folgendes zusammen kopiert und angepasst:
define Rollo.WC.Zufall.ab at *{randomtime("22,00,30")} CommandSet(undef,'Rollo.WC ab') if( Value('Rollo.Haus.Automatik') eq 'an')
attr Rollo.WC.Zufall.ab alias Rollo WC ab
attr Rollo.WC.Zufall.ab group Rollo Automatik
attr Rollo.WC.Zufall.ab room Haus
randomtime ist die Funktion von depe1999 https://forum.fhem.de/index.php?topic=29438.0
der Automatikschalter ist wie folgt definiert:
define Rollo.Haus.Automatik dummy
attr Rollo.Haus.Automatik alias Automatik
attr Rollo.Haus.Automatik devStateIcon an:general_an aus:general_aus
attr Rollo.Haus.Automatik group Rollo Automatik
attr Rollo.Haus.Automatik room Haus
attr Rollo.Haus.Automatik sortby 2
attr Rollo.Haus.Automatik webCmd an:aus
Nun möchte ich die Stunden (22) als eine Variable bestimmen, die ich aus folgendem dummy erzeuge:
define Rollo.Haus.Automatik.ab dummy
attr Rollo.Haus.Automatik.ab setList state:18,19,20,21,22,23
attr Rollo.Haus.Automatik.ab group Rollo Automatik
attr Rollo.Haus.Automatik.ab room Haus
attr Rollo.Haus.Automatik.ab readingList state
attr Rollo.Haus.Automatik.ab sortby 3
attr Rollo.Haus.Automatik.ab webCmd state
Wie mache ich das?
Ich habe es schon mit Value('Rollo.Haus.Automatik.ab') versucht, doch leider bekomme ich immer den Fehler, dass ich keine korrekte Zeitangabe benutze, bzw. es wird immer (00) eingetragen.
Wo ist mein Denkfehler? Gibt es evtl. eine viel einfachere Lösung meines Problems?
Danke & Gruß
Tim
Versuchs mal mit:
define Rollo.WC.Zufall.ab at *{randomtime(Value("Rollo.Haus.Automatik.ab").",00,30")} { fhem("set Rollo.WC ab") if( Value("Rollo.Haus.Automatik") eq "an") }
Vermutlich ist eine "zeitnahe" Aktualisierung sinnvoll:
define Rollo.WC.Zufall.ab.activate notify Rollo.Haus.Automatik.ab modify Rollo.WC.Zufall.ab *{randomtime(Value("Rollo.Haus.Automatik.ab").",00,30")}
Super, danke.
Werde ich heute Abend mal ausprobieren.
Hat funktioniert.
Danke!