Hauptmenü

Isday Frage

Begonnen von matzewob, 15 Juni 2019, 23:14:38

Vorheriges Thema - Nächstes Thema

matzewob

Moin,

ich habe einen Bewegungsmelder der diverse Dinge steuert, ebenfalls den Durchgang, den er Nachts einschalten soll.
Funktioniert auch super, allerdings nimmt Fhem mit isday das "Nacht" sehr genau, ich würde den gerne schon früher, also bei Dämmerung aktivieren.
Aktuell sieht das so aus:
{if (!isday() ) {fhem ("set Durchgang on")}}

Gibt es eine Möglichkeit zu sagen das er Ifday - 1,5h oder so nimmt? Oder eine andere alternative zum Isday? z.b. Zeitspanne von 21:00 Uhr - 5:00 Uhr?

Danke schonmal für euren InPut

Matze

Otto123

Hi,

klar: https://commandref.fhem.de/#SUNRISE_EL
ZitatAll functions take up to three arguments:
The first specifies an offset (in seconds), which will be added to the event.
The second and third specify min and max values (format: "HH:MM").

isday() can be used in some notify or at commands to check if the sun is up or down. isday() ignores the seconds parameter, but respects min and max. If min < max, than the day starts not before min, and ends not after max. If min > max, than the day starts not after max, and ends not before min.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

matzewob

Moin Otto,

das habe ich jetzt nicht ganz verstanden?

Otto123

#3
Moin,

na Du wolltest isday mit -1,5h das sollte so gehen
isday(-5400)

Es gibt auch noch einen Parameter, falls Du nicht stur 1,5 h früher beginnen willst sondern den Winkel der Sonne berücksichtigen willst:
ZitatOptionally, for all functions you can set first argument which defines a horizon value which then is used instead of the $defaultaltit in SUNRISE_EL.pm.
Possible values are: "REAL", "CIVIL", "NAUTIC", "ASTRONOMIC" or a positive or negative number preceded by "HORIZON="
REAL is 0, CIVIL is -6, NAUTIC is -12, ASTRONOMIC is -18 degrees above horizon.

Eine feste Zeitspanne geht mMn einfacher mit einem DOIF.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

matzewob

Ah okay, ich hatte das nicht verstanden weil ich immer vom Sunset und Sunrise ausgegangen war. Danke dir für die Hilfe :)