2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

10_ZWave.pm: color_contrl changes, crc16 patch (Forum #36050)

git-svn-id: https://svn.fhem.de/fhem/trunk@8428 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-04-13 07:55:01 +00:00
parent cead6f31ca
commit fc21209156

View File

@ -97,28 +97,20 @@ my %zwave_class = (
METER => { id => '32', METER => { id => '32',
get => { meter => "01" }, get => { meter => "01" },
parse => { "..3202(.*)"=> 'ZWave_ParseMeter($hash, $1)' }, }, parse => { "..3202(.*)"=> 'ZWave_ParseMeter($hash, $1)' }, },
COLOR_CONTROL => { id => '33', COLOR_CONTROL => { id => '33',
get => { ccCapabilityGet => '01', # no more args get => { ccCapabilityGet => '01', # no more args
ccStatus => '03', # no more args ccStatus => '03', # no more args
}, },
set => { # Forum #36050 set => { # Forum #36050
resettoWhiteWarm => '050a00ff0101020003000400', rgb => '050a0000010002%02x03%02x04%02x',
# 100% warm, minimal cold, otherwise bulb is dimmed wcrgb => '050a00%02x01%02x02%02x03%02x04%02x', },
resettoWhiteCold => '050a000001ff020003000400', parse => { "043302(.*)"=> 'ccCapabilityGetResponse:$1',
resettoRed => '050a0000010002ff03000400', # 100% red "043304(.*)"=> 'ccStatusResponse:$1', }, },
resettoGreen => '050a00000100020003ff0400', # 100% green
resettoBlue => '050a000001000200030004ff', # 100% blue
resettoYellow => '050A00000100027f037f0400', # 50% red, 50% green
},
parse => { "043302(.*)" => 'ccCapabilityGetResponse:$1', #answer to ccCapabilityGet
"043304(.*)" => 'ccStatusResponse:$1', },
},
ZIP_ADV_CLIENT => { id => '34', }, ZIP_ADV_CLIENT => { id => '34', },
METER_PULSE => { id => '35', }, METER_PULSE => { id => '35', },
BASIC_TARIFF_INFO => { id => '36', }, BASIC_TARIFF_INFO => { id => '36', },
HRV_STATUS => { id => '37', HRV_STATUS => { id => '37',
get => { hrvStatus => "01%02x", get => { hrvStatus => "01%02x",
hrvStatusSupported => "03",}, hrvStatusSupported => "03",},
parse => { "0637020042(....)" => parse => { "0637020042(....)" =>
'sprintf("outdoorTemperature: %0.1f C", s2Hex($1)/100)', 'sprintf("outdoorTemperature: %0.1f C", s2Hex($1)/100)',
@ -337,6 +329,7 @@ my %zwave_cmdArgs = (
set => { set => {
dim => "slider,0,1,99", dim => "slider,0,1,99",
indicatorDim => "slider,0,1,99", indicatorDim => "slider,0,1,99",
rgb => "colorpicker,RGB",
}, },
get => { get => {
}, },
@ -455,6 +448,14 @@ ZWave_Cmd($$@)
} }
} }
if($type eq "set" && $cmd eq "rgb") {
if($a[0] =~ m/0-9A-F/i && $a[0] =~ /^(..)(..)(..)$/) {
@a = (hex($1), hex($2), hex($3));
} else {
return "set rgb: a 6-digit hex number is required";
}
}
if(!$cmdList{$cmd}) { if(!$cmdList{$cmd}) {
my @list; my @list;
foreach my $cmd (sort keys %cmdList) { foreach my $cmd (sort keys %cmdList) {
@ -1327,6 +1328,11 @@ ZWave_Parse($$@)
$arg = sprintf("%s%02x%s", $1, hex($2) & 0x7f, $3); $arg = sprintf("%s%02x%s", $1, hex($2) & 0x7f, $3);
} }
if($arg =~ /^..5601(.*)..../) { # CRC_16_ENCAP: Unwrap encapsulated command
#Log3 $ioName, 4, "CRC FIX, MSG: ($1)"; # see Forum #23494
$arg = sprintf("%02x$1", length($1)/2);
}
my ($baseHash, $baseId, $ep) = ("",$id,""); my ($baseHash, $baseId, $ep) = ("",$id,"");
if($arg =~ /^..6006(..)(.*)/) { # MULTI_CHANNEL CMD_ENCAP, V1, Forum #36126 if($arg =~ /^..6006(..)(.*)/) { # MULTI_CHANNEL CMD_ENCAP, V1, Forum #36126
$ep = $1; $ep = $1;
@ -1664,6 +1670,18 @@ s2Hex($)
set configuration for a specific scene. set configuration for a specific scene.
Parameters are: groupId, sceneId, dimmingDuration. Parameters are: groupId, sceneId, dimmingDuration.
</li> </li>
<br><br><b>Class COLOR_CONTROL</b>
<li>rgb<br>
Set the color of the device as a 6 digit RGB Value (RRGGBB), each color is
specified with a value from 00 to ff.</li>
<li>wcrgb<br>
Used for sending warm white, cold white, red, green and blue values
to device. Values must be decimal (0 - 255) and separated by blanks.
<ul>
set &lt;name&gt; wcrgb 0 255 0 0 0 (setting full cold white)<br>
</ul>
</li>
<br><br><b>Class THERMOSTAT_MODE</b> <br><br><b>Class THERMOSTAT_MODE</b>
<li>tmOff</li> <li>tmOff</li>