2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

10_OWDevice: added rudimentary support for 1F device family

git-svn-id: https://svn.fhem.de/fhem/trunk@14523 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2017-06-16 05:15:56 +00:00
parent 6e175f1df6
commit ae5a2570b1
2 changed files with 29 additions and 5 deletions

View File

@ -43,6 +43,7 @@ use vars qw(%owfamily);
"12" => "DS2406 DS2507",
"1B" => "DS2436",
"1D" => "DS2423",
"1F" => "DS2409",
"20" => "DS2450",
"22" => "DS1822",
"23" => "DS2433",

View File

@ -121,6 +121,14 @@ $owdevice{"1D"} = {
"offset" => [ qw(counters.A counters.B) ],
"interface" => "counter",
};
$owdevice{"1F"} = {
# DS2409 - Microlan Coupler
"read" => [],
"write" => [],
"poll" => [],
"state" => [],
"interface" => "none",
};
$owdevice{"20"} = {
# DS2450 - Quad A/D Converter
"read" => [ qw(alarm/high.A alarm/high.B alarm/high.C alarm/high.D alarm/high.ALL),
@ -222,9 +230,10 @@ $owdevice{"26"} = {
qw(HIH4000/humidity),
qw(HTM1735/humidity),
qw(DATANAB/humidity),
qw(HIH3600/humidity),
qw(humidity),
qw(B1-R1-A/pressure B1-R1-A/gain B1-R1-A/offset),
qw(S3-R1-A/current S3-R1-A/illumination S3-R1-A/gain),
qw(S3-R1-A/current S3-R1-A/illumination S3-R1-A/illuminance S3-R1-A/gain),
qw(MultiSensor/type),
qw(offset) ],
"write" => [ qw(pages/page.0 pages/page.1 pages/page.2 pages/page.3 pages/page.4),
@ -392,7 +401,10 @@ OWDevice_GetDetails($) {
my ($hash)= @_;
my $family= substr($hash->{fhem}{address}, 0, 2);
my @path= split('/', $hash->{fhem}{address});
my $address= $path[-1];
#main::Debug "address is $address";
my $family= substr($address, 0, 2);
my @getters= @{$owdevice{$family}{"read"}};
my @setters= @{$owdevice{$family}{"write"}};
my @polls= @{$owdevice{$family}{"poll"}};
@ -459,6 +471,7 @@ OWDevice_ReadValue($$) {
my $path = "$cache/$address/$reading";
$path .= AttrVal($hash->{NAME},"resolution","") if( $reading eq "temperature" );
#my ($seconds, $microseconds) = gettimeofday();
#main::Debug "OWDevice_ReadValue NAME=" . $hash->{NAME} . " path=$path";
my $value= OWDevice_ReadFromServer($hash,"read",$path);
#my ($seconds2, $microseconds2) = gettimeofday();
#my $msec = sprintf( "%03d msec", (($seconds2-$seconds)*1000000 + $microseconds2-$microseconds)/1000 );
@ -476,13 +489,14 @@ OWDevice_ReadValue($$) {
}
###################################
sub
OWDevice_WriteValue($$$) {
sub OWDevice_WriteValue($$$) {
my ($hash,$reading,$value)= @_;
my $cache= (AttrVal($hash->{NAME},"uncached","")) ? "/uncached" : "";
my $address= $hash->{fhem}{address};
IOWrite($hash, "/$address/$reading", $value);
my $path = "$cache/$address/$reading";
IOWrite($hash, $path, $value);
return $value;
}
@ -762,6 +776,10 @@ OWDevice_InitValues($)
Defines a 1-wire device. The 1-wire device is identified by its <address>. It is
served by the most recently defined <a href="#OWServer">OWServer</a>.
<br><br>
Devices beyond 1-wire hubs (DS2409, address family 1F) need to be addressed by the full path, e.g.
<code>1F.0AC004000000/main/26.A157B6000000</code> (no leading slash). They are
not automatically detected.
<br><br>
If &lt;interval&gt; is given, the OWServer is polled every &lt;interval&gt; seconds for
a subset of readings.
@ -793,6 +811,7 @@ OWDevice_InitValues($)
<li>DS2408 - 1-Wire 8 Channel Addressable Switch</li>
<li>DS2413 - Dual Channel Addressable Switch</li>
<li>DS1825 - Programmable Resolution 1-Wire Digital Thermometer with ID</li>
<li>DS2409 - Microlan Coupler (no function implemented)</li>
<li>EDS0066 - Multisensor for temperature and pressure</li>
<li>LCD - LCD controller by Louis Swart</li>
</ul>
@ -921,6 +940,10 @@ OWDevice_InitValues($)
Definiert ein 1-Wire- Gerät. 1-Wire- Geräte werden anhand ihrer Adresse &lt;address&gt; definiert. Diese wird
durch den zuvor eingerichteten <a href="#OWServer">OWServer</a> bereitgestellt.
<br><br>
Ger&auml;te hinter 1-wire-Hubs (DS2409, Adressfamilie 1F) m&uuml;ssen &uuml;ber den vollen Pfad adressiert werden, z.B.
<code>1F.0AC004000000/main/26.A157B6000000</code> (kein f&uuml;hrender Schr&auml;gstrich). Sie werden nicht
automatisch erkannt.
<br><br>
Wird zusätzlich &lt;interval&gt; angegeben, ruft OWServer alle &lt;interval&gt; Sekunden
einen Datensatz des Gerätes ab.