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

10_ZWave.pm: add user class (experimental), Forum #36856

git-svn-id: https://svn.fhem.de/fhem/trunk@8541 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-05-07 21:44:57 +00:00
parent 6b49e86236
commit 2a47522dc4

View File

@ -19,23 +19,23 @@ use vars qw(%zw_type6);
my %zwave_id2class;
my %zwave_class = (
NO_OPERATION => { id => '00', },
NO_OPERATION => { id => '00' },
BASIC => { id => '20',
set => { basicValue => "01%02x", },
set => { basicValue => "01%02x" },
get => { basicStatus => "02", },
parse => { "..2001(.*)"=> '"state:basicSet $1"', # Forum #36980
"..2002" => "state:basicGet", # sent by the remote
"..2003(.*)"=> '"basicReport:$1"' }},
CONTROLLER_REPLICATION => { id => '21', },
APPLICATION_STATUS => { id => '22', },
ZIP_SERVICES => { id => '23', },
ZIP_SERVER => { id => '24', },
CONTROLLER_REPLICATION => { id => '21' },
APPLICATION_STATUS => { id => '22' },
ZIP_SERVICES => { id => '23' },
ZIP_SERVER => { id => '24' },
SWITCH_BINARY => { id => '25',
set => { off => "0100",
on => "01FF" },
get => { swbStatus => "02", },
parse => { "03250300" => "state:off",
"032503ff" => "state:on", }, } ,
"032503ff" => "state:on", } } ,
SWITCH_MULTILEVEL => { id => '26',
set => { off => "0100",
on => "01FF",
@ -54,29 +54,29 @@ my %zwave_class = (
swaIncludeOn => "0102",
swaIncludeOnOff => "01ff",
swaOn => "04",
swaOff => "05", },
get => { swaInclude => "02", },
swaOff => "05" },
get => { swaInclude => "02" },
parse => { "03270300" => "swa:none",
"03270301" => "swa:off",
"03270302" => "swa:on",
"032703ff" => "swa:on off", }, },
SWITCH_TOGGLE_BINARY => { id => '28', },
SWITCH_TOGGLE_MULTILEVEL => { id => '29', },
CHIMNEY_FAN => { id => '2a', },
"032703ff" => "swa:on off" } },
SWITCH_TOGGLE_BINARY => { id => '28' },
SWITCH_TOGGLE_MULTILEVEL => { id => '29' },
CHIMNEY_FAN => { id => '2a' },
SCENE_ACTIVATION => { id => '2b',
set => { sceneActivate => "01%02x%02x",},
set => { sceneActivate => "01%02x%02x" },
parse => { "042b01(..)(..)" => '"scene_$1:$2"',
"042b01(..)ff" => 'ZWave_sceneParse($1)',}, },
"042b01(..)ff" => 'ZWave_sceneParse($1)'} },
SCENE_ACTUATOR_CONF => { id => '2c',
set => { sceneConfig => "01%02x%02x80%02x",},
set => { sceneConfig => "01%02x%02x80%02x" },
get => { sceneConfig => "02%02x", },
parse => { "052c03(..)(..)(..)" => '"scene_$1:level $2 duration $3"',}, },
parse => { "052c03(..)(..)(..)" => '"scene_$1:level $2 duration $3"' } },
SCENE_CONTROLLER_CONF => { id => '2d',
set => { sceneConfig => "01%02x%02x%02x",},
set => { sceneConfig => "01%02x%02x%02x" },
get => { sceneConfig => "02%02x", },
parse => { "052d03(..)(..)(..)" => '"group_$1:scene $2 duration $3"',}, },
ZIP_CLIENT => { id => '2e', },
ZIP_ADV_SERVICES => { id => '2f', },
parse => { "052d03(..)(..)(..)" => '"group_$1:scene $2 duration $3"' } },
ZIP_CLIENT => { id => '2e' },
ZIP_ADV_SERVICES => { id => '2f' },
SENSOR_BINARY => { id => '30',
get => { sbStatus => "02", },
parse => { "03300300" => "state:closed",
@ -85,28 +85,28 @@ my %zwave_class = (
"043003(..)08" => '"tamper:$1"', #Philio PHI_PSP01, PSM02-1
"043003000a" => "state:closed", #Philio PSM02-1
"043003ff0a" => "state:open", #Philio PSM02-1
},},
} },
SENSOR_MULTILEVEL => { id => '31',
get => { smStatus => "04" },
parse => { "..3105(..)(..)(.*)" => 'ZWave_multilevelParse($1,$2,$3)'},},
parse => { "..3105(..)(..)(.*)" => 'ZWave_multilevelParse($1,$2,$3)'} },
METER => { id => '32',
get => { meter => "01" },
parse => { "..3202(.*)"=> 'ZWave_meterParse($hash, $1)' }, },
parse => { "..3202(.*)"=> 'ZWave_meterParse($hash, $1)' } },
COLOR_CONTROL => { id => '33',
get => { ccCapabilityGet => '01', # no more args
ccStatus => '03', # no more args
},
set => { # Forum #36050
rgb => '050a0000010002%02x03%02x04%02x',
wcrgb => '050a00%02x01%02x02%02x03%02x04%02x', },
wcrgb => '050a00%02x01%02x02%02x03%02x04%02x' },
parse => { "043302(.*)"=> 'ccCapabilityGetResponse:$1',
"043304(.*)"=> 'ccStatusResponse:$1', }, },
ZIP_ADV_CLIENT => { id => '34', },
METER_PULSE => { id => '35', },
BASIC_TARIFF_INFO => { id => '36', },
"043304(.*)"=> 'ccStatusResponse:$1' } },
ZIP_ADV_CLIENT => { id => '34' },
METER_PULSE => { id => '35' },
BASIC_TARIFF_INFO => { id => '36' },
HRV_STATUS => { id => '37',
get => { hrvStatus => "01%02x",
hrvStatusSupported => "03",},
hrvStatusSupported => "03" },
parse => { "0637020042(....)" =>
'sprintf("outdoorTemperature: %0.1f C", s2Hex($1)/100)',
"0637020142(....)" =>
@ -123,131 +123,136 @@ my %zwave_class = (
'sprintf("remainingFilterLife: %s %%", hex($1))',
"033704(..)" =>
'sprintf("supportedStatus: %s", ZWave_HrvStatus($1))',
},},
THERMOSTAT_HEATING => { id => '38', },
} },
THERMOSTAT_HEATING => { id => '38' },
HRV_CONTROL => { id => '39',
set => { bypassOff => "0400",
bypassOn => "04FF",
ventilationRate => "07%02x", },
ventilationRate => "07%02x" },
get => { bypass => "05",
ventilationRate => "08", },
ventilationRate => "08" },
parse => { "033906(..)"=> '($1 eq "00" ? "bypass:off" : '.
'($1 eq "ff" ? "bypass:on" : '.
'"bypass:dim ".hex($1)))',
"033909(..)"=> 'sprintf("ventilationRate: %s",hex($1))', },},
DCP_CONFIG => { id => '3a', },
DCP_MONITOR => { id => '3b', },
METER_TBL_CONFIG => { id => '3c', },
METER_TBL_MONITOR => { id => '3d', },
METER_TBL_PUSH => { id => '3e', },
PREPAYMENT => { id => '3f', },
"033909(..)"=> 'sprintf("ventilationRate: %s",hex($1))' } },
DCP_CONFIG => { id => '3a' },
DCP_MONITOR => { id => '3b' },
METER_TBL_CONFIG => { id => '3c' },
METER_TBL_MONITOR => { id => '3d' },
METER_TBL_PUSH => { id => '3e' },
PREPAYMENT => { id => '3f' },
THERMOSTAT_MODE => { id => '40',
set => { tmOff => "0100",
tmHeating => "0101",
tmCooling => "010b",
tmManual => "011f", },
get => { thermostatMode => "02", },
tmManual => "011f" },
get => { thermostatMode => "02" },
parse => { "03400300" => "state:off",
"0340030b" => "state:cooling",
"03400301" => "state:heating",
"0340031f" => "state:manual", }, } ,
PREPAYMENT_ENCAPSULATION => { id => '41', },
THERMOSTAT_OPERATING_STATE=>{ id => '42', },
"0340031f" => "state:manual", } } ,
PREPAYMENT_ENCAPSULATION => { id => '41' },
THERMOSTAT_OPERATING_STATE=>{ id => '42' },
THERMOSTAT_SETPOINT => { id => '43',
set => { setpointHeating => "010101%02x",
setpointCooling => "010201%02x"},
get => { setpoint => "02" },
parse => { "064303(..)(..)(....)" => 'sprintf("setpointTemp:%0.1f %s %s", '.
'hex($3)/(10**int(hex($2)/32)), '.
'hex($2)&8 ? "F":"C", $1==1 ? "heating":"cooling")' }, },
THERMOSTAT_FAN_MODE => { id => '44', },
THERMOSTAT_FAN_STATE => { id => '45', },
'hex($2)&8 ? "F":"C", $1==1 ? "heating":"cooling")' } },
THERMOSTAT_FAN_MODE => { id => '44' },
THERMOSTAT_FAN_STATE => { id => '45' },
CLIMATE_CONTROL_SCHEDULE => { id => '46',
set => { ccs => 'ZWave_ccsSet("%s")' },
get => { ccs => 'ZWave_ccsGet("%s")',
ccsChanged => "04",
ccsOverride => "07" },
parse => { "..46(..)(.*)" => 'ZWave_ccsParse($1,$2)' }},
THERMOSTAT_SETBACK => { id => '47', },
RATE_TBL_CONFIG => { id => '48', },
RATE_TBL_MONITOR => { id => '49', },
TARIFF_CONFIG => { id => '4a', },
TARIFF_TBL_MONITOR => { id => '4b', },
DOOR_LOCK_LOGGING => { id => '4c', },
NETWORK_MANAGEMANT_BASIC => { id => '4d', },
SCHEDULE_ENTRY_LOCK => { id => '4e', },
ZI_6LOWPAN => { id => '4f', },
THERMOSTAT_SETBACK => { id => '47' },
RATE_TBL_CONFIG => { id => '48' },
RATE_TBL_MONITOR => { id => '49' },
TARIFF_CONFIG => { id => '4a' },
TARIFF_TBL_MONITOR => { id => '4b' },
DOOR_LOCK_LOGGING => { id => '4c' },
NETWORK_MANAGEMANT_BASIC => { id => '4d' },
SCHEDULE_ENTRY_LOCK => { id => '4e' },
ZI_6LOWPAN => { id => '4f' },
BASIC_WINDOW_COVERING => { id => '50',
set => { coveringClose => "0140",
coveringOpen => "0100",
coveringStop => "02" , }, },
MTP_WINDOW_COVERING => { id => '51', },
NETWORK_MANAGEMENT_PROXY => { id => '52', },
NETWORK_SCHEDULE => { id => '53', },
NETWORK_MANAGEMENT_PRIMARY=>{ id => '54', },
TRANSPORT_SERVICE => { id => '55', },
CRC_16_ENCAP => { id => '56', }, # Parse is handled in the code
APPLICATION_CAPABILITY => { id => '57', },
ZIP_ND => { id => '58', },
ASSOCIATION_GRP_INFO => { id => '59', },
DEVICE_RESET_LOCALLY => { id => '5a', },
CENTRAL_SCENE => { id => '5b', },
IP_ASSOCIATION => { id => '5c', },
ANTITHEFT => { id => '5d', },
coveringStop => "02" }, },
MTP_WINDOW_COVERING => { id => '51' },
NETWORK_MANAGEMENT_PROXY => { id => '52' },
NETWORK_SCHEDULE => { id => '53' },
NETWORK_MANAGEMENT_PRIMARY=>{ id => '54' },
TRANSPORT_SERVICE => { id => '55' },
CRC_16_ENCAP => { id => '56' }, # Parse is handled in the code
APPLICATION_CAPABILITY => { id => '57' },
ZIP_ND => { id => '58' },
ASSOCIATION_GRP_INFO => { id => '59' },
DEVICE_RESET_LOCALLY => { id => '5a' },
CENTRAL_SCENE => { id => '5b' },
IP_ASSOCIATION => { id => '5c' },
ANTITHEFT => { id => '5d' },
ZWAVEPLUS_INFO => { id => '5e',
get => { zwavePlusInfo=>"01"},
parse => { "095e02(..)(..)(..)(....)(....)"
=> 'ZWave_plusInfoParse($1,$2,$3,$4,$5)'},},
ZIP_GATEWAY => { id => '5f', },
=> 'ZWave_plusInfoParse($1,$2,$3,$4,$5)'} },
ZIP_GATEWAY => { id => '5f' },
MULTI_CHANNEL => { id => '60', # Version 2, aka MULTI_INSTANCE
get => { mcEndpoints => "07",
mcCapability=> "09%02x"},
parse => { "^046008(..)(..)" => '"mcEndpoints:total ".hex($2).'.
'(hex($1)&0x80 ? ", dynamic":"").'.
'(hex($1)&0x40 ? ", identical":", different")',
"^..600a(.*)"=> 'ZWave_mcCapability($hash, $1)' }, },
ZIP_PORTAL => { id => '61', },
DOOR_LOCK => { id => '62', },
USER_CODE => { id => '63', },
APPLIANCE => { id => '64', },
DMX => { id => '65', },
BARRIER_OPERATOR => { id => '66', },
"^..600a(.*)"=> 'ZWave_mcCapability($hash, $1)' } },
ZIP_PORTAL => { id => '61' },
DOOR_LOCK => { id => '62' },
USER_CODE => { id => '63',
set => { userCode => 'ZWave_userCodeSet("%s")' },
get => { userCode => "02%02x" },
parse => { "^..6303(..)(..)(.*)" =>
'sprintf("userCode:id %d status %d code %s", $1, $2, $3)' }
},
APPLIANCE => { id => '64' },
DMX => { id => '65' },
BARRIER_OPERATOR => { id => '66' },
CONFIGURATION => { id => '70',
set => { configDefault=>"04%02x80",
configByte => "04%02x01%02x",
configWord => "04%02x02%04x",
configLong => "04%02x04%08x", },
get => { config => "05%02x", },
configLong => "04%02x04%08x" },
get => { config => "05%02x" },
parse => { "^..70..(..)(..)(.*)" => 'ZWave_configParse($hash,$1,$2,$3)'} },
ALARM => { id => '71',
get => { alarm => "04%02x", },
get => { alarm => "04%02x" },
parse => { "..7105(..)(..)(.*)" => 'ZWave_alarmParse($1,$2,$3)'} },
MANUFACTURER_SPECIFIC => { id => '72',
get => { model => "04", },
get => { model => "04" },
parse => { "087205(....)(....)(....)" => 'ZWave_mfsParse($1,$2,$3,0)',
"087205(....)(....)(.{4})" => 'ZWave_mfsParse($1,$2,$3,1)',
"087205(....)(.{4})(.{4})" => '"modelId:$1-$2-$3"'} },
POWERLEVEL => { id => '73', },
POWERLEVEL => { id => '73' },
PROTECTION => { id => '75',
set => { protectionOff => "0100",
protectionSeq => "0101",
protectionOn => "0102",
protectionBytes => "01%02x%02x",},
get => { protection => "02", },
protectionBytes => "01%02x%02x" },
get => { protection => "02" },
parse => { "03750300" => "protection:off",
"03750301" => "protection:seq",
"03750302" => "protection:on",
"047503(..)(..)" => 'ZWave_protectionParse($1, $2)'} },
LOCK => { id => '76', },
NODE_NAMING => { id => '77', },
FIRMWARE_UPDATE_MD => { id => '7a', },
GROUPING_NAME => { id => '7b', },
REMOTE_ASSOCIATION_ACTIVATE=>{id => '7c', },
REMOTE_ASSOCIATION => { id => '7d', },
LOCK => { id => '76' },
NODE_NAMING => { id => '77' },
FIRMWARE_UPDATE_MD => { id => '7a' },
GROUPING_NAME => { id => '7b' },
REMOTE_ASSOCIATION_ACTIVATE=>{id => '7c' },
REMOTE_ASSOCIATION => { id => '7d' },
BATTERY => { id => '80',
get => { battery => "02" },
parse => { "038003(..)"=> '"battery:".($1 eq "ff" ? "low":hex($1)." %")'},},
parse => { "038003(..)"=> '"battery:".($1 eq "ff" ? "low":hex($1)." %")'} },
CLOCK => { id => '81',
get => { clock => "05" },
set => { clock => 'ZWave_clockSet()' },
@ -257,42 +262,42 @@ my %zwave_class = (
parse => { "028201" => "hail:01"}},
WAKE_UP => { id => '84',
set => { wakeupInterval => "04%06x%02x",
wakeupNoMoreInformation => "08", },
wakeupNoMoreInformation => "08" },
get => { wakeupInterval => "05",
wakeupIntervalCapabilities => "09", },
wakeupIntervalCapabilities => "09" },
parse => { "028407" => 'wakeup:notification',
"..8406(......)(..)" =>
'"wakeupReport:interval ".hex($1)." target ".hex($2)',
"..840a(......)(......)(......)(......)" =>
'"wakeupIntervalCapabilitiesReport:min ".hex($1).'.
'" max ".hex($2)." default ".hex($3)." step ".hex($4)'
}, },
} },
ASSOCIATION => { id => '85',
set => { associationAdd => "01%02x%02x*",
associationDel => "04%02x%02x*", },
associationDel => "04%02x%02x*" },
get => { association => "02%02x", },
parse => { "..8503(..)(..)..(.*)" => '"assocGroup_$1:Max $2 Nodes $3"',}, },
parse => { "..8503(..)(..)..(.*)" => '"assocGroup_$1:Max $2 Nodes $3"'} },
VERSION => { id => '86',
get => { version => "11",
versionClass => "13%02x", },
versionClass => "13%02x" },
parse => { "..8612(..)(..)(..)(..)(..)" =>
'sprintf("version:Lib %d Prot %d.%d App %d.%d",'.
'hex($1),hex($2),hex($3),hex($4),hex($5))',
"048614(..)(..)" => '"versionClass_$1:$2"', }, },
"048614(..)(..)" => '"versionClass_$1:$2"' } },
INDICATOR => { id => '87',
set => { indicatorOff => "0100",
indicatorOn => "01FF",
indicatorDim => "01%02x", },
indicatorDim => "01%02x" },
get => { indicatorStatus => "02", },
parse => { "038703(..)" => '($1 eq "00" ? "indState:off" :
($1 eq "ff" ? "indState:on" :
"indState:dim ".hex($1)))',}, },
PROPRIETARY => { id => '88', },
LANGUAGE => { id => '89', },
TIME => { id => '8a', },
TIME_PARAMETERS => { id => '8b', },
GEOGRAPHIC_LOCATION => { id => '8c', },
COMPOSITE => { id => '8d', },
"indState:dim ".hex($1)))'} },
PROPRIETARY => { id => '88' },
LANGUAGE => { id => '89' },
TIME => { id => '8a' },
TIME_PARAMETERS => { id => '8b' },
GEOGRAPHIC_LOCATION => { id => '8c' },
COMPOSITE => { id => '8d' },
MULTI_CHANNEL_ASSOCIATION=> { id => '8e', # aka MULTI_INSTANCE_ASSOCIATION
set => { mcaAdd => "01%02x%02x*",
mcaDel => "04%02x*" },
@ -302,28 +307,28 @@ my %zwave_class = (
=> '"mca_$1:max:$2 param:$3"',
"..8e06(.*)"=> '"mcaSupportedGroupings:".hex($1)' } },
MULTI_CMD => { id => '8f', }, # Handled in Parse
ENERGY_PRODUCTION => { id => '90', },
MANUFACTURER_PROPRIETARY => { id => '91', }, # see also zwave_deviceSpecial
SCREEN_MD => { id => '92', },
SCREEN_ATTRIBUTES => { id => '93', },
SIMPLE_AV_CONTROL => { id => '94', },
AV_CONTENT_DIRECTORY_MD => { id => '95', },
AV_RENDERER_STATUS => { id => '96', },
AV_CONTENT_SEARCH_MD => { id => '97', },
SECURITY => { id => '98', },
AV_TAGGING_MD => { id => '99', },
IP_CONFIGURATION => { id => '9a', },
MULTI_CMD => { id => '8f' }, # Handled in Parse
ENERGY_PRODUCTION => { id => '90' },
MANUFACTURER_PROPRIETARY => { id => '91' }, # see also zwave_deviceSpecial
SCREEN_MD => { id => '92' },
SCREEN_ATTRIBUTES => { id => '93' },
SIMPLE_AV_CONTROL => { id => '94' },
AV_CONTENT_DIRECTORY_MD => { id => '95' },
AV_RENDERER_STATUS => { id => '96' },
AV_CONTENT_SEARCH_MD => { id => '97' },
SECURITY => { id => '98' },
AV_TAGGING_MD => { id => '99' },
IP_CONFIGURATION => { id => '9a' },
ASSOCIATION_COMMAND_CONFIGURATION
=> { id => '9b', },
=> { id => '9b' },
SENSOR_ALARM => { id => '9c',
get => { alarm => "01%02x", },
get => { alarm => "01%02x" },
parse => { "..9c02(..)(..)(..)(....)" =>
'"alarm_type_$2:level $3 node $1 seconds ".hex($4)',}, },
SILENCE_ALARM => { id => '9d', },
SENSOR_CONFIGURATION => { id => '9e', },
MARK => { id => 'ef', },
NON_INTEROPERABLE => { id => 'f0', },
'"alarm_type_$2:level $3 node $1 seconds ".hex($4)'} },
SILENCE_ALARM => { id => '9d' },
SENSOR_CONFIGURATION => { id => '9e' },
MARK => { id => 'ef' },
NON_INTEROPERABLE => { id => 'f0' },
);
my %zwave_cmdArgs = (
@ -347,7 +352,7 @@ my %zwave_deviceSpecial = (
Fibaro_FGRM222 => {
MANUFACTURER_PROPRIETARY => {
set => { positionSlat=>"010f26010100%02x",
positionBlinds=>"010f260102%02x00",},
positionBlinds=>"010f260102%02x00"},
get => { position=>"010f2602020000", },
parse => { "0891010f260303(..)(..)" =>
'sprintf("position:Blinds %d Slat %d",hex($1),hex($2))' } } },
@ -847,6 +852,16 @@ ZWave_ccsParse($$)
return "ccs: UNKNOWN $t$p";
}
sub
ZWave_userCodeSet($)
{
my ($spec) = @_;
my @arg = split(" ", $spec);
return ("wrong arg, need: id status usercode","")
if(@arg != 3 || $spec !~ m/^[A-F0-9 ]*$/i);
return ("", sprintf("01%02x%02x%s", $arg[0],$arg[1],$arg[2]));
}
sub
ZWave_clockAdjust($)
{
@ -1447,8 +1462,7 @@ ZWave_Parse($$@)
push @event, $val;
}
}
Log3 $hash, 4, "$name: $className $arg generated no event"
if(!@event);
push @event, "UNPARSED:$className $arg" if(!@event);
}
my $wu = $baseHash->{WakeUp};