git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2672 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
########################################################################################
|
########################################################################################
|
||||||
#
|
#
|
||||||
# define <name> OWID <FAM_ID> <ROM_ID>
|
# define <name> OWID <FAM_ID> <ROM_ID> or OWID <FAM_ID>.<ROM_ID>
|
||||||
#
|
#
|
||||||
# where <name> may be replaced by any name string
|
# where <name> may be replaced by any name string
|
||||||
#
|
#
|
||||||
@@ -106,15 +106,14 @@ sub OWID_Define ($$) {
|
|||||||
if(int(@a) !=4 );
|
if(int(@a) !=4 );
|
||||||
|
|
||||||
#-- check id
|
#-- check id
|
||||||
if( $a[2] =~ m/^[0-9|a-f|A-F]{2}$/ ) {
|
if( ($a[2] =~ m/^[0-9|a-f|A-F]{2}$/) && ($a[3] =~ m/^[0-9|a-f|A-F]{12}$/)) {
|
||||||
$fam = $a[2];
|
$fam = $a[2];
|
||||||
} else {
|
|
||||||
return "OWID: $a[0] family id $a[2] invalid, specify a 2 digit value";
|
|
||||||
}
|
|
||||||
if( $a[3] =~ m/^[0-9|a-f|A-F]{12}$/ ) {
|
|
||||||
$id = $a[3];
|
$id = $a[3];
|
||||||
|
} elsif( $a[2] =~ m/^0-9|a-f|A-F]{2}\.[0-9|a-f|A-F]{12}$/ ) {
|
||||||
|
$fam = substr($a[2],0,2);
|
||||||
|
$id = substr($a[2],3);
|
||||||
} else {
|
} else {
|
||||||
return "OWID: $a[0] ID $a[3] invalid, specify a 12 digit value";
|
return "OWID: $def is invalid, specify a 2 digit 12 digit or 2.12 digit value";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- 1-Wire ROM identifier in the form "FF.XXXXXXXXXXXX.YY"
|
#-- 1-Wire ROM identifier in the form "FF.XXXXXXXXXXXX.YY"
|
||||||
@@ -213,24 +212,30 @@ sub OWID_Undef ($) {
|
|||||||
<a name="OWID"></a>
|
<a name="OWID"></a>
|
||||||
<h3>OWID</h3>
|
<h3>OWID</h3>
|
||||||
<p>FHEM module for 1-Wire devices that know only their unique ROM ID<br />
|
<p>FHEM module for 1-Wire devices that know only their unique ROM ID<br />
|
||||||
<br />Note:<br /> This 1-Wire module so far works only with the OWX interface module.
|
<br />This 1-Wire module works with the OWX interface module or with the OWServer interface module
|
||||||
Please define an <a href="#OWX">OWX</a> device first. <br /></p>
|
Please define an <a href="#OWX">OWX</a> device or <a href="#OWServer">OWServer</a> device first. <br /></p>
|
||||||
<br /><h4>Example</h4><br />
|
<br /><h4>Example</h4><br />
|
||||||
<p>
|
<p>
|
||||||
<code>define ROM1 OWX_ID OWCOUNT CE780F000000</code>
|
<code>define ROM1 OWX_ID OWCOUNT 09.CE780F000000</code>
|
||||||
<br />
|
<br />
|
||||||
</p><br />
|
</p><br />
|
||||||
<a name="OWIDdefine"></a>
|
<a name="OWIDdefine"></a>
|
||||||
<h4>Define</h4>
|
<h4>Define</h4>
|
||||||
<p>
|
<p>
|
||||||
<code>define <name> OWID <id> </code>
|
<code>define <name> OWID <fam> <id> </code> or <br/>
|
||||||
|
<code>define <name> OWID <fam>.<id> </code>
|
||||||
<br /><br /> Define a 1-Wire device.<br /><br />
|
<br /><br /> Define a 1-Wire device.<br /><br />
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>
|
||||||
|
<code><fam></code>
|
||||||
|
<br />2-character unique family id, see above
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code><id></code>
|
<code><id></code>
|
||||||
<br />12-character unique ROM id of the converter device without family id and CRC
|
<br />12-character unique ROM id of the converter device without family id and CRC
|
||||||
code </li>
|
code
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
<a name="OWIDget"></a>
|
<a name="OWIDget"></a>
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
#
|
#
|
||||||
########################################################################################
|
########################################################################################
|
||||||
#
|
#
|
||||||
# define <name> OWLCD <ROM_ID>
|
# define <name> OWLCD <ROM_ID> or FF.<ROM_ID>
|
||||||
#
|
#
|
||||||
# where <name> may be replaced by any name string
|
# where <name> may be replaced by any name string
|
||||||
#
|
#
|
||||||
# <ROM_ID> is a 12 character (6 byte) 1-Wire ROM ID
|
# <ROM_ID> is a 12 character (6 byte) 1-Wire ROM ID
|
||||||
# without Family ID, e.g. A2D90D000800
|
# without Family ID, e.g. A2D90D000800
|
||||||
#
|
#
|
||||||
# get <name> id => FAM_ID.ROM_ID.CRC
|
# get <name> id => FF.ROM_ID.CRC
|
||||||
# get <name> present => 1 if device present, 0 if not
|
# get <name> present => 1 if device present, 0 if not
|
||||||
# get <name> gpio => current state of the gpio pins (15 = all off, 0 = all on)
|
# get <name> gpio => current state of the gpio pins (15 = all off, 0 = all on)
|
||||||
# get <name> counter => four values (16 Bit) of the gpio counter
|
# get <name> counter => four values (16 Bit) of the gpio counter
|
||||||
@@ -148,8 +148,10 @@ sub OWLCD_Define ($$) {
|
|||||||
#-- check id
|
#-- check id
|
||||||
if( $a[2] =~ m/^[0-9|a-f|A-F]{12}$/ ) {
|
if( $a[2] =~ m/^[0-9|a-f|A-F]{12}$/ ) {
|
||||||
$id = $a[2];
|
$id = $a[2];
|
||||||
|
} elsif( $a[2] =~ m/^FF\.[0-9|a-f|A-F]{12}$/ ) {
|
||||||
|
$id = substr($a[2],3);
|
||||||
} else {
|
} else {
|
||||||
return "OWLCD: $a[0] ID $a[2] invalid, specify a 12 digit value";
|
return "OWLCD: $a[0] ID $a[2] invalid, specify a 12 digit or 2.12 digit value";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- 1-Wire ROM identifier in the form "FF.XXXXXXXXXXXX.YY"
|
#-- 1-Wire ROM identifier in the form "FF.XXXXXXXXXXXX.YY"
|
||||||
@@ -164,7 +166,7 @@ sub OWLCD_Define ($$) {
|
|||||||
|
|
||||||
#-- Couple to I/O device
|
#-- Couple to I/O device
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
if( !defined($hash->{IODev}->{NAME}) | !defined($hash->{IODev}) | !defined($hash->{IODev}->{PRESENT}) ){
|
if( (!defined($hash->{IODev}->{NAME})) || (!defined($hash->{IODev})) || (!defined($hash->{IODev}->{PRESENT})) ){
|
||||||
return "OWSWITCH: Warning, no 1-Wire I/O device found for $name.";
|
return "OWSWITCH: Warning, no 1-Wire I/O device found for $name.";
|
||||||
}
|
}
|
||||||
if( $hash->{IODev}->{PRESENT} != 1 ){
|
if( $hash->{IODev}->{PRESENT} != 1 ){
|
||||||
@@ -992,7 +994,9 @@ sub OWXLCD_Trans($) {
|
|||||||
$msg =~ s/Ö/\x5C/g;
|
$msg =~ s/Ö/\x5C/g;
|
||||||
$msg =~ s/Ü/\x5E/g;
|
$msg =~ s/Ü/\x5E/g;
|
||||||
$msg =~ s/ß/\xBE/g;
|
$msg =~ s/ß/\xBE/g;
|
||||||
#--take out degree sign
|
#-- replace other special chars
|
||||||
|
$msg =~s/_/\xC4/g;
|
||||||
|
#--take out HTML degree sign
|
||||||
if( $msg =~ m/.*\°\;.*/ ) {
|
if( $msg =~ m/.*\°\;.*/ ) {
|
||||||
my @ma = split(/\°\;/,$msg);
|
my @ma = split(/\°\;/,$msg);
|
||||||
$msg = $ma[0]."\x80".$ma[1];
|
$msg = $ma[0]."\x80".$ma[1];
|
||||||
@@ -1053,7 +1057,7 @@ sub OWXLCD_SetMemory($$$) {
|
|||||||
=pod
|
=pod
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
<a name="OWLCD"></a>
|
<a name="OWLCD"></a>
|
||||||
<h3>OWLCD</h3>
|
<h3>OWLCD</h3>
|
||||||
<p>FHEM module to commmunicate with the <a
|
<p>FHEM module to commmunicate with the <a
|
||||||
href="http://www.louisswart.co.za/1-Wire_Overview.html">1-Wire LCD controller</a>
|
href="http://www.louisswart.co.za/1-Wire_Overview.html">1-Wire LCD controller</a>
|
||||||
@@ -1070,7 +1074,8 @@ sub OWXLCD_SetMemory($$$) {
|
|||||||
<a name="OWLCDdefine"></a>
|
<a name="OWLCDdefine"></a>
|
||||||
<h4>Define</h4>
|
<h4>Define</h4>
|
||||||
<p>
|
<p>
|
||||||
<code>define <name> OWLCD <id></code>
|
<code>define <name> OWLCD <id></code> or <br/>
|
||||||
|
<code>define <name> OWLCD FF.<id></code>
|
||||||
<br /><br /> Define a 1-Wire LCD device.<br /><br /></p>
|
<br /><br /> Define a 1-Wire LCD device.<br /><br /></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -1143,4 +1148,4 @@ sub OWXLCD_SetMemory($$$) {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
=end html
|
=end html
|
||||||
=cut
|
=cut
|
||||||
@@ -118,9 +118,9 @@ sub OWMULTI_Initialize ($) {
|
|||||||
#tempOffset = a temperature offset added to the temperature reading for correction
|
#tempOffset = a temperature offset added to the temperature reading for correction
|
||||||
#tempUnit = a unit of measure: C/F/K
|
#tempUnit = a unit of measure: C/F/K
|
||||||
$hash->{AttrList}= "IODev do_not_notify:0,1 showtime:0,1 model:DS2438 loglevel:0,1,2,3,4,5 ".
|
$hash->{AttrList}= "IODev do_not_notify:0,1 showtime:0,1 model:DS2438 loglevel:0,1,2,3,4,5 ".
|
||||||
"event-on-update-reading event-on-change-reading ".
|
|
||||||
"tempOffset tempUnit:C,Celsius,F,Fahrenheit,K,Kelvin ".
|
"tempOffset tempUnit:C,Celsius,F,Fahrenheit,K,Kelvin ".
|
||||||
"VName VUnit VFunction";
|
"VName VUnit VFunction".
|
||||||
|
$readingFnAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ sub OWSWITCH_Initialize ($) {
|
|||||||
$hash->{SetFn} = "OWSWITCH_Set";
|
$hash->{SetFn} = "OWSWITCH_Set";
|
||||||
|
|
||||||
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 model:DS2413,DS2406,DS2408 loglevel:0,1,2,3,4,5 ".
|
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 model:DS2413,DS2406,DS2408 loglevel:0,1,2,3,4,5 ".
|
||||||
"event-on-update-reading event-on-change-reading ".
|
"stateS ".
|
||||||
"stateS ";
|
$readingFnAttributes;
|
||||||
|
|
||||||
#-- correct list of attributes
|
#-- correct list of attributes
|
||||||
for( my $i=0;$i<8;$i++ ){
|
for( my $i=0;$i<8;$i++ ){
|
||||||
|
|||||||
@@ -732,7 +732,7 @@ sub OWXTHERM_GetValues($) {
|
|||||||
my ($i,$j,$k,@data,$ow_thn,$ow_tln);
|
my ($i,$j,$k,@data,$ow_thn,$ow_tln);
|
||||||
my $change = 0;
|
my $change = 0;
|
||||||
|
|
||||||
#-- For default, perform the conversion NOT now
|
#-- For default, perform the conversion now
|
||||||
my $con=1;
|
my $con=1;
|
||||||
|
|
||||||
#-- ID of the device
|
#-- ID of the device
|
||||||
|
|||||||
Reference in New Issue
Block a user