2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

ZWave: MANUFACTURER_PROPRIETARY structures added (Forum #27455)

git-svn-id: https://svn.fhem.de/fhem/trunk@6630 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-09-29 09:49:06 +00:00
parent 6826a47b52
commit bee1002750
2 changed files with 45 additions and 7 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- feature: ZWave: Fibaro_FGRM222 MANUFACTURER_PROPRIETARY class
- feature: sequence: reportEvents attribtue added - feature: sequence: reportEvents attribtue added
- feature: SYSMON: RAM and SWAP Readings on OSX - feature: SYSMON: RAM and SWAP Readings on OSX
- change: 34_NUT: removed calculation of values. Use userReadings instead. - change: 34_NUT: removed calculation of values. Use userReadings instead.

View File

@ -18,7 +18,9 @@ use vars qw(%zw_func_id);
use vars qw(%zw_type6); use vars qw(%zw_type6);
my @zwave_models = qw( my @zwave_models = qw(
Everspring_AN1582 Everspring_AN1583 Everspring_AN1582
Everspring_AN1583
Fibaro_FGRM222
); );
my %zwave_id2class; my %zwave_id2class;
@ -244,7 +246,7 @@ my %zwave_class = (
MULTI_CHANNEL_ASSOCIATION=> { id => '8e', }, # aka MULTI_INSTANCE_ASSOCIATION MULTI_CHANNEL_ASSOCIATION=> { id => '8e', }, # aka MULTI_INSTANCE_ASSOCIATION
MULTI_CMD => { id => '8f', }, # Handled in Parse MULTI_CMD => { id => '8f', }, # Handled in Parse
ENERGY_PRODUCTION => { id => '90', }, ENERGY_PRODUCTION => { id => '90', },
MANUFACTURER_PROPRIETARY => { id => '91', }, MANUFACTURER_PROPRIETARY => { id => '91', }, # see manuf_proprietary below
SCREEN_MD => { id => '92', }, SCREEN_MD => { id => '92', },
SCREEN_ATTRIBUTES => { id => '93', }, SCREEN_ATTRIBUTES => { id => '93', },
SIMPLE_AV_CONTROL => { id => '94', }, SIMPLE_AV_CONTROL => { id => '94', },
@ -271,6 +273,14 @@ my %zwave_cmdArgs = (
indicatorDim => "slider,0,1,99", indicatorDim => "slider,0,1,99",
); );
my %manuf_proprietary = ( # MANUFACTURER_PROPRIETARY ist model dependent
Fibaro_FGRM222 => {
set => { positionSlat=>"010f26010100%02x",
positionBlinds=>"010f260102%02x00",},
get => { position=>"010f2602020000", },
parse => { "010f260303(..)(..)" => 'sprintf("position:Blinds %d Slat %d",'.
'hex($1),hex($2))', }, },
);
sub sub
ZWave_Initialize($) ZWave_Initialize($)
@ -352,8 +362,14 @@ ZWave_Cmd($$@)
my %cmdList; my %cmdList;
my $classes = AttrVal($name, "classes", ""); my $classes = AttrVal($name, "classes", "");
foreach my $cl (split(" ", $classes)) { foreach my $cl (split(" ", $classes)) {
my $ptr = $zwave_class{$cl}{$type} if($zwave_class{$cl}{$type}); my $ptr = $zwave_class{$cl}{$type}
if($zwave_class{$cl} && $zwave_class{$cl}{$type});
if($cl eq "MANUFACTURER_PROPRIETARY") {
my $p = $manuf_proprietary{AttrVal($name, "model", "")};
$ptr = $p->{$type} if($p && $p->{$type});
}
next if(!$ptr); next if(!$ptr);
foreach my $k (keys %{$ptr}) { foreach my $k (keys %{$ptr}) {
if(!$cmdList{$k}) { if(!$cmdList{$k}) {
$cmdList{$k}{fmt} = $ptr->{$k}; $cmdList{$k}{fmt} = $ptr->{$k};
@ -730,6 +746,7 @@ ZWave_Parse($$@)
} }
my $name = $hash->{NAME};
my @event; my @event;
my @args = ($arg); # MULTI_CMD handling my @args = ($arg); # MULTI_CMD handling
@ -753,8 +770,13 @@ ZWave_Parse($$@)
my $ptr = $zwave_class{$className}{parse} my $ptr = $zwave_class{$className}{parse}
if($zwave_class{$className}{parse}); if($zwave_class{$className}{parse});
if($className eq "MANUFACTURER_PROPRIETARY") {
my $p = $manuf_proprietary{AttrVal($name, "model", "")};
$ptr = $p->{parse} if($p && $p->{parse})
}
if(!$ptr) { if(!$ptr) {
Log3 $hash, 4, "$hash->{NAME}: Unknown message ($className $arg)"; Log3 $hash, 4, "$name: Unknown message ($className $arg)";
next; next;
} }
@ -765,7 +787,7 @@ ZWave_Parse($$@)
push @event, $val; push @event, $val;
} }
} }
Log3 $hash, 4, "$hash->{NAME}: $className $arg generated no event" Log3 $hash, 4, "$name: $className $arg generated no event"
if(!@event); if(!@event);
} }
@ -788,7 +810,7 @@ ZWave_Parse($$@)
if($vn eq "state"); # different from set if($vn eq "state"); # different from set
} }
readingsEndUpdate($hash, 1); readingsEndUpdate($hash, 1);
return $hash->{NAME}; return $name;
} }
##################################### #####################################
@ -897,6 +919,12 @@ s2Hex($)
takes values from 1 to 99. takes values from 1 to 99.
If the indicator does not support dimming. It is interpreted as on.</li> If the indicator does not support dimming. It is interpreted as on.</li>
<br><br><b>Class MANUFACTURER_PROPRIETARY</b>
<li>positionBlinds<br>
drive blinds to position %</li>
<li>positionSlat<br>
drive slat to position %</li>
<br><br><b>Class PROTECTION</b> <br><br><b>Class PROTECTION</b>
<li>protectionOff<br> <li>protectionOff<br>
device is unprotected</li> device is unprotected</li>
@ -1006,7 +1034,13 @@ s2Hex($)
<br><br><b>Class INDICATOR</b> <br><br><b>Class INDICATOR</b>
<li>indicatorStatus<br> <li>indicatorStatus<br>
return the indicator status of the node, as indState:on, indState:off or indState:dim value. return the indicator status of the node, as indState:on, indState:off or
indState:dim value.
</li>
<br><br><b>Class MANUFACTURER_PROPRIETARY</b>
<li>position<br>
Fibaro FGRM-222: return the blinds position and slat angle.
</li> </li>
<br><br><b>Class MANUFACTURER_SPECIFIC</b> <br><br><b>Class MANUFACTURER_SPECIFIC</b>
@ -1171,6 +1205,9 @@ s2Hex($)
<br><br><b>Class INDICATOR</b> <br><br><b>Class INDICATOR</b>
<li>indState:[on|off|dim value]</li> <li>indState:[on|off|dim value]</li>
<br><br><b>Class MANUFACTURER_PROPRIETARY</b>
<li>position:Blinds [%] Slat [%]</li>
<br><br><b>Class MANUFACTURER_SPECIFIC</b> <br><br><b>Class MANUFACTURER_SPECIFIC</b>
<li>mfs:hexValue hexValue hexValue</li> <li>mfs:hexValue hexValue hexValue</li>