From 9e16fbde2e2d363532b198ccd3bd579295c4d56c Mon Sep 17 00:00:00 2001
From: "klaus.schauer" <>
Date: Mon, 8 Feb 2021 17:23:32 +0000
Subject: [PATCH] 10_EnOcean: # EEP A5-08-01 ... A5-08-03
(lightTempOccupSensor.<01|02|03>), EEP A5-07-01, A5-07-02, A5-07-03
(occupSensor.<01|02|03>), EEP A5-06-01 (lightSensor.01): signOfLife function
added # EEP A5-10-02, A5-10-03, A5-10-06 (roomSensorControl.05), EEP
A5-10-10, A5-10-12 (roomSensorControl.01): attr devMode added
git-svn-id: https://svn.fhem.de/fhem/trunk@23703 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/10_EnOcean.pm | 71 ++++++++++++++++++++++++++++++++++-------
1 file changed, 59 insertions(+), 12 deletions(-)
diff --git a/fhem/FHEM/10_EnOcean.pm b/fhem/FHEM/10_EnOcean.pm
index 3126c0c0c..a420bee32 100755
--- a/fhem/FHEM/10_EnOcean.pm
+++ b/fhem/FHEM/10_EnOcean.pm
@@ -1519,7 +1519,7 @@ sub EnOcean_Get($@) {
Log3 $name, 3, "EnOcean get $name $cmd";
} elsif ($cmd eq "signal") {
- # trigger status massage of device
+ # trigger status message of device
$rorg = "D0";
$destinationID = $hash->{DEF} if ($destinationID eq 'F' x 8);
shift(@a);
@@ -2575,7 +2575,12 @@ sub EnOcean_Set($@) {
$data = sprintf "%02X%02X%02X%02X", $setpoint, $humidity, $actualTemp, $setCmd;
} else {
- return "Unknown argument " . $cmd . ", choose one of " . $cmdList . " setpoint:slider,0,1,255 setpointScaled switch:on,off teach:noArg"
+ if (AttrVal($name, 'devMode', 'master') eq 'master') {
+ return "Unknown argument " . $cmd . ", choose one of " . $cmdList . " setpoint:slider,0,1,255 setpointScaled switch:on,off teach:noArg"
+ }
+ else {
+ return undef;
+ }
}
Log3 $name, 3, "EnOcean set $name $cmd";
@@ -2710,7 +2715,12 @@ sub EnOcean_Set($@) {
$data = sprintf "%02X%02X%02X%02X", $nightReduction, $setpointTemp, $actualTemp, $setCmd;
} else {
- return "Unknown argument " . $cmd . ", choose one of setpointTemp:slider,0,1,40 desired-temp nightReduction:0,1,2,3,4,5 teach:noArg"
+ if (AttrVal($name, 'devMode', 'master') eq 'master') {
+ return "Unknown argument " . $cmd . ", choose one of setpointTemp:slider,0,1,40 desired-temp nightReduction:0,1,2,3,4,5 teach:noArg"
+ }
+ else {
+ return undef;
+ }
}
} else {
@@ -2879,7 +2889,12 @@ sub EnOcean_Set($@) {
$data = sprintf "%02X%02X%02X%02X", $fanStage, $setpoint, $actualTemp, $setCmd;
} else {
- return "Unknown argument " . $cmd . ", choose one of " . $cmdList . "setpoint:slider,0,1,255 fanStage:auto,0,1,2,3 setpointScaled switch:on,off teach:noArg"
+ if (AttrVal($name, 'devMode', 'master') eq 'master') {
+ return "Unknown argument " . $cmd . ", choose one of " . $cmdList . "setpoint:slider,0,1,255 fanStage:auto,0,1,2,3 setpointScaled switch:on,off teach:noArg"
+ }
+ else {
+ return undef;
+ }
}
}
@@ -9808,7 +9823,7 @@ sub EnOcean_Parse($$) {
} elsif ($st eq "lightSensor.01") {
# Light Sensor (EEP A5-06-01)
- # [Eltako FAH60, FAH63, FIH63, Thermokon SR65 LI, untested]
+ # [Eltako FAH60, FAH63, FIH63, Thermokon SR65 LI]
# $db[3] is the voltage where 0x00 = 0 V ... 0xFF = 5.1 V
# $db[3] is the low illuminance for Eltako devices where
# min 0x00 = 0 lx, max 0xFF = 100 lx, if $db[2] = 0
@@ -9838,7 +9853,12 @@ sub EnOcean_Parse($$) {
}
push @event, "3:brightness:$lux";
push @event, "3:state:$lux";
-
+ readingsDelete($hash, 'alarm');
+ if (AttrVal($name, "signOfLife", 'on') eq 'on') {
+ RemoveInternalTimer($hash->{helper}{timer}{alarm}) if(exists $hash->{helper}{timer}{alarm});
+ @{$hash->{helper}{timer}{alarm}} = ($hash, 'alarm', 'dead_sensor', 1, 5);
+ InternalTimer(gettimeofday() + AttrVal($name, "signOfLifeInterval", 110), 'EnOcean_readingsSingleUpdate', $hash->{helper}{timer}{alarm}, 0);
+ }
} elsif ($st eq "lightSensor.02") {
# Light Sensor (EEP A5-06-02)
# $db[3] is the voltage where 0x00 = 0 V ... 0xFF = 5.1 V
@@ -9941,6 +9961,13 @@ sub EnOcean_Parse($$) {
@{$hash->{helper}{timer}{state}} = ($hash, 'state', 'off', 1, 5);
InternalTimer(gettimeofday() + AttrVal($name, 'trackerWakeUpCycle', 30) * 1.1, 'EnOcean_readingsSingleUpdate', $hash->{helper}{timer}{motion}, 0);
InternalTimer(gettimeofday() + AttrVal($name, 'trackerWakeUpCycle', 30) * 1.1, 'EnOcean_readingsSingleUpdate', $hash->{helper}{timer}{state}, 0);
+ } else {
+ readingsDelete($hash, 'alarm');
+ if (AttrVal($name, "signOfLife", 'on') eq 'on') {
+ RemoveInternalTimer($hash->{helper}{timer}{alarm}) if(exists $hash->{helper}{timer}{alarm});
+ @{$hash->{helper}{timer}{alarm}} = ($hash, 'alarm', 'dead_sensor', 1, 5);
+ InternalTimer(gettimeofday() + AttrVal($name, "signOfLifeInterval", 1320), 'EnOcean_readingsSingleUpdate', $hash->{helper}{timer}{alarm}, 0);
+ }
}
if (!exists($hash->{helper}{lastVoltage}) || $hash->{helper}{lastVoltage} != $db[3]) {
push @event, "3:battery:" . ($db[3] * 0.02 > 2.8 ? "ok" : "low");
@@ -10032,6 +10059,12 @@ sub EnOcean_Parse($$) {
}
push @event, "3:brightness:$lux";
push @event, "3:motion:$motion";
+ readingsDelete($hash, 'alarm');
+ if (AttrVal($name, "signOfLife", 'on') eq 'on') {
+ RemoveInternalTimer($hash->{helper}{timer}{alarm}) if(exists $hash->{helper}{timer}{alarm});
+ @{$hash->{helper}{timer}{alarm}} = ($hash, 'alarm', 'dead_sensor', 1, 5);
+ InternalTimer(gettimeofday() + AttrVal($name, "signOfLifeInterval", 1320), 'EnOcean_readingsSingleUpdate', $hash->{helper}{timer}{alarm}, 0);
+ }
} elsif ($st eq "lightCtrlState.01") {
# Lighting Controller State (EEP A5-11-01)
@@ -15450,7 +15483,7 @@ EnOcean_roomCtrlPanel_00Snd($$$$$$$$)
my $messagePart = 1;
if ($mid == 0) {
- # general massage
+ # general message
($err, $response, $data, $logLevel) = EnOcean_roomCtrlPanel_00Cmd(undef, $hash, $mcf, $messagePart);
EnOcean_SndRadio(undef, $hash, $packetType, "D2", $data, AttrVal($name, "subDef", "00000000"), "00", $hash->{DEF});
if ($err) {
@@ -18724,6 +18757,7 @@ sub EnOcean_Delete($$) {
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
+ The profile behaves like a master or slave, see devMode.
The attr subType must be roomSensorControl.05. The attribute must be set manually.
@@ -18754,6 +18788,7 @@ sub EnOcean_Delete($$) {
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
+ The profile behaves like a master or slave, see devMode.
The attr subType must be roomSensorControl.05 and attr manufID must be 019. The attribute must be set manually.
@@ -18783,6 +18818,7 @@ sub EnOcean_Delete($$) {
is teached in, the temperature control of the FTR55* can be either blocked
or to a setpoint deviation of +/- 3 K be limited. For this use the optional parameter
[block] = lock|unlock, unlock is default.
+ The profile behaves like a master or slave, see devMode.
The attr subType must be roomSensorControl.05 and attr manufID must be 00D.
The attributes must be set manually.
@@ -18815,6 +18851,7 @@ sub EnOcean_Delete($$) {
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
+ The profile behaves like a master or slave, see devMode.
The attr subType must be roomSensorControl.01. The attribute must be set manually.
@@ -18839,6 +18876,7 @@ sub EnOcean_Delete($$) {
primarily or from the attribute actualTemp if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpoint
command is sent when the reference device is updated.
+ The profile behaves like a master or slave, see devMode.
The attr subType must be roomSensorControl.01 and attr manufID must be 00D. The attribute must be set manually.
@@ -21163,16 +21201,18 @@ sub EnOcean_Delete($$) {
[Eltako FAH60, FAH63, FIH63, Thermokon SR65 LI]