diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html
index f456220a5..084900410 100644
--- a/fhem/docs/commandref_frame.html
+++ b/fhem/docs/commandref_frame.html
@@ -1066,14 +1066,16 @@ The following local attributes are used by a wider range of devices:
Each device has different set parameters, see the corresponding device
section for details.
- From featurelevel 5.7 on the set (and setreading) command replaces:
+ From featurelevel 5.7 on the set and setreading command replaces:
- [device:reading] with the corresponding reading of device, if both device
and reading exists.
- [device:reading:d] same as above, but only the number is retrieved, see
ReadingsNum
- - {(perlExpression)} with the result of perlExpression, if the expression
- does not generates an error.
+ - {(perlExpression)} with the result of perlExpression.
+ If this construct is used inside of a notify or cmdalias, the $DEV variable
+ is additionally available, designating the set device name.
+
diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html
index 1f41c7a10..e0146d249 100644
--- a/fhem/docs/commandref_frame_DE.html
+++ b/fhem/docs/commandref_frame_DE.html
@@ -1134,8 +1134,11 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
device, als auch Reading existiert, und nicht leer ist.
[device:reading:d] wie ohne :d, aber alles nicht-numerische wird
entfernt, siehe ReadingsNum
- {(perlExpression)} mit dem Ergebnis der perlExpression, falls der Ausdruck
- keinen Fehler generiert.
+ {(perlExpression)} mit dem Ergebnis der perlExpression.
+ Falls dieser Konstrukt innerhalb einer notify oder cmdalias verwendet wird,
+ dann wird zusätzlich $DEV mit dem Namen des vom set betroffenen
+ Gerätes ersetzt.
+
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index 53854d03a..74dd9e3c7 100755
--- a/fhem/fhem.pl
+++ b/fhem/fhem.pl
@@ -1566,6 +1566,7 @@ ReplaceSetMagic($$@) # Forum #38276
$x eq "" ? "[$1:$2$3]" : $x
}/egi;
+ $evalSpecials->{'%DEV'} = $hash->{NAME} if($evalSpecials);
$a =~ s/{\((.*?)\)}/AnalyzePerlCommand($hash->{CL},$1,1)/egs;
return (undef, @_) if($oa eq $a);