00_OWX.pm: Version 7.11 mit Fix für neuen DS2438

11_OWX_SER.pm: Anpassung Versionsnummer
11_OWX_TCP.pm: Anpassung Versionsnummer
11_OWX_FRM.pm: Anpassung Versionsnummer
11_OWX_CCC.pm: Fix für CUBE Device
21_OWMULTI.pm: Fix für neuen DS2438

git-svn-id: https://svn.fhem.de/fhem/trunk@16671 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
phenning 2018-04-29 05:06:35 +00:00
parent 7a3832982e
commit 90aa1e6174
6 changed files with 41 additions and 20 deletions

View File

@ -74,6 +74,7 @@ use vars qw{%owg_family %gets %sets $owx_version $owx_debug};
"3B" => ["DS1825","OWID 3B"], "3B" => ["DS1825","OWID 3B"],
"7E" => ["OW-ENV","OWID 7E"], #Environmental sensor "7E" => ["OW-ENV","OWID 7E"], #Environmental sensor
"81" => ["DS1420","OWID 81"], "81" => ["DS1420","OWID 81"],
"A6" => ["DS2438","OWMULTI DS2438a"],
"FF" => ["LCD","OWLCD"] "FF" => ["LCD","OWLCD"]
); );
@ -98,7 +99,7 @@ use vars qw{%owg_family %gets %sets $owx_version $owx_debug};
); );
#-- some globals needed for the 1-Wire module #-- some globals needed for the 1-Wire module
$owx_version="7.10"; $owx_version="7.11";
#-- debugging now verbosity, this is just for backward compatibility #-- debugging now verbosity, this is just for backward compatibility
$owx_debug=0; $owx_debug=0;

View File

@ -31,7 +31,7 @@
######################################################################################## ########################################################################################
# #
# $hash->{DeviceName} = # $hash->{DeviceName} =
# $hash->{INTERFACE} = "COC/CUNO"; # $hash->{INTERFACE} = "COC/CUNO/CUBE";
# $hash->{HWDEVICE} = # $hash->{HWDEVICE} =
# $hash->{TYPE} = "OWX"; # $hash->{TYPE} = "OWX";
# #
@ -54,7 +54,7 @@ sub new($) {
return bless { return bless {
hash => $hash, hash => $hash,
#-- module version #-- module version
version => "7.10" version => "7.11"
}, $class; }, $class;
} }
@ -76,7 +76,7 @@ sub Define($) {
#-- check syntax #-- check syntax
if(int(@a) < 3){ if(int(@a) < 3){
return "OWX_CCC::Define Syntax error - must be define <name> OWX <cuno/coc-device>" return "OWX_CCC::Define Syntax error - must be define <name> OWX <cuno/coc/cube-device>"
} }
my $name = $a[0]; my $name = $a[0];
@ -85,7 +85,7 @@ sub Define($) {
$hash->{DeviceName} = $dev; $hash->{DeviceName} = $dev;
#-- Second step in case of CUNO: See if we can open it #-- Second step in case of CUNO: See if we can open it
my $msg = "OWX_CCC::Define COC/CUNO device $dev"; my $msg = "OWX_CCC::Define COC/CUNO/CUBE device $dev";
#-- hash des COC/CUNO #-- hash des COC/CUNO
my $hwdevice = $main::defs{$dev}; my $hwdevice = $main::defs{$dev};
if(!$hwdevice){ if(!$hwdevice){
@ -98,7 +98,7 @@ sub Define($) {
#-- store with OWX device #-- store with OWX device
$hash->{DeviceName} = $dev; $hash->{DeviceName} = $dev;
$hash->{ASYNCHRONOUS} = 0; $hash->{ASYNCHRONOUS} = 0;
$hash->{INTERFACE} = "COC/CUNO"; $hash->{INTERFACE} = "COC/CUNO/CUBE";
$hash->{HWDEVICE} = $hwdevice; $hash->{HWDEVICE} = $hwdevice;
#-- loop for some time until the state is "Initialized" #-- loop for some time until the state is "Initialized"
@ -108,7 +108,7 @@ sub Define($) {
select(undef,undef,undef,3); select(undef,undef,undef,3);
} }
main::Log(1, "OWX_CCC::Define Can't open ".$dev) if( $hwdevice->{STATE} ne "Initialized"); main::Log(1, "OWX_CCC::Define Can't open ".$dev) if( $hwdevice->{STATE} ne "Initialized");
#-- reset the 1-Wire system in COC/CUNO #-- reset the 1-Wire system in COC/CUNO/CUBE
main::CUL_SimpleWrite($hwdevice, "Oi"); main::CUL_SimpleWrite($hwdevice, "Oi");
main::Log3 $name,1,"OWX_CCC::Define warning: version ".$self->{version}." not identical to OWX version ".$main::owx_version main::Log3 $name,1,"OWX_CCC::Define warning: version ".$self->{version}." not identical to OWX version ".$main::owx_version
@ -160,6 +160,11 @@ sub Detect () {
$interface="CUNO"; $interface="CUNO";
$ress .= "DS2482 / CUNO detected in $hwdevice->{NAME}"; $ress .= "DS2482 / CUNO detected in $hwdevice->{NAME}";
$ret=1; $ret=1;
#-- CUBE
}elsif( $ob =~ m/.*CUBE.*/){
$interface="CUBE";
$ress .= "DS2482 / CUBE detected in $hwdevice->{NAME}";
$ret=1;
#-- something else #-- something else
} else { } else {
$ret=0; $ret=0;
@ -423,7 +428,7 @@ sub Read(@) {
} }
} }
if( $numget >= $numexp){ if( $numget >= $numexp){
main::OWX_WDBGL($name,1,"OWX_CCC::Read from CUNO with error=$err: ",$buffer); main::OWX_WDBGL($name,4,"OWX_CCC::Read from CUNO with error=$err: ",$buffer);
return $buffer return $buffer
#-- ultimate failure #-- ultimate failure
}else{ }else{
@ -642,3 +647,4 @@ See <a href="/fhem/docs/commandref.html#OWX">OWX</a>
<a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a> <a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a>
</ul> </ul>
=end html_DE =end html_DE
=cut

View File

@ -58,7 +58,7 @@ sub new($) {
return bless { return bless {
hash => $hash, hash => $hash,
#-- module version #-- module version
version => "7.10" version => "7.11"
}, $class; }, $class;
} }
@ -714,3 +714,4 @@ See <a href="/fhem/docs/commandref.html#OWX">OWX</a>
<a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a> <a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a>
</ul> </ul>
=end html_DE =end html_DE
=cut

View File

@ -59,7 +59,7 @@ sub new($) {
#-- OWX device #-- OWX device
hash => $hash, hash => $hash,
#-- module version #-- module version
version => "7.08", version => "7.11",
#-- baud rate serial interface #-- baud rate serial interface
baud => 9600, baud => 9600,
#-- 16 byte search string #-- 16 byte search string
@ -97,7 +97,7 @@ sub Define ($) {
$hash->{ASYNCHRONOUS} = 0; $hash->{ASYNCHRONOUS} = 0;
main::Log3 $hash->{NAME},1,"OWX_SER::Define warning: version ".$self->{version}." not identical to OWX version ".$main::owx_version main::Log3 $hash->{NAME},1,"OWX_SER::Define warning: version ".$self->{version}." not identical to OWX version ".$main::owx_version
if( $hash->{version} ne $main::owx_version); if( $self->{version} ne $main::owx_version);
#-- call low level init function for the device #-- call low level init function for the device
$self->Init(); $self->Init();
@ -927,3 +927,4 @@ See <a href="/fhem/docs/commandref.html#OWX">OWX</a>
<a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a> <a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a>
</ul> </ul>
=end html_DE =end html_DE
=cut

View File

@ -60,7 +60,7 @@ sub new($) {
#-- OWX device #-- OWX device
hash => $hash, hash => $hash,
#-- module version #-- module version
version => "7.08", version => "7.11",
#-- 16 byte search string #-- 16 byte search string
search => [0,0,0,0 ,0,0,0,0, 0,0,0,0, 0,0,0,0], search => [0,0,0,0 ,0,0,0,0, 0,0,0,0, 0,0,0,0],
ROM_ID => [0,0,0,0 ,0,0,0,0], ROM_ID => [0,0,0,0 ,0,0,0,0],
@ -96,8 +96,8 @@ sub Define ($) {
$hash->{DeviceName} = $ip.":".$port; $hash->{DeviceName} = $ip.":".$port;
$hash->{ASYNCHRONOUS} = 0; $hash->{ASYNCHRONOUS} = 0;
main::Log3 $hash->{NAME},1,"OWX_TCP::Define warning: version ".$hash->{version}." not identical to OWX version "..$main::owx_version main::Log3 $hash->{NAME},1,"OWX_TCP::Define warning: version ".$self->{version}." not identical to OWX version "..$main::owx_version
if( $hash->{version} ne $main::owx_version ); if( $self->{version} ne $main::owx_version );
#-- call low level init function for the device #-- call low level init function for the device
$self->Init(); $self->Init();
@ -897,3 +897,4 @@ See <a href="/fhem/docs/commandref.html#OWX">OWX</a>
<a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a> <a href="http://fhemwiki.de/wiki/Interfaces_f%C3%BCr_1-Wire">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#OWX">OWX</a>
</ul> </ul>
=end html_DE =end html_DE
=cut

View File

@ -46,7 +46,7 @@ no warnings 'deprecated';
sub Log($$); sub Log($$);
my $owx_version="7.01"; my $owx_version="7.02";
#-- flexible channel name #-- flexible channel name
my ($owg_channel,$owg_schannel); my ($owg_channel,$owg_schannel);
@ -200,6 +200,9 @@ sub OWMULTI_Define ($$) {
if( $fam eq "26" ){ if( $fam eq "26" ){
$model = "DS2438"; $model = "DS2438";
CommandAttr (undef,"$name model DS2438"); CommandAttr (undef,"$name model DS2438");
}elsif( $fam eq "A6" ){
$model = "DS2438a";
CommandAttr (undef,"$name model DS2438a");
}else{ }else{
return "OWMULTI: Wrong 1-Wire device family $fam"; return "OWMULTI: Wrong 1-Wire device family $fam";
} }
@ -211,6 +214,9 @@ sub OWMULTI_Define ($$) {
if( $model eq "DS2438" ){ if( $model eq "DS2438" ){
$fam = "26"; $fam = "26";
CommandAttr (undef,"$name model DS2438"); CommandAttr (undef,"$name model DS2438");
}elsif( $model eq "DS2438a" ){
$fam = "A6";
CommandAttr (undef,"$name model DS2438a");
}else{ }else{
return "OWMULTI: Wrong 1-Wire device model $model"; return "OWMULTI: Wrong 1-Wire device model $model";
} }
@ -842,6 +848,7 @@ sub OWXMULTI_BinValues($$$$$$$) {
#-- this must be different for the different device types #-- this must be different for the different device types
# family = 26 => DS2438 # family = 26 => DS2438
# family = A6 => DS2438a
#-- transform binary rep of VDD #-- transform binary rep of VDD
if( $context eq "ds2438.getvdd") { if( $context eq "ds2438.getvdd") {
#-- possible addtional check: $data[0] must be 08 #-- possible addtional check: $data[0] must be 08
@ -1349,6 +1356,7 @@ sub OWXMULTI_PT_SetValues($@) {
<a name="OWMULTI"></a> <a name="OWMULTI"></a>
<h3>OWMULTI</h3> <h3>OWMULTI</h3>
<ul>
<p>FHEM module to commmunicate with 1-Wire multi-sensors, currently the DS2438 smart battery <p>FHEM module to commmunicate with 1-Wire multi-sensors, currently the DS2438 smart battery
monitor<br /> <br />This 1-Wire module works with the OWX interface module or with the OWServer interface module monitor<br /> <br />This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer). (prerequisite: Add this module's name to the list of clients in OWServer).
@ -1376,6 +1384,9 @@ sub OWXMULTI_PT_SetValues($@) {
<li>model DS2438 with family id 26 (default if the model parameter is omitted). <li>model DS2438 with family id 26 (default if the model parameter is omitted).
Measured is a temperature value, an external voltage and the current supply Measured is a temperature value, an external voltage and the current supply
voltage</li> voltage</li>
<li>model DS2438a with family id A6.
Measured is a temperature value, an external voltage and the current supply
voltage</li>
</ul> </ul>
</li> </li>
<li> <li>
@ -1452,6 +1463,6 @@ sub OWXMULTI_PT_SetValues($@) {
<br />unit of measurement (temperature scale), default is Celsius = &deg;C </li> <br />unit of measurement (temperature scale), default is Celsius = &deg;C </li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li> <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul> </ul>
</ul>
=end html =end html
=cut =cut