diff --git a/fhem/FHEM/00_FHZ.pm b/fhem/FHEM/00_FHZ.pm
index 1ca4908ff..324e15ebe 100755
--- a/fhem/FHEM/00_FHZ.pm
+++ b/fhem/FHEM/00_FHZ.pm
@@ -89,7 +89,7 @@ FHZ_Set($@)
my $v = join(" ", @a);
my $name = $hash->{NAME};
- Log GetLogLevel($name,2), "FHZ set $name $v";
+ Log GetLogLevel($name,2), "FHZ set $v";
if($a[1] eq "activefor") {
diff --git a/fhem/FHEM/91_notify.pm b/fhem/FHEM/91_notify.pm
index c6225f77b..30b34b473 100755
--- a/fhem/FHEM/91_notify.pm
+++ b/fhem/FHEM/91_notify.pm
@@ -23,7 +23,7 @@ sub
notify_Define($$)
{
my ($hash, $def) = @_;
- my ($re, $command) = split("[ \t]+", $def, 2);
+ my ($type, $name, $re, $command) = split("[ \t]+", $def, 4);
# Checking for misleading regexps
eval { "Hallo" =~ m/^$re$/ };
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index 8e04a345b..e4c6362e2 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -113,6 +113,15 @@ split in multiple lines
be written to this file.
+
+
lastinclude
+ If this attribute is set, then the last command of the generated
+ configfile (see the save command) will be
+ include <lastinclude-value>
+ This file can contain not configurable information, e.g.
+ setting the FHTcode.
+
+
logfile
Specify the logfile to write. You can use "-" for
diff --git a/fhem/docs/fhem.html b/fhem/docs/fhem.html
index e9783da0e..e01a979c5 100644
--- a/fhem/docs/fhem.html
+++ b/fhem/docs/fhem.html
@@ -9,7 +9,9 @@
-FHEM (GPL'd FS20/HMS/FHT/KS300/WS300 server for linux, formerly known as fhz1000.pl)
+FHEM
+GPL'd FHZ FS20 HMS FHT KS300 WS300 server for linux, formerly known as
+fhz1000.pl
News (as of =DATE=, Version =VERS=)
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index 0cc4bd82b..d91a1caa0 100755
--- a/fhem/fhem.pl
+++ b/fhem/fhem.pl
@@ -136,7 +136,7 @@ my $AttrList = "room";
$modules{_internal_}{ORDER} = -1;
-$modules{_internal_}{AttrList} = "configfile logfile modpath " .
+$modules{_internal_}{AttrList} = "configfile logfile lastinclude modpath " .
"pidfilename port statefile title userattr " .
"verbose:1,2,3,4,5 version";
@@ -535,13 +535,14 @@ sub
CommandInclude($$)
{
my ($cl, $arg) = @_;
- if(!open(CFG, $arg)) {
+ my $fh;
+ if(!open($fh, $arg)) {
return "Can't open $arg: $!";
}
my $bigcmd = "";
$rcvdquit = 0;
- while(my $l = ) {
+ while(my $l = <$fh>) {
chomp($l);
if($l =~ m/^(.*)\\$/) { # Multiline commands
$bigcmd .= $1;
@@ -551,7 +552,7 @@ CommandInclude($$)
}
last if($rcvdquit);
}
- close(CFG);
+ close($fh);
return undef;
}
@@ -706,8 +707,10 @@ CommandSave($$)
foreach my $d (sort keys %savefirst) {
my $r = $savefirst{$d};
delete $rooms{$r}{$d};
- delete $rooms{$r} if(int(%{$rooms{$r}}) == 0);
- print SFH "define $d $defs{$d}{TYPE} $defs{$d}{DEF}\n";
+ delete $rooms{$r} if(! %{$rooms{$r}});
+ my $def = $defs{$d}{DEF};
+ $def =~ s/;/;;/g;
+ print SFH "define $d $defs{$d}{TYPE} $def\n";
foreach my $a (sort keys %{$attr{$d}}) {
next if($a eq "savefirst");
print SFH "attr $d $a $attr{$d}{$a}\n";
@@ -718,13 +721,21 @@ CommandSave($$)
print SFH "\ndefattr" . ($r ne "~" ? " room $r" : "") . "\n";
foreach my $d (sort keys %{$rooms{$r}} ) {
next if($defs{$d}{VOLATILE});
- print SFH "define $d $defs{$d}{TYPE} $defs{$d}{DEF}\n";
+ my $def = $defs{$d}{DEF};
+ $def =~ s/;/;;/g;
+ print SFH "define $d $defs{$d}{TYPE} $def\n";
foreach my $a (sort keys %{$attr{$d}}) {
next if($a eq "room");
print SFH "attr $d $a $attr{$d}{$a}\n";
}
}
}
+
+ print SFH "defattr\n"; # Delete the last default attribute.
+
+ print SFH "include $attr{global}{lastinclude}\n"
+ if($attr{global}{lastinclude});
+
close(SFH);
return undef;