2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

new attribute "resolution" for 1-wire temperature readings

git-svn-id: https://svn.fhem.de/fhem/trunk@4272 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2013-11-23 11:23:41 +00:00
parent 766fc3abf0
commit a4ff604ab0
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- SVN
- feature: new attribute resolution for 1-wire temperature readings
(justme1968 & Boris)
- feature: new layout commands moveto, moveby and relative positioning
in 02_RSS.pm (Betateilchen & Boris)
- feature: FHEMWEB column attribute

View File

@ -353,6 +353,7 @@ OWDevice_Initialize($)
$hash->{AttrFn} = "OWDevice_Attr";
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model ".
"resolution:9,10,11,12 ".
$readingFnAttributes;
}
@ -425,8 +426,13 @@ OWDevice_ReadValue($$) {
my $address= $hash->{fhem}{address};
my $interface= $hash->{fhem}{interfaces};
my $cache= (AttrVal($hash->{NAME},"uncached","")) ? "/uncached" : "";
my $value= OWDevice_ReadFromServer($hash,"read","$cache/$address/$reading");
#Debug "/$address/$reading => $value";
my $path = "$cache/$address/$reading";
$path .= AttrVal($hash->{NAME},"resolution","") if( $reading eq "temperature" );
my ($seconds, $microseconds) = gettimeofday();
my $value= OWDevice_ReadFromServer($hash,"read",$path);
my ($seconds2, $microseconds2) = gettimeofday();
#my $msec = sprintf( "%03d msec", (($seconds2-$seconds)*1000000 + $microseconds2-$microseconds)/1000 );
#Debug "$path => $value; $msec";
if($interface ne "id") {
if(defined($value)) {
$value= trim($value) if(AttrVal($hash,"trimvalues",1));
@ -810,6 +816,9 @@ OWDevice_Define($$)
<li>polls: a comma-separated list of readings to poll. This supersedes the list of default readings to poll.</li>
<li>interfaces: supersedes the interfaces exposed by that device.</li>
<li>model: preset with device type, e.g. DS18S20.</li>
<li>resolution: resolution of temperature reading in bits, can be 9, 10, 11 or 12.
Lower resolutions allow for faster retrieval of values from the bus.
Particularly reasonable for large 1-wire installations to reduce busy times for FHEM.</li>
<li><a href="#eventMap">eventMap</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul>