fhem.pl: extern SetMagic, add AttrNum and InternalNum (Forum #38276)
git-svn-id: https://svn.fhem.de/fhem/trunk@13904 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1084,10 +1084,26 @@ The following local attributes are used by a wider range of devices:
|
||||
From featurelevel 5.7 on the set and setreading command replaces:
|
||||
<ul>
|
||||
<li>[device:name] with the reading, internal or attribute of the device, if
|
||||
both device and the reading, internal or attribute exists. You can use the
|
||||
r:, i: or a: prefix to restrict the search to one type, analogue to the
|
||||
devspec filtering.</li>
|
||||
both device and the reading, internal or attribute exists.
|
||||
<ul>
|
||||
<li>You can use the r:, i: or a: prefix to restrict the search to one
|
||||
type, analogue to the devspec filtering.</li>
|
||||
<li>The suffix :d retrieves the first number and converts it to an
|
||||
integer.</li>
|
||||
<li>The suffix :r<n> retrieves the first number and rounds it to
|
||||
<n> decimal places. If <n> is missing, then rounds it to
|
||||
one decimal place.</li>
|
||||
<li>The suffix :t returns the timestamp (works only for readings)</li>
|
||||
<li>The suffix :sec returns the number of seconds since the reading was
|
||||
set.</li>
|
||||
</ul>
|
||||
Example:
|
||||
<ul>
|
||||
set Lamp blink [blinkDummy:number] [r:blinkDummy:duration:d]
|
||||
</ul>
|
||||
</li>
|
||||
<li>[device:name:d] same as above, but only the number is retrieved</li>
|
||||
<li>[device:name:sec] same as above, but only the number is retrieved</li>
|
||||
<li>{(perlExpression)} with the result of perlExpression.
|
||||
The $DEV variable is additionally available, designating the set device
|
||||
name.
|
||||
@@ -1648,8 +1664,10 @@ The following local attributes are used by a wider range of devices:
|
||||
Return the reading (the value in the Readings section of "list device")
|
||||
</li><br>
|
||||
<li>
|
||||
ReadingsNum(<devicename>,<reading>,<defaultvalue>)<br>
|
||||
Return the reading as a number, i.e. delete non-numerical values.
|
||||
ReadingsNum(<devicename>,<reading>,
|
||||
<defaultvalue>,<round>)<br>
|
||||
Return the first number from a reading value.
|
||||
Round id to <round> devimal places (optional parameter).
|
||||
</li><br>
|
||||
<li>ReadingsTimestamp(<devicename>,<reading>,<
|
||||
defaultvalue>)<br>
|
||||
@@ -1670,12 +1688,24 @@ The following local attributes are used by a wider range of devices:
|
||||
{ ReadingsTimestamp("wz", "measured-temp", 0)}<br>
|
||||
{ AttrVal("wz", "room", "none") }<br>
|
||||
</li><br>
|
||||
<li>
|
||||
AttrNum(<devicename>,<attribute>,
|
||||
<defaultvalue>,<round>)<br>
|
||||
Return the first number from an attribute value.
|
||||
Round id to <round> devimal places (optional parameter).
|
||||
</li><br>
|
||||
<li>
|
||||
InternalVal(<devicename>,<property>,<defaultvalue>)
|
||||
<br>
|
||||
Return the internal value (the value in the Internals section of "list
|
||||
device").
|
||||
</li><br>
|
||||
<li>
|
||||
InternalNum(<devicename>,<property>,
|
||||
<defaultvalue>,<round>)<br>
|
||||
Return the first number from an internal value.
|
||||
Round id to <round> devimal places (optional parameter).
|
||||
</li><br>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user