diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index d9e026d43..a1803a2b7 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -110,8 +110,9 @@ at_Define($$) RemoveInternalTimer($hash); InternalTimer($nt, "at_Exec", $hash, 0); $hash->{NTM} = $ntm if($rel eq "+" || $fn); - $hash->{STATE} = AttrVal($name, "disable", undef) ? + my $val = AttrVal($name, "disable", undef) ? "disabled" : ("Next: ".FmtTime($nt)); + readingsSingleUpdate($hash, "state", $val, 1); } return undef; @@ -242,10 +243,9 @@ at_Attr(@) } $do = 2 if($cmd eq "del" && (!$attrName || $attrName eq "disable")); return if(!$do); - $hash->{STATE} = ($do == 1 ? - "disabled" : - "Next: " . FmtTime($hash->{TRIGGERTIME})); - + my $val = ($do == 1 ? "disabled" : + "Next: " . FmtTime($hash->{TRIGGERTIME})); + readingsSingleUpdate($hash, "state", $val, 1); return undef; } diff --git a/fhem/FHEM/91_notify.pm b/fhem/FHEM/91_notify.pm index 748abd329..d09d3e886 100755 --- a/fhem/FHEM/91_notify.pm +++ b/fhem/FHEM/91_notify.pm @@ -43,7 +43,7 @@ notify_Define($$) return "Bad regexp: $@" if($@); $hash->{REGEXP} = $re; $hash->{".COMMAND"} = $command; - $hash->{STATE} = "active"; + readingsSingleUpdate($hash, "state", "active", 1); notifyRegexpChanged($hash, $re); return undef; @@ -110,7 +110,7 @@ notify_Attr(@) $do = 2 if($a[0] eq "del" && (!$a[2] || $a[2] eq "disable")); return if(!$do); - $defs{$a[1]}{STATE} = ($do == 1 ? "disabled" : "active"); + readingsSingleUpdate($defs{$a[1]}, "state", $do==1 ? "disabled":"active", 1); return undef; }