Danke Rudolf,
Now i have this and it works.
define lampaan notify DS2406_688892000000:sensed.* { if (ReadingsVal ("DS2406_688892000000","sensed.B","0") eq "1" && $hms gt "00:00:00" && $hms lt "06:00:00") { fhem("set EnO_switch_FFECXXXX on") } else { fhem("set EnO_switch_FFECXXXX off") } }
The only "problem" i have is that the Eno_switch gets turned off because of the "else" statement. Any thoughts on how to make this command better?