mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
21_OWAD.pm: Neue Version 7.01
21_OWCOUNT.pm: Neue Version 7.01 21_OWID.pm: Neue Version 7.01 21_OWLCD.pm: Neue Version 7.01 21_OWMULTI.pm: Neue Version 7.01 21_OWSWITCH.pm: Neue Version 7.01 21_OWTHERM.pm: Neue Version 7.01 21_OWVAR.pm: Neue Version 7.01 95_Alarm.pm: Neue Version git-svn-id: https://svn.fhem.de/fhem/trunk@15339 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c2e72e7b59
commit
279e549058
@ -48,7 +48,7 @@ use ProtoThreads;
|
|||||||
no warnings 'deprecated';
|
no warnings 'deprecated';
|
||||||
sub Log3($$$);
|
sub Log3($$$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- fixed raw channel name, flexible channel name
|
#-- fixed raw channel name, flexible channel name
|
||||||
my @owg_fixed = ("A","B","C","D");
|
my @owg_fixed = ("A","B","C","D");
|
||||||
my @owg_channel = ("A","B","C","D");
|
my @owg_channel = ("A","B","C","D");
|
||||||
@ -60,11 +60,11 @@ my @owg_resoln;
|
|||||||
my @owg_range;
|
my @owg_range;
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"reading" => "",
|
"reading" => ":noArg",
|
||||||
"alarm" => "",
|
"alarm" => ":noArg",
|
||||||
"status" => "",
|
"status" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -218,6 +218,7 @@ sub OWAD_Define ($$) {
|
|||||||
$hash->{PRESENT} = 0;
|
$hash->{PRESENT} = 0;
|
||||||
$hash->{INTERVAL} = $interval;
|
$hash->{INTERVAL} = $interval;
|
||||||
$hash->{ERRCOUNT} = 0;
|
$hash->{ERRCOUNT} = 0;
|
||||||
|
$hash->{ERRSTATE} = 0;
|
||||||
|
|
||||||
#-- Couple to I/O device
|
#-- Couple to I/O device
|
||||||
AssignIoPort($hash);
|
AssignIoPort($hash);
|
||||||
@ -534,7 +535,9 @@ sub OWAD_Get($@) {
|
|||||||
if(int(@a) != 2);
|
if(int(@a) != 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWAD: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWAD: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
@ -548,6 +551,9 @@ sub OWAD_Get($@) {
|
|||||||
return "$name.version => $owx_version";
|
return "$name.version => $owx_version";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-- reset current ERRSTATE
|
||||||
|
$hash->{ERRSTATE} = 0;
|
||||||
|
|
||||||
#-- get reading according to interface type
|
#-- get reading according to interface type
|
||||||
if($a[1] eq "reading") {
|
if($a[1] eq "reading") {
|
||||||
#-- OWX interface
|
#-- OWX interface
|
||||||
@ -708,6 +714,9 @@ sub OWAD_GetValues($) {
|
|||||||
if( $hash->{INTERVAL} == 0 );
|
if( $hash->{INTERVAL} == 0 );
|
||||||
#-- restart timer for updates
|
#-- restart timer for updates
|
||||||
InternalTimer(time()+$hash->{INTERVAL}, "OWAD_GetValues", $hash, 0);
|
InternalTimer(time()+$hash->{INTERVAL}, "OWAD_GetValues", $hash, 0);
|
||||||
|
|
||||||
|
#-- reset current ERRSTATE
|
||||||
|
$hash->{ERRSTATE} = 0;
|
||||||
|
|
||||||
#-- Get readings, alarms and status according to interface type
|
#-- Get readings, alarms and status according to interface type
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
@ -1265,7 +1274,8 @@ sub OWXAD_BinValues($$$$$$$) {
|
|||||||
#-- hash of the busmaster
|
#-- hash of the busmaster
|
||||||
my $master = $hash->{IODev};
|
my $master = $hash->{IODev};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $error = 0;
|
#-- inherit previous error
|
||||||
|
my $error = $hash->{ERRSTATE};
|
||||||
my @data = [];
|
my @data = [];
|
||||||
my $value;
|
my $value;
|
||||||
my $msg;
|
my $msg;
|
||||||
@ -1290,11 +1300,14 @@ sub OWXAD_BinValues($$$$$$$) {
|
|||||||
$msg ="$name: invalid CRC ";
|
$msg ="$name: invalid CRC ";
|
||||||
$error = 1;
|
$error = 1;
|
||||||
}else{
|
}else{
|
||||||
$msg = "$name: no error ";
|
$msg = "$name: no local error, inheritance = $error ";
|
||||||
}
|
}
|
||||||
OWX_WDBGL($name,5-4*$error,"OWXAD_BinValues: context $context ".$msg,$res);
|
OWX_WDBGL($name,5-4*$error,"OWXAD_BinValues: context $context ".$msg,$res);
|
||||||
$hash->{ERRCOUNT}=$hash->{ERRCOUNT}+1
|
if( $error ){
|
||||||
if( $error );
|
$hash->{ERRCOUNT}++;
|
||||||
|
$hash->{ERRSTATE} = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#=============== get the voltage reading ===============================
|
#=============== get the voltage reading ===============================
|
||||||
if( $context =~ /^ds2450.getreading/ ){
|
if( $context =~ /^ds2450.getreading/ ){
|
||||||
|
@ -47,7 +47,7 @@ no warnings 'deprecated';
|
|||||||
|
|
||||||
sub Log3($$$);
|
sub Log3($$$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- fixed raw channel name, flexible channel name
|
#-- fixed raw channel name, flexible channel name
|
||||||
my @owg_fixed = ("A","B");
|
my @owg_fixed = ("A","B");
|
||||||
my @owg_channel = ("A","B");
|
my @owg_channel = ("A","B");
|
||||||
@ -58,15 +58,15 @@ my $owgmodel;
|
|||||||
my $owgauto = 0;
|
my $owgauto = 0;
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"mcache" => "",
|
"mcache" => "",
|
||||||
"memory" => "",
|
"memory" => "",
|
||||||
"midnight" => "",
|
"midnight" => "",
|
||||||
"raw" => "",
|
"raw" => "",
|
||||||
"counters" => "",
|
"counters" => ":noArg",
|
||||||
"month" => "",
|
"month" => ":noArg",
|
||||||
"year" => "",
|
"year" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -372,7 +372,13 @@ sub OWCOUNT_ChannelNames($) {
|
|||||||
my $state = $hash->{READINGS}{"state"}{VAL};
|
my $state = $hash->{READINGS}{"state"}{VAL};
|
||||||
|
|
||||||
my ($cname,@cnama,$unit,@unarr,$runit,$period);
|
my ($cname,@cnama,$unit,@unarr,$runit,$period);
|
||||||
|
|
||||||
|
my $nomemory = defined($attr{$name}{"nomemory"}) ? $attr{$name}{"nomemory"} : 0;
|
||||||
|
$gets{"memory"} = ($nomemory) ? ":noArg" : ":0,1,2,3,4,5,6,7,8,9,10,11,12,13";
|
||||||
|
$gets{"mcache"} = $gets{"memory"};
|
||||||
|
|
||||||
|
$gets{"midnight"}=":";
|
||||||
|
|
||||||
for (my $i=0;$i<int(@owg_fixed);$i++){
|
for (my $i=0;$i<int(@owg_fixed);$i++){
|
||||||
#-- name
|
#-- name
|
||||||
$cname = defined($attr{$name}{$owg_fixed[$i]."Name"}) ? $attr{$name}{$owg_fixed[$i]."Name"} : "$owg_fixed[$i]";
|
$cname = defined($attr{$name}{$owg_fixed[$i]."Name"}) ? $attr{$name}{$owg_fixed[$i]."Name"} : "$owg_fixed[$i]";
|
||||||
@ -391,6 +397,10 @@ sub OWCOUNT_ChannelNames($) {
|
|||||||
#-- put into readings
|
#-- put into readings
|
||||||
$owg_channel[$i]=$cnama[0];
|
$owg_channel[$i]=$cnama[0];
|
||||||
$hash->{READINGS}{$owg_channel[$i]}{ABBR} = $cnama[1];
|
$hash->{READINGS}{$owg_channel[$i]}{ABBR} = $cnama[1];
|
||||||
|
$gets{"midnight"} .= $cnama[0];
|
||||||
|
$gets{"midnight"} .= ","
|
||||||
|
if ($i<(int(@owg_fixed)-1))
|
||||||
|
;
|
||||||
$hash->{READINGS}{$owg_channel[$i]}{UNIT} = $unit;
|
$hash->{READINGS}{$owg_channel[$i]}{UNIT} = $unit;
|
||||||
|
|
||||||
$period = defined($attr{$name}{$owg_fixed[$i]."Period"}) ? $attr{$name}{$owg_fixed[$i]."Period"} : "hour";
|
$period = defined($attr{$name}{$owg_fixed[$i]."Period"}) ? $attr{$name}{$owg_fixed[$i]."Period"} : "hour";
|
||||||
@ -426,6 +436,7 @@ sub OWCOUNT_ChannelNames($) {
|
|||||||
$hash->{READINGS}{$owg_rate[$i]}{ABBR} = $cnama[1];
|
$hash->{READINGS}{$owg_rate[$i]}{ABBR} = $cnama[1];
|
||||||
$hash->{READINGS}{$owg_rate[$i]}{UNIT} = $unit;
|
$hash->{READINGS}{$owg_rate[$i]}{UNIT} = $unit;
|
||||||
}
|
}
|
||||||
|
$gets{"raw"} = $gets{"midnight"};
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
@ -676,9 +687,12 @@ sub OWCOUNT_Get($@) {
|
|||||||
if(int(@a) < 2);
|
if(int(@a) < 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWCOUNT: get $name with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWCOUNT: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
if($a[1] eq "id") {
|
if($a[1] eq "id") {
|
||||||
$value = $hash->{ROM_ID};
|
$value = $hash->{ROM_ID};
|
||||||
@ -1179,7 +1193,6 @@ sub OWCOUNT_ParseMidnight($$$) {
|
|||||||
} else {
|
} else {
|
||||||
$strval = 0.0;
|
$strval = 0.0;
|
||||||
}
|
}
|
||||||
#Log 1,"============> Parsed $name midnight value $strval";
|
|
||||||
$hash->{owg_midnight}->[$page-14] = $strval;
|
$hash->{owg_midnight}->[$page-14] = $strval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1323,8 +1336,6 @@ sub OWCOUNT_SetPage ($$$) {
|
|||||||
#-- check if memory usage has been disabled
|
#-- check if memory usage has been disabled
|
||||||
my $nomemory = defined($attr{$name}{"nomemory"}) ? $attr{$name}{"nomemory"} : 0;
|
my $nomemory = defined($attr{$name}{"nomemory"}) ? $attr{$name}{"nomemory"} : 0;
|
||||||
|
|
||||||
#Log 1,"=========> device $name set page $page with nomemory=$nomemory and data of length ".length($data)." has data >$data< ";
|
|
||||||
|
|
||||||
$data=sprintf("%-32s",$data);
|
$data=sprintf("%-32s",$data);
|
||||||
|
|
||||||
if( $nomemory==0 ){
|
if( $nomemory==0 ){
|
||||||
@ -1607,7 +1618,7 @@ sub OWXCOUNT_BinValues($$$$$$$) {
|
|||||||
}else{
|
}else{
|
||||||
$msg = "$name: no error ";
|
$msg = "$name: no error ";
|
||||||
}
|
}
|
||||||
OWX_WDBGL($name,5-$error*4,"=====================> OWXCOUNT_BinValues getpage: ".$msg,$res);
|
OWX_WDBGL($name,5-$error*4,"OWXCOUNT_BinValues getpage: ".$msg,$res);
|
||||||
|
|
||||||
#--
|
#--
|
||||||
my $nomemory = defined($attr{$name}{"nomemory"}) ? $attr{$name}{"nomemory"} : 0;
|
my $nomemory = defined($attr{$name}{"nomemory"}) ? $attr{$name}{"nomemory"} : 0;
|
||||||
@ -1627,7 +1638,7 @@ sub OWXCOUNT_BinValues($$$$$$$) {
|
|||||||
#if ( ($data[4] | $data[5] | $data[6] | $data[7]) ne "\x00" ){
|
#if ( ($data[4] | $data[5] | $data[6] | $data[7]) ne "\x00" ){
|
||||||
# $error = 1;
|
# $error = 1;
|
||||||
# my $msg = "$name: invalid data in counter page ".ord($data[4])." ".ord($data[5])." ".ord($data[6])." ".ord($data[7]);
|
# my $msg = "$name: invalid data in counter page ".ord($data[4])." ".ord($data[5])." ".ord($data[6])." ".ord($data[7]);
|
||||||
# OWX_WDBGL($name,1,"=====================> OWXCOUNT_BinValues getpage counter: ".$msg,"")
|
# OWX_WDBGL($name,1,"OWXCOUNT_BinValues getpage counter: ".$msg,"")
|
||||||
#}
|
#}
|
||||||
if( !$error ){
|
if( !$error ){
|
||||||
#-- counter value
|
#-- counter value
|
||||||
@ -1656,7 +1667,7 @@ sub OWXCOUNT_BinValues($$$$$$$) {
|
|||||||
}else{
|
}else{
|
||||||
$msg = "$name: no error ";
|
$msg = "$name: no error ";
|
||||||
}
|
}
|
||||||
OWX_WDBGL($name,5-$error*4,"=====================> OWXCOUNT_BinValues: setpage ".$msg,$res);
|
OWX_WDBGL($name,5-$error*4,"OWXCOUNT_BinValues: setpage ".$msg,$res);
|
||||||
|
|
||||||
#-- process results
|
#-- process results
|
||||||
my $select="\x5A".substr($res,10,3);
|
my $select="\x5A".substr($res,10,3);
|
||||||
@ -1678,7 +1689,7 @@ sub OWXCOUNT_BinValues($$$$$$$) {
|
|||||||
}else{
|
}else{
|
||||||
$msg = "$name: no error ";
|
$msg = "$name: no error ";
|
||||||
}
|
}
|
||||||
OWX_WDBGL($name,5-$error*4,"=====================> OWXCOUNT_BinValues: setpage.$page.final ".$msg,$res);
|
OWX_WDBGL($name,5-$error*4,"OWXCOUNT_BinValues: setpage.$page.final ".$msg,$res);
|
||||||
|
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
|
@ -49,12 +49,12 @@ use ProtoThreads;
|
|||||||
no warnings 'deprecated';
|
no warnings 'deprecated';
|
||||||
sub Log3($$$);
|
sub Log3($$$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- declare variables
|
#-- declare variables
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"present" => "",
|
"present" => ":noArg",
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
my %sets = (
|
my %sets = (
|
||||||
"interval" => ""
|
"interval" => ""
|
||||||
@ -301,12 +301,14 @@ sub OWID_Get($@) {
|
|||||||
my $offset;
|
my $offset;
|
||||||
my $factor;
|
my $factor;
|
||||||
|
|
||||||
#-- check syntax
|
#-- check syntax
|
||||||
return "OWID: Get argument is missing @a"
|
return "OWID: Get argument is missing @a"
|
||||||
if(int(@a) != 2);
|
if(int(@a) != 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWID: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWID: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
|
@ -78,7 +78,7 @@ no warnings 'deprecated';
|
|||||||
|
|
||||||
sub Log3($$$);
|
sub Log3($$$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- controller may be HD44780 or KS0073
|
#-- controller may be HD44780 or KS0073
|
||||||
# these values can be changed by attribute for different display
|
# these values can be changed by attribute for different display
|
||||||
# geometries or memory maps
|
# geometries or memory maps
|
||||||
@ -89,11 +89,11 @@ my @lcdpage = (0,32,64,96);
|
|||||||
|
|
||||||
#-- declare variables
|
#-- declare variables
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"memory" => "",
|
"memory" => ":noArg",
|
||||||
"gpio" => "",
|
"gpio" => ":noArg",
|
||||||
"counter" => "",
|
"counter" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
#"register" => "",
|
#"register" => "",
|
||||||
#"data" => ""
|
#"data" => ""
|
||||||
);
|
);
|
||||||
@ -345,7 +345,9 @@ sub OWLCD_Get($@) {
|
|||||||
if(int(@a) < 2);
|
if(int(@a) < 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWLCD: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWLCD: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
@ -504,7 +506,7 @@ sub OWLCD_Set($@) {
|
|||||||
}
|
}
|
||||||
#-- check syntax for setting memory
|
#-- check syntax for setting memory
|
||||||
} elsif( $key eq "memory" ){
|
} elsif( $key eq "memory" ){
|
||||||
return "OWLCD: Set needs two parameters when setting memory page: <#page> <string>"
|
return "OWLCD: Set needs two parameters when setting memory page 0/1: <#page> <string>"
|
||||||
if( int(@a)<4 );
|
if( int(@a)<4 );
|
||||||
$line = ($a[2] =~ m/\d/) ? int($a[2]) : 0;
|
$line = ($a[2] =~ m/\d/) ? int($a[2]) : 0;
|
||||||
$value = $a[3];
|
$value = $a[3];
|
||||||
@ -512,9 +514,9 @@ sub OWLCD_Set($@) {
|
|||||||
$value .= " ".$a[$i];
|
$value .= " ".$a[$i];
|
||||||
}
|
}
|
||||||
#-- check syntax for setting icon
|
#-- check syntax for setting icon
|
||||||
} elsif ( ($key eq "icon") || ($key eq "gpiobit") ){
|
} elsif ( $key eq "icon" ){
|
||||||
if( ($a[2] ne "0") && ($a[2] ne "none") ){
|
if( ($a[2] ne "0") && ($a[2] ne "none") ){
|
||||||
return "OWLCD: Set needs two parameters when setting icon value: <#icon> on/off/blink (resp. 0..5/off/blink for #16)"
|
return "OWLCD: Set needs two parameters when setting icon 0-16 value: <#icon> on/off/blink (resp. 0..5/off/blink for #16)"
|
||||||
if( (int(@a)!=4) );
|
if( (int(@a)!=4) );
|
||||||
$icon = ($a[2] =~ m/\d\d?/) ? $a[2] : 0;
|
$icon = ($a[2] =~ m/\d\d?/) ? $a[2] : 0;
|
||||||
$value = $a[3];
|
$value = $a[3];
|
||||||
@ -524,6 +526,14 @@ sub OWLCD_Set($@) {
|
|||||||
$icon = 0;
|
$icon = 0;
|
||||||
$value = "OFF";
|
$value = "OFF";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-- check syntax for setting gpiobit
|
||||||
|
} elsif ( $key eq "gpiobit" ){
|
||||||
|
return "OWLCD: Set needs two parameters when setting gpiobit 1-3 value: <#bit> on/off"
|
||||||
|
if( (int(@a)!=4) );
|
||||||
|
return "OWLCD: Set gpiobit 1-3 value: <#bit> on/off only possible for bits 1-3"
|
||||||
|
if( $a[2]>3 || $a[2]<1 );
|
||||||
|
|
||||||
#-- check syntax for reset and test and initialize
|
#-- check syntax for reset and test and initialize
|
||||||
} elsif ( ($key eq "reset") || ($key eq "test") || ($key eq "initialize")){
|
} elsif ( ($key eq "reset") || ($key eq "test") || ($key eq "initialize")){
|
||||||
return "OWLCD: Set needs no parameters when setting $key value"
|
return "OWLCD: Set needs no parameters when setting $key value"
|
||||||
@ -553,10 +563,12 @@ sub OWLCD_Set($@) {
|
|||||||
return GP_Catch($@) if $@;
|
return GP_Catch($@) if $@;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#-- set single gpio bit from all off = 1 on = 0
|
#-- set single gpio bit from all off = 1 on = 0
|
||||||
|
# contribution from ext323
|
||||||
if($key eq "gpiobit") {
|
if($key eq "gpiobit") {
|
||||||
my $bit = $a[2];
|
my $bit = $a[2];
|
||||||
$value = lc($a[3]);
|
$value = lc($a[3]);
|
||||||
$value =~ s/on/0/;
|
$value =~ s/on/0/;
|
||||||
$value =~ s/off/1/;
|
$value =~ s/off/1/;
|
||||||
my $vold = $value;
|
my $vold = $value;
|
||||||
@ -569,7 +581,7 @@ sub OWLCD_Set($@) {
|
|||||||
if( $value == 1 ){
|
if( $value == 1 ){
|
||||||
$value = 1<<($bit-1) | ReadingsVal($name,"gpio",0);
|
$value = 1<<($bit-1) | ReadingsVal($name,"gpio",0);
|
||||||
}else{
|
}else{
|
||||||
$value = 6<<($bit-1) & ReadingsVal($name,"gpio",0);
|
$value = ~(1<<($bit-1)) & ReadingsVal($name,"gpio",0);
|
||||||
}
|
}
|
||||||
#-- OWX interface
|
#-- OWX interface
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
|
@ -46,17 +46,17 @@ no warnings 'deprecated';
|
|||||||
|
|
||||||
sub Log($$);
|
sub Log($$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- flexible channel name
|
#-- flexible channel name
|
||||||
my ($owg_channel,$owg_schannel);
|
my ($owg_channel,$owg_schannel);
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"reading" => "",
|
"reading" => ":noArg",
|
||||||
"temperature" => "",
|
"temperature" => ":noArg",
|
||||||
"VDD" => "",
|
"VDD" => ":noArg",
|
||||||
"raw" => "",
|
"raw" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -473,7 +473,9 @@ sub OWMULTI_Get($@) {
|
|||||||
if(int(@a) != 2);
|
if(int(@a) != 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWMULTI: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWMULTI: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
@ -492,6 +494,9 @@ sub OWMULTI_Get($@) {
|
|||||||
return "$name.version => $owx_version";
|
return "$name.version => $owx_version";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-- reset current ERRSTATE
|
||||||
|
$hash->{ERRSTATE} = 0;
|
||||||
|
|
||||||
#-- for the other readings we need a new reading
|
#-- for the other readings we need a new reading
|
||||||
#-- OWX interface
|
#-- OWX interface
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
@ -566,6 +571,9 @@ sub OWMULTI_GetValues($) {
|
|||||||
#-- restart timer for updates
|
#-- restart timer for updates
|
||||||
InternalTimer(time()+$hash->{INTERVAL}, "OWMULTI_GetValues", $hash, 0);
|
InternalTimer(time()+$hash->{INTERVAL}, "OWMULTI_GetValues", $hash, 0);
|
||||||
|
|
||||||
|
#-- reset current ERRSTATE
|
||||||
|
$hash->{ERRSTATE} = 0;
|
||||||
|
|
||||||
#-- Get values according to interface type
|
#-- Get values according to interface type
|
||||||
my $interface= $hash->{IODev}->{TYPE};
|
my $interface= $hash->{IODev}->{TYPE};
|
||||||
if( $interface eq "OWX" ){
|
if( $interface eq "OWX" ){
|
||||||
@ -803,7 +811,8 @@ sub OWXMULTI_BinValues($$$$$$$) {
|
|||||||
#-- hash of the busmaster
|
#-- hash of the busmaster
|
||||||
my $master = $hash->{IODev};
|
my $master = $hash->{IODev};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $error = 0;
|
#-- inherit previous error
|
||||||
|
my $error = $hash->{ERRSTATE};
|
||||||
my @data = [];
|
my @data = [];
|
||||||
my ($value,$lsb,$msb,$sign);
|
my ($value,$lsb,$msb,$sign);
|
||||||
my $msg;
|
my $msg;
|
||||||
@ -886,8 +895,8 @@ sub OWXMULTI_BinValues($$$$$$$) {
|
|||||||
|
|
||||||
#-- and now from raw to formatted values
|
#-- and now from raw to formatted values
|
||||||
if( $error ){
|
if( $error ){
|
||||||
$hash->{ERRCOUNT}=$hash->{ERRCOUNT}+1;
|
$hash->{ERRCOUNT}++;
|
||||||
|
$hash->{ERRSTATE} = 1;
|
||||||
}else{
|
}else{
|
||||||
$hash->{PRESENT} = 1;
|
$hash->{PRESENT} = 1;
|
||||||
OWMULTI_FormatValues($hash);
|
OWMULTI_FormatValues($hash);
|
||||||
|
@ -47,16 +47,16 @@ no warnings 'deprecated';
|
|||||||
|
|
||||||
sub Log($$);
|
sub Log($$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
#-- fixed raw channel name, flexible channel name
|
#-- fixed raw channel name, flexible channel name
|
||||||
my @owg_fixed = ("A","B","C","D","E","F","G","H");
|
my @owg_fixed = ("A","B","C","D","E","F","G","H");
|
||||||
my @owg_channel = ("A","B","C","D","E","F","G","H");
|
my @owg_channel = ("A","B","C","D","E","F","G","H");
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"input" => "",
|
"input" => "",
|
||||||
"gpio" => "",
|
"gpio" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -324,6 +324,8 @@ sub OWSWITCH_ChannelNames($) {
|
|||||||
my $state = $hash->{READINGS}{"state"}{VAL};
|
my $state = $hash->{READINGS}{"state"}{VAL};
|
||||||
|
|
||||||
my ($cname,@cnama,$unit,@unarr);
|
my ($cname,@cnama,$unit,@unarr);
|
||||||
|
|
||||||
|
$gets{"input"}=":";
|
||||||
|
|
||||||
for (my $i=0;$i<$cnumber{$attr{$name}{"model"}};$i++){
|
for (my $i=0;$i<$cnumber{$attr{$name}{"model"}};$i++){
|
||||||
#-- name
|
#-- name
|
||||||
@ -332,9 +334,12 @@ sub OWSWITCH_ChannelNames($) {
|
|||||||
if( int(@cnama)!=2){
|
if( int(@cnama)!=2){
|
||||||
push(@cnama,$cnama[0]);
|
push(@cnama,$cnama[0]);
|
||||||
}
|
}
|
||||||
#-- put into readings
|
#-- put into readings and array for display
|
||||||
$owg_channel[$i] = $cnama[0];
|
$owg_channel[$i] = $cnama[0];
|
||||||
$hash->{READINGS}{$owg_channel[$i]}{ABBR} = $cnama[1];
|
$hash->{READINGS}{$owg_channel[$i]}{ABBR} = $cnama[1];
|
||||||
|
$gets{"input"} .= $cnama[0];
|
||||||
|
$gets{"input"} .= ","
|
||||||
|
if ($i<$cnumber{$attr{$name}{"model"}}-1);
|
||||||
|
|
||||||
#-- unit
|
#-- unit
|
||||||
my $unit = defined($attr{$name}{$owg_fixed[$i]."Unit"}) ? $attr{$name}{$owg_fixed[$i]."Unit"} : "ON|OFF";
|
my $unit = defined($attr{$name}{$owg_fixed[$i]."Unit"}) ? $attr{$name}{$owg_fixed[$i]."Unit"} : "ON|OFF";
|
||||||
@ -348,6 +353,8 @@ sub OWSWITCH_ChannelNames($) {
|
|||||||
#-- put into readings
|
#-- put into readings
|
||||||
$hash->{READINGS}{$owg_channel[$i]}{UNIT} = $unit;
|
$hash->{READINGS}{$owg_channel[$i]}{UNIT} = $unit;
|
||||||
}
|
}
|
||||||
|
$sets{"output"}=$gets{"input"};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
@ -438,7 +445,9 @@ sub OWSWITCH_Get($@) {
|
|||||||
if(int(@a) < 2);
|
if(int(@a) < 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWSWITCH: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWSWITCH: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
# FHEM module to commmunicate with 1-Wire temperature sensors DS1820, DS18S20, DS18B20, DS1822
|
# FHEM module to commmunicate with 1-Wire temperature sensors DS1820, DS18S20, DS18B20, DS1822
|
||||||
#
|
#
|
||||||
# Prof. Dr. Peter A. Henning
|
# Prof. Dr. Peter A. Henning
|
||||||
# Norbert Truchsess
|
|
||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
@ -48,13 +47,13 @@ no warnings 'deprecated';
|
|||||||
sub Log3($$$);
|
sub Log3($$$);
|
||||||
sub AttrVal($$$);
|
sub AttrVal($$$);
|
||||||
|
|
||||||
my $owx_version="7.0";
|
my $owx_version="7.01";
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"temperature" => "",
|
"temperature" => ":noArg",
|
||||||
"alarm" => "",
|
"alarm" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -421,7 +420,9 @@ sub OWTHERM_Get($@) {
|
|||||||
if(int(@a) != 2);
|
if(int(@a) != 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWTHERM: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWTHERM: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
|
@ -51,9 +51,9 @@ my $owx_version="7.0";
|
|||||||
my $owg_channel = "";
|
my $owg_channel = "";
|
||||||
|
|
||||||
my %gets = (
|
my %gets = (
|
||||||
"id" => "",
|
"id" => ":noArg",
|
||||||
"value" => "",
|
"value" => ":noArg",
|
||||||
"version" => ""
|
"version" => ":noArg"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -364,7 +364,9 @@ sub OWVAR_Get($@) {
|
|||||||
if(int(@a) < 2);
|
if(int(@a) < 2);
|
||||||
|
|
||||||
#-- check argument
|
#-- check argument
|
||||||
return "OWVAR: Get with unknown argument $a[1], choose one of ".join(" ", sort keys %gets)
|
my $msg = "OWVAR: Get with unknown argument $a[1], choose one of ";
|
||||||
|
$msg .= "$_$gets{$_} " foreach (keys%gets);
|
||||||
|
return $msg
|
||||||
if(!defined($gets{$a[1]}));
|
if(!defined($gets{$a[1]}));
|
||||||
|
|
||||||
#-- get id
|
#-- get id
|
||||||
|
@ -51,7 +51,7 @@ my %alarm_transtable_EN = (
|
|||||||
"status" => "Status",
|
"status" => "Status",
|
||||||
"notstarted" => "Not started",
|
"notstarted" => "Not started",
|
||||||
"next" => "Next",
|
"next" => "Next",
|
||||||
"arm " => "Arm",
|
"arm" => "Arm",
|
||||||
"disarm" => "Disarm",
|
"disarm" => "Disarm",
|
||||||
"armbutton" => "Arming",
|
"armbutton" => "Arming",
|
||||||
"disarmbutton" => "Disarming",
|
"disarmbutton" => "Disarming",
|
||||||
@ -1185,7 +1185,7 @@ sub Alarm_Html($)
|
|||||||
|
|
||||||
<a name="Alarm"></a>
|
<a name="Alarm"></a>
|
||||||
<h3>Alarm</h3>
|
<h3>Alarm</h3>
|
||||||
<a href="https://wiki.fhem.de/wiki/Modul_Alarm">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/commandref.html#Alarm">Alarm</a>
|
<a href="https://wiki.fhem.de/wiki/Modul_Alarm">Deutsche Dokumentation im Wiki</a> vorhanden, die englische Version gibt es hier: <a href="/fhem/docs/commandref.html#Alarm">Alarm</a>
|
||||||
|
|
||||||
=end html_DE
|
=end html_DE
|
||||||
=cut
|
=cut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user