10_ZWave.pm: add fhem_zwave_deviceconfig.xml.gz readings and aeotec ss6 hacks (Forum #44014)
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9888 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -18,6 +18,7 @@ sub ZWave_SetClasses($$$$);
|
|||||||
sub ZWave_addToSendStack($$);
|
sub ZWave_addToSendStack($$);
|
||||||
sub ZWave_secStart($);
|
sub ZWave_secStart($);
|
||||||
sub ZWave_secEnd($);
|
sub ZWave_secEnd($);
|
||||||
|
sub ZWave_configParseModel($;$);
|
||||||
|
|
||||||
use vars qw(%zw_func_id);
|
use vars qw(%zw_func_id);
|
||||||
use vars qw(%zw_type6);
|
use vars qw(%zw_type6);
|
||||||
@@ -102,8 +103,7 @@ my %zwave_class = (
|
|||||||
"..3204(.*)" => 'ZWave_meterSupportedParse($hash, $1)' } },
|
"..3204(.*)" => 'ZWave_meterSupportedParse($hash, $1)' } },
|
||||||
COLOR_CONTROL => { id => '33',
|
COLOR_CONTROL => { id => '33',
|
||||||
get => { ccCapability=> '01', # no more args
|
get => { ccCapability=> '01', # no more args
|
||||||
ccStatus => '03%02x',
|
ccStatus => '03%02x' },
|
||||||
},
|
|
||||||
set => { # Forum #36050
|
set => { # Forum #36050
|
||||||
rgb => '05050000010002%02x03%02x04%02x',
|
rgb => '05050000010002%02x03%02x04%02x',
|
||||||
wcrgb => '050500%02x01%02x02%02x03%02x04%02x' },
|
wcrgb => '050500%02x01%02x02%02x03%02x04%02x' },
|
||||||
@@ -413,6 +413,8 @@ my %zwave_cmdArgs = (
|
|||||||
dim => "slider,0,1,99",
|
dim => "slider,0,1,99",
|
||||||
indicatorDim => "slider,0,1,99",
|
indicatorDim => "slider,0,1,99",
|
||||||
rgb => "colorpicker,RGB",
|
rgb => "colorpicker,RGB",
|
||||||
|
|
||||||
|
configRGBLedColorForTesting => "colorpicker,RGB", # Aeon SmartSwitch 6
|
||||||
},
|
},
|
||||||
get => {
|
get => {
|
||||||
},
|
},
|
||||||
@@ -625,9 +627,7 @@ ZWave_Cmd($$@)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cfgReq) {
|
$type="get" if($cfgReq);
|
||||||
$type="get";
|
|
||||||
}
|
|
||||||
|
|
||||||
my $id = $hash->{nodeIdHex};
|
my $id = $hash->{nodeIdHex};
|
||||||
my $isMc = ($id =~ m/(....)/);
|
my $isMc = ($id =~ m/(....)/);
|
||||||
@@ -1462,20 +1462,25 @@ ZWave_cleanString($$)
|
|||||||
###################################
|
###################################
|
||||||
# Poor mans XML-Parser
|
# Poor mans XML-Parser
|
||||||
sub
|
sub
|
||||||
ZWave_configParseModel($)
|
ZWave_configParseModel($;$)
|
||||||
{
|
{
|
||||||
my ($cfg) = @_;
|
my ($cfg, $my) = @_;
|
||||||
Log 3, "ZWave reading config for $cfg";
|
return if(!$my && ZWave_configParseModel($cfg, 1));
|
||||||
my $fn = $attr{global}{modpath}."/FHEM/lib/openzwave_deviceconfig.xml.gz";
|
|
||||||
|
my $fn = $attr{global}{modpath}."/FHEM/lib/".($my ? "fhem_":"open").
|
||||||
|
"zwave_deviceconfig.xml.gz";
|
||||||
my $gz = gzopen($fn, "rb");
|
my $gz = gzopen($fn, "rb");
|
||||||
if(!$gz) {
|
if(!$gz) {
|
||||||
Log 3, "Can't open $fn: $!";
|
Log 3, "Can't open $fn: $!" if(!$my);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($line, $class, %hash, $cmdName, %classInfo, %group);
|
my ($ret, $line, $class, %hash, $cmdName, %classInfo, %group);
|
||||||
while($gz->gzreadline($line)) { # Search the "file" entry
|
while($gz->gzreadline($line)) { # Search the "file" entry
|
||||||
last if($line =~ m/^\s*<Product.*sourceFile="$cfg"/);
|
if($line =~ m/^\s*<Product.*sourceFile="$cfg"/) {
|
||||||
|
$ret = 1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while($gz->gzreadline($line)) {
|
while($gz->gzreadline($line)) {
|
||||||
@@ -1531,6 +1536,8 @@ ZWave_configParseModel($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$zwave_modelConfig{$cfg} = \%mc;
|
$zwave_modelConfig{$cfg} = \%mc;
|
||||||
|
Log 3, "ZWave got config for $cfg from $fn" if($ret);
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
@@ -1556,6 +1563,11 @@ ZWave_configCheckParam($$$$$@)
|
|||||||
# Support "set XX configYY request" for configRequestAll
|
# Support "set XX configYY request" for configRequestAll
|
||||||
return ("", sprintf("05%02x", $h->{index})) if($type eq "get" || $cfgReq);
|
return ("", sprintf("05%02x", $h->{index})) if($type eq "get" || $cfgReq);
|
||||||
|
|
||||||
|
if($cmd eq "configRGBLedColorForTesting") {
|
||||||
|
return ("6 digit hext number needed","") if($arg[0] !~ m/^[0-9a-f]{6}$/i);
|
||||||
|
return ("", sprintf("04%02x03%s", $h->{index}, $arg[0]));
|
||||||
|
}
|
||||||
|
|
||||||
my $t = $h->{type};
|
my $t = $h->{type};
|
||||||
if($t eq "list") {
|
if($t eq "list") {
|
||||||
my $v = $h->{Item}{$arg[0]};
|
my $v = $h->{Item}{$arg[0]};
|
||||||
|
|||||||
Reference in New Issue
Block a user