FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: satprofi am 28 Februar 2014, 11:41:20

Titel: notify nicht unbedingt richtig
Beitrag von: satprofi am 28 Februar 2014, 11:41:20
Hallo.
Habe langsam den Durchblick bei FHEM.
Ich will jetzt eine Steckdose zw. 8 u. 24h schalten wenn jemand  daheim ist.


define Power_on_present notify Bewohner:present IF ([Bewohner:state] eq "present" and ($hms ge "08:00" and $hms le "23:59:54")) (set Steckdose2:FILTER=STATE!=on on) Else (set Steckdose2:FILTER=STATE!=off off)


trotzdem klappt  es nicht od. verstehe ich eintrag nicht richtig.

Die ganze Bedingung werkelt nur wie folgend:



define Power_on_present notify Bewohner:present IF ([Bewohner:state] eq "present" and ($hms ge "08:00" and $hms le "23:59:54")) (set Steckdose2:FILTER=STATE!=on on)
define Power_off_present notify Bewohner:present IF ([Bewohner:state] eq "present" and ($hms ge "23:59:55")) (set Steckdose2:FILTER=STATE!=off off)
define Power_off_absent notify Bewohner:absent IF ([Bewohner:state] eq "absent") (set Steckdose2:FILTER=STATE!=off off)



Wo scheiter ich bzw. was versteh ich da falsch?
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: dieda am 28 Februar 2014, 16:35:43
Verstehe ich das richtig, wenn du da bist sollen die Steckdosen von 8 bis max. 23:59 geschaltet werden, wenn du aber zwischendurch weggehst aus?

Was ist wenn du wiederkommst? Nur kurz weg bist?

Schau mal, hier gibt es zum Presence einige Anwendungsfälle für ähnliche Situationen.
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: satprofi am 28 Februar 2014, 18:25:39
Ja, richtig. Wenn ich weg bin Steckdose aus.
Klappt ja, aber eben umständlich. Warum schlägt ELSE nicht zu?

m.f.g.
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: der-Lolo am 28 Februar 2014, 18:36:18
Ich verstehe dein Filter State Ding nicht. Warum hast du sowas im set verbaut?
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: Damian am 28 Februar 2014, 18:40:52
probiere mal:

define Power_on_present notify Bewohner IF ([Bewohner:state] eq "present" and ($hms ge "08:00" and $hms le "23:59:54")) (set Steckdose2:FILTER=STATE!=on on) ELSE (set Steckdose2:FILTER=STATE!=off off)

Gruß

Damian

Titel: Antw:notify nicht unbedingt richtig
Beitrag von: dieda am 28 Februar 2014, 18:41:28
http://lmgtfy.com/?q=fhem+wiki+presence

;) ;) ;)
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: satprofi am 28 Februar 2014, 18:50:03
Zitat von: der-Lolo am 28 Februar 2014, 18:36:18
Ich verstehe dein Filter State Ding nicht. Warum hast du sowas im set verbaut?

inen FILTER bei set zu setzen, damit du nicht jedes mal unnötig das Kommando absetzt, auch wenn sich die Zustandsanzeige nicht ändern soll.
Titel: Antw:notify nicht unbedingt richtig
Beitrag von: satprofi am 28 Februar 2014, 19:03:42
Zitat von: Damian am 28 Februar 2014, 18:40:52
probiere mal:

define Power_on_present notify Bewohner IF ([Bewohner:state] eq "present" and ($hms ge "08:00" and $hms le "23:59:54")) (set Steckdose2:FILTER=STATE!=on on) ELSE (set Steckdose2:FILTER=STATE!=off off)

Gruß

Damian

Hallo.
Danke, klappt.