Compare commits
187 Commits
Author | SHA1 | Date | |
---|---|---|---|
81489d5246 | |||
833a370347 | |||
fb50355d39 | |||
d41615c90f | |||
be5e721c43 | |||
2351e5b9db | |||
d4626a068b | |||
0571adccc5 | |||
8ec3bcde54 | |||
bd97e399bf | |||
d409662969 | |||
c1c3e2cbdf | |||
72298746ab | |||
787114040c | |||
b517e032cf | |||
30cf6f41d7 | |||
eef3dc7b21 | |||
cfe3963f32 | |||
b654481df1 | |||
e19c902780 | |||
757a19bdb5 | |||
52930d9a07 | |||
e1592b8b7d | |||
7eb1079458 | |||
ceecbb063a | |||
49b0ff17fa | |||
ae5057fbc5 | |||
9cd0d364b4 | |||
f216e1b308 | |||
6f137256e0 | |||
cc5ef41e21 | |||
587d4e4316 | |||
3542e51375 | |||
f517b72f23 | |||
ad5cbaac12 | |||
8da3b13bcc | |||
c09edf5496 | |||
cd1c2c104a | |||
51256c1ed9 | |||
c0a7bfa6df | |||
403936fe73 | |||
5095c65d80 | |||
0bd8d6273f | |||
c3b61def25 | |||
9c096902e8 | |||
6dfc92c35e | |||
9994af6ca2 | |||
eb85a74a07 | |||
358c760b45 | |||
34a6a88401 | |||
bb80fb5d3a | |||
2907e19d3b | |||
ae86468077 | |||
7cba141447 | |||
f67d56e1cc | |||
527d72dd57 | |||
459b8508ec | |||
ac87015478 | |||
26105fa434 | |||
15be0a6885 | |||
cca6e90303 | |||
de5d6cbc6a | |||
4925e654ec | |||
97caf64308 | |||
6bf2b17d6f | |||
fb27bedf48 | |||
f52187ad35 | |||
103697184e | |||
c9894453bb | |||
14eee0e6dd | |||
9545dda125 | |||
3135a27c63 | |||
13689963f1 | |||
d8881ff6d1 | |||
12f48e98b5 | |||
a1d19a797d | |||
f1f265b89a | |||
ca99e2bd0c | |||
29e3a1a8d7 | |||
e02395a82f | |||
663ce748e2 | |||
d35dda835a | |||
47be49617d | |||
0dc0a9c6e4 | |||
79d369b9f5 | |||
8109cd7ebe | |||
842e41e3dc | |||
35a4f60a53 | |||
ef650b2d4b | |||
bf773ca2d7 | |||
ae88630277 | |||
f811cfd87f | |||
1a71c63652 | |||
7d3d11d1e2 | |||
1eeeb85eaf | |||
397f949a21 | |||
4ea1db3aa0 | |||
004a15ea42 | |||
9a1b6acad3 | |||
4aa24587a5 | |||
c76280639f | |||
a3c023711c | |||
c6e88f2d45 | |||
f0f5cbde4b | |||
5928276b74 | |||
32a3ac9d13 | |||
ef590e002e | |||
427018ab46 | |||
89431a2af3 | |||
39c7ec3dc5 | |||
37044b2316 | |||
a44fffe94e | |||
870f2be5d8 | |||
36669f1405 | |||
a61458cfc2 | |||
8c17eb5f6a | |||
d87ddb146c | |||
58b2f20f19 | |||
301fd32048 | |||
0255be94b5 | |||
4773fd0ea0 | |||
1ce3805427 | |||
5f00d33fa9 | |||
da79e25929 | |||
0b22ac9e12 | |||
e6a01cdb18 | |||
fb44ff9f1a | |||
9663b2dd43 | |||
d6cb059eaf | |||
6774e3a918 | |||
e28fad13d7 | |||
1c1ac77851 | |||
1ac38a7216 | |||
8d6044c404 | |||
fcce22b102 | |||
4b5b03a8fc | |||
f412e88325 | |||
0dca852ad0 | |||
8ea4101747 | |||
b9a7328661 | |||
f03a7d690f | |||
5ccceaba16 | |||
54450962ac | |||
9409c60400 | |||
75f5b6bf01 | |||
98edf0c5f6 | |||
a9a47f9e70 | |||
f2b7e8490f | |||
3d7f9fcf92 | |||
e037a12879 | |||
096e4ab815 | |||
feba24bf99 | |||
e5a6bbdbe5 | |||
a66daa7d5a | |||
617b7a7531 | |||
f498829347 | |||
4cc3ecc40a | |||
95446cc91e | |||
63393b4cd4 | |||
6a62226a39 | |||
cbd058773d | |||
1016b7d087 | |||
649d21f19b | |||
93bd0cd22e | |||
62a4a249b4 | |||
e66aa0cb4d | |||
34afd51a11 | |||
a2c878e333 | |||
bb1d139ed7 | |||
ef5b9a982e | |||
4c1d6c7885 | |||
2b12b9ed10 | |||
6babb451c9 | |||
9afc3ccf97 | |||
bee5ff33ae | |||
9ba046452a | |||
5e60229c7a | |||
8009a27869 | |||
0b048e7dc0 | |||
bd6e901ca1 | |||
f36101f48a | |||
f51cdf4943 | |||
2c68ae8406 | |||
697cdd1089 | |||
d3af20bc01 | |||
7882128336 | |||
c25c395a5b |
8496
CHANGELOG.md
Normal file
8496
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
|||||||
UPD 2021-05-18_10:42:56 97974 FHEM/73_AutoShuttersControl.pm
|
UPD 2025-01-21_18:19:08 116536 FHEM/73_AutoShuttersControl.pm
|
||||||
UPD 2021-05-17_14:34:49 74350 lib/FHEM/Automation/ShuttersControl.pm
|
UPD 2025-01-21_17:56:42 76570 lib/FHEM/Automation/ShuttersControl.pm
|
||||||
UPD 2020-06-22_09:41:40 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
|
UPD 2024-10-12_09:12:30 2691 lib/FHEM/Automation/ShuttersControl/Dev.pm
|
||||||
UPD 2020-07-26_17:36:29 2496 lib/FHEM/Automation/ShuttersControl/Roommate.pm
|
UPD 2024-10-12_09:12:30 2675 lib/FHEM/Automation/ShuttersControl/Roommate.pm
|
||||||
UPD 2021-05-18_10:37:51 31896 lib/FHEM/Automation/ShuttersControl/Shutters.pm
|
UPD 2024-10-12_09:12:30 31828 lib/FHEM/Automation/ShuttersControl/Shutters.pm
|
||||||
UPD 2021-05-17_14:30:37 25329 lib/FHEM/Automation/ShuttersControl/Shading.pm
|
UPD 2024-10-12_09:12:30 25541 lib/FHEM/Automation/ShuttersControl/Shading.pm
|
||||||
UPD 2021-05-17_14:34:49 108472 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
|
UPD 2024-10-12_09:12:30 112297 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
|
||||||
UPD 2021-02-26_14:36:10 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm
|
UPD 2024-10-12_09:12:30 40681 lib/FHEM/Automation/ShuttersControl/Helper.pm
|
||||||
UPD 2020-06-22_09:41:40 2175 lib/FHEM/Automation/ShuttersControl/Window.pm
|
UPD 2024-10-12_09:12:30 2209 lib/FHEM/Automation/ShuttersControl/Window.pm
|
||||||
UPD 2021-05-18_10:37:51 11741 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
|
UPD 2024-10-12_09:12:30 11857 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
|
||||||
UPD 2020-07-03_11:29:10 7251 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm
|
UPD 2024-10-12_09:12:30 7265 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm
|
||||||
UPD 2021-01-29_10:06:33 52525 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
|
UPD 2024-10-12_09:12:30 52751 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
|
||||||
UPD 2020-06-22_09:41:40 2903 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
|
UPD 2024-10-12_09:12:30 2799 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
|
||||||
UPD 2021-01-29_10:06:33 3980 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
|
UPD 2024-10-12_09:12:30 3887 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
|
||||||
UPD 2020-06-22_09:41:40 2288 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm
|
UPD 2024-10-12_09:12:30 2200 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm
|
||||||
UPD 2021-05-18_10:37:51 6195 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm
|
UPD 2024-10-12_09:12:30 7394 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm
|
||||||
|
36
hooks/commit-msg
Executable file
36
hooks/commit-msg
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# An example hook script to check the commit log message.
|
||||||
|
# Called by "git commit" with one argument, the name of the file
|
||||||
|
# that has the commit message. The hook should exit with non-zero
|
||||||
|
# status after issuing an appropriate message if it wants to stop the
|
||||||
|
# commit. The hook is allowed to edit the commit message file.
|
||||||
|
#
|
||||||
|
# To enable this hook, rename this file to "commit-msg".
|
||||||
|
|
||||||
|
# Uncomment the below to add a Signed-off-by line to the message.
|
||||||
|
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
|
||||||
|
# hook is more suited to it.
|
||||||
|
#
|
||||||
|
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
|
||||||
|
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
|
||||||
|
|
||||||
|
# This example catches duplicate Signed-off-by lines.
|
||||||
|
|
||||||
|
commit_msg=$(cat "${1:?Missing commit message file}")
|
||||||
|
|
||||||
|
test "" = "$(grep '^Signed-off-by: ' "$1" |
|
||||||
|
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
|
||||||
|
echo >&2 Duplicate Signed-off-by lines.
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! echo "$commit_msg" | grep -Eq "^(build|chore|ci|docs|feat|feat!|fix|perf|refactor|revert|style|test)(\(.+\))?: .*$" ; then
|
||||||
|
|
||||||
|
echo "Invalid commit message"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Commit message is valid!"
|
18
hooks/post-commit
Executable file
18
hooks/post-commit
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# destination of the final changelog file
|
||||||
|
OUTPUT_FILE=CHANGELOG.md
|
||||||
|
|
||||||
|
# generate the changelog
|
||||||
|
git --no-pager log --no-merges --format="### %s%d%n>%aD%n%n>Author: %aN (%aE)%n%n>Commiter: %cN (%cE)%n%n%b%n%N%n" > $OUTPUT_FILE
|
||||||
|
|
||||||
|
# prevent recursion!
|
||||||
|
# since a 'commit --amend' will trigger the post-commit script again
|
||||||
|
# we have to check if the changelog file has changed or not
|
||||||
|
res=$(git status --porcelain | grep -c ".\$OUTPUT_FILE$")
|
||||||
|
if [ "$res" -gt 0 ]; then
|
||||||
|
git add $OUTPUT_FILE
|
||||||
|
git commit --amend
|
||||||
|
echo "Populated Changelog in $OUTPUT_FILE"
|
||||||
|
fi
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -43,7 +43,7 @@ package FHEM::Automation::ShuttersControl::Dev;
|
|||||||
use FHEM::Automation::ShuttersControl::Dev::Readings;
|
use FHEM::Automation::ShuttersControl::Dev::Readings;
|
||||||
use FHEM::Automation::ShuttersControl::Dev::Attr;
|
use FHEM::Automation::ShuttersControl::Dev::Attr;
|
||||||
|
|
||||||
our @ISA =
|
use base
|
||||||
qw(FHEM::Automation::ShuttersControl::Dev::Readings FHEM::Automation::ShuttersControl::Dev::Attr);
|
qw(FHEM::Automation::ShuttersControl::Dev::Readings FHEM::Automation::ShuttersControl::Dev::Attr);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -44,23 +44,12 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
AttrVal
|
|
||||||
gettimeofday)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub getShuttersOffset {
|
sub getShuttersOffset {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_shuttersDriveDelay', -1 );
|
return ::AttrVal( $name, 'ASC_shuttersDriveDelay', -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getBrightnessMinVal {
|
sub getBrightnessMinVal {
|
||||||
@ -70,7 +59,7 @@ sub getBrightnessMinVal {
|
|||||||
|
|
||||||
return $self->{ASC_brightness}->{triggermin}
|
return $self->{ASC_brightness}->{triggermin}
|
||||||
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getBrightnessMaxVal;
|
$FHEM::Automation::ShuttersControl::ascDev->getBrightnessMaxVal;
|
||||||
|
|
||||||
return $self->{ASC_brightness}->{triggermin};
|
return $self->{ASC_brightness}->{triggermin};
|
||||||
@ -83,8 +72,8 @@ sub getBrightnessMaxVal {
|
|||||||
|
|
||||||
return $self->{ASC_brightness}->{triggermax}
|
return $self->{ASC_brightness}->{triggermax}
|
||||||
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
|
||||||
$self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() );
|
$self->{ASC_brightness}->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
|
|
||||||
my ( $triggermax, $triggermin ) =
|
my ( $triggermax, $triggermin ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
||||||
@ -104,7 +93,7 @@ sub _getTwilightDevice {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_twilightDevice', 'none' );
|
return ::AttrVal( $name, 'ASC_twilightDevice', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoAstroModeEvening {
|
sub getAutoAstroModeEvening {
|
||||||
@ -112,7 +101,7 @@ sub getAutoAstroModeEvening {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoAstroModeEvening', 'REAL' );
|
return ::AttrVal( $name, 'ASC_autoAstroModeEvening', 'REAL' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoAstroModeEveningHorizon {
|
sub getAutoAstroModeEveningHorizon {
|
||||||
@ -120,7 +109,7 @@ sub getAutoAstroModeEveningHorizon {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoAstroModeEveningHorizon', 0 );
|
return ::AttrVal( $name, 'ASC_autoAstroModeEveningHorizon', 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoAstroModeMorning {
|
sub getAutoAstroModeMorning {
|
||||||
@ -128,7 +117,7 @@ sub getAutoAstroModeMorning {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoAstroModeMorning', 'REAL' );
|
return ::AttrVal( $name, 'ASC_autoAstroModeMorning', 'REAL' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoAstroModeMorningHorizon {
|
sub getAutoAstroModeMorningHorizon {
|
||||||
@ -136,7 +125,7 @@ sub getAutoAstroModeMorningHorizon {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoAstroModeMorningHorizon', 0 );
|
return ::AttrVal( $name, 'ASC_autoAstroModeMorningHorizon', 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoShuttersControlMorning {
|
sub getAutoShuttersControlMorning {
|
||||||
@ -144,7 +133,7 @@ sub getAutoShuttersControlMorning {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoShuttersControlMorning', 'on' );
|
return ::AttrVal( $name, 'ASC_autoShuttersControlMorning', 'on' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoShuttersControlEvening {
|
sub getAutoShuttersControlEvening {
|
||||||
@ -152,7 +141,7 @@ sub getAutoShuttersControlEvening {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoShuttersControlEvening', 'on' );
|
return ::AttrVal( $name, 'ASC_autoShuttersControlEvening', 'on' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAutoShuttersControlComfort {
|
sub getAutoShuttersControlComfort {
|
||||||
@ -160,7 +149,7 @@ sub getAutoShuttersControlComfort {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_autoShuttersControlComfort', 'off' );
|
return ::AttrVal( $name, 'ASC_autoShuttersControlComfort', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getFreezeTemp {
|
sub getFreezeTemp {
|
||||||
@ -168,7 +157,7 @@ sub getFreezeTemp {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_freezeTemp', 3 );
|
return ::AttrVal( $name, 'ASC_freezeTemp', 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getSlatDriveCmdInverse {
|
sub getSlatDriveCmdInverse {
|
||||||
@ -176,7 +165,7 @@ sub getSlatDriveCmdInverse {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_slatDriveCmdInverse', 0 );
|
return ::AttrVal( $name, 'ASC_slatDriveCmdInverse', 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _getTempSensor {
|
sub _getTempSensor {
|
||||||
@ -186,11 +175,11 @@ sub _getTempSensor {
|
|||||||
|
|
||||||
return $self->{ASC_tempSensor}->{device}
|
return $self->{ASC_tempSensor}->{device}
|
||||||
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$self->{ASC_tempSensor}->{LASTGETTIME} = int( gettimeofday() );
|
$self->{ASC_tempSensor}->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $device, $reading ) =
|
my ( $device, $reading ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_tempSensor',
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
||||||
'none' );
|
'ASC_tempSensor', 'none' );
|
||||||
|
|
||||||
## erwartetes Ergebnis
|
## erwartetes Ergebnis
|
||||||
# DEVICE:READING
|
# DEVICE:READING
|
||||||
@ -208,7 +197,7 @@ sub getTempSensorReading {
|
|||||||
|
|
||||||
return $self->{ASC_tempSensor}->{reading}
|
return $self->{ASC_tempSensor}->{reading}
|
||||||
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor;
|
||||||
return $self->{ASC_tempSensor}->{reading};
|
return $self->{ASC_tempSensor}->{reading};
|
||||||
}
|
}
|
||||||
@ -220,8 +209,9 @@ sub _getResidentsDev {
|
|||||||
|
|
||||||
return $self->{ASC_residentsDev}->{device}
|
return $self->{ASC_residentsDev}->{device}
|
||||||
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) <
|
||||||
$self->{ASC_residentsDev}->{LASTGETTIME} = int( gettimeofday() );
|
2 );
|
||||||
|
$self->{ASC_residentsDev}->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $device, $reading ) =
|
my ( $device, $reading ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
||||||
'ASC_residentsDev', 'none' );
|
'ASC_residentsDev', 'none' );
|
||||||
@ -240,7 +230,8 @@ sub getResidentsReading {
|
|||||||
|
|
||||||
return $self->{ASC_residentsDev}->{reading}
|
return $self->{ASC_residentsDev}->{reading}
|
||||||
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) <
|
||||||
|
2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev;
|
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev;
|
||||||
return $self->{ASC_residentsDev}->{reading};
|
return $self->{ASC_residentsDev}->{reading};
|
||||||
}
|
}
|
||||||
@ -252,11 +243,11 @@ sub _getRainSensor {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{device}
|
return $self->{ASC_rainSensor}->{device}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$self->{ASC_rainSensor}->{LASTGETTIME} = int( gettimeofday() );
|
$self->{ASC_rainSensor}->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $device, $reading, $max, $hyst, $pos, $wait ) =
|
my ( $device, $reading, $max, $hyst, $pos, $wait ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_rainSensor',
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
||||||
'none' );
|
'ASC_rainSensor', 'none' );
|
||||||
|
|
||||||
## erwartetes Ergebnis
|
## erwartetes Ergebnis
|
||||||
# DEVICE:READING MAX:HYST
|
# DEVICE:READING MAX:HYST
|
||||||
@ -266,10 +257,10 @@ sub _getRainSensor {
|
|||||||
$self->{ASC_rainSensor}->{reading} =
|
$self->{ASC_rainSensor}->{reading} =
|
||||||
( $reading ne 'none' ? $reading : 'rain' );
|
( $reading ne 'none' ? $reading : 'rain' );
|
||||||
$self->{ASC_rainSensor}->{triggermax} = (
|
$self->{ASC_rainSensor}->{triggermax} = (
|
||||||
( $max ne 'none'
|
( $max ne 'none' && $max =~ m{\A(-?\d+(\.\d+)?)\z}xms )
|
||||||
&& $max =~ m{\A(-?\d+(\.\d+)?)\z}xms )
|
|
||||||
? $max
|
? $max
|
||||||
: 1000 );
|
: 1000
|
||||||
|
);
|
||||||
|
|
||||||
$self->{ASC_rainSensor}->{triggerhyst} = (
|
$self->{ASC_rainSensor}->{triggerhyst} = (
|
||||||
$hyst ne 'none'
|
$hyst ne 'none'
|
||||||
@ -277,10 +268,11 @@ sub _getRainSensor {
|
|||||||
: ( $self->{ASC_rainSensor}->{triggermax} * 0 )
|
: ( $self->{ASC_rainSensor}->{triggermax} * 0 )
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{ASC_rainSensor}->{shuttersClosedPos} =
|
$self->{ASC_rainSensor}->{shuttersClosedPos} = (
|
||||||
( $pos ne 'none'
|
$pos ne 'none'
|
||||||
? $pos
|
? $pos
|
||||||
: $FHEM::Automation::ShuttersControl::shutters->getClosedPos );
|
: $FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
|
);
|
||||||
$self->{ASC_rainSensor}->{waitingTime} =
|
$self->{ASC_rainSensor}->{waitingTime} =
|
||||||
( $wait ne 'none' ? $wait : 0 );
|
( $wait ne 'none' ? $wait : 0 );
|
||||||
|
|
||||||
@ -294,7 +286,7 @@ sub getRainSensorReading {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{reading}
|
return $self->{ASC_rainSensor}->{reading}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
||||||
return $self->{ASC_rainSensor}->{reading};
|
return $self->{ASC_rainSensor}->{reading};
|
||||||
}
|
}
|
||||||
@ -306,7 +298,7 @@ sub getRainTriggerMax {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{triggermax}
|
return $self->{ASC_rainSensor}->{triggermax}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
||||||
return $self->{ASC_rainSensor}->{triggermax};
|
return $self->{ASC_rainSensor}->{triggermax};
|
||||||
}
|
}
|
||||||
@ -318,7 +310,7 @@ sub getRainTriggerMin {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{triggerhyst}
|
return $self->{ASC_rainSensor}->{triggerhyst}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
||||||
return $self->{ASC_rainSensor}->{triggerhyst};
|
return $self->{ASC_rainSensor}->{triggerhyst};
|
||||||
}
|
}
|
||||||
@ -330,7 +322,7 @@ sub getRainSensorShuttersClosedPos {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{shuttersClosedPos}
|
return $self->{ASC_rainSensor}->{shuttersClosedPos}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
||||||
return $self->{ASC_rainSensor}->{shuttersClosedPos};
|
return $self->{ASC_rainSensor}->{shuttersClosedPos};
|
||||||
}
|
}
|
||||||
@ -342,7 +334,7 @@ sub getRainWaitingTime {
|
|||||||
|
|
||||||
return $self->{ASC_rainSensor}->{waitingTime}
|
return $self->{ASC_rainSensor}->{waitingTime}
|
||||||
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
|
||||||
return $self->{ASC_rainSensor}->{waitingTime};
|
return $self->{ASC_rainSensor}->{waitingTime};
|
||||||
}
|
}
|
||||||
@ -354,11 +346,11 @@ sub _getWindSensor {
|
|||||||
|
|
||||||
return $self->{ASC_windSensor}->{device}
|
return $self->{ASC_windSensor}->{device}
|
||||||
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$self->{ASC_windSensor}->{LASTGETTIME} = int( gettimeofday() );
|
$self->{ASC_windSensor}->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $device, $reading ) =
|
my ( $device, $reading ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_windSensor',
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
|
||||||
'none' );
|
'ASC_windSensor', 'none' );
|
||||||
|
|
||||||
return $device if ( $device eq 'none' );
|
return $device if ( $device eq 'none' );
|
||||||
$self->{ASC_windSensor}->{device} = $device;
|
$self->{ASC_windSensor}->{device} = $device;
|
||||||
@ -375,7 +367,7 @@ sub getWindSensorReading {
|
|||||||
|
|
||||||
return $self->{ASC_windSensor}->{reading}
|
return $self->{ASC_windSensor}->{reading}
|
||||||
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
|
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
|
&& ( ::gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor;
|
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor;
|
||||||
return (
|
return (
|
||||||
defined( $self->{ASC_windSensor}->{reading} )
|
defined( $self->{ASC_windSensor}->{reading} )
|
||||||
@ -389,18 +381,23 @@ sub getBlockAscDrivesAfterManual {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_blockAscDrivesAfterManual', 0 );
|
return ::AttrVal( $name, 'ASC_blockAscDrivesAfterManual', 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAdvDate {
|
sub getAdvStartDate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return AttrVal( $name, 'ASC_advDate', 'FirstAdvent' );
|
return ::AttrVal( $name, 'ASC_advStartDate', 'FirstAdvent' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub getAdvEndDate {
|
||||||
|
my $self = shift;
|
||||||
|
|
||||||
|
my $name = $self->{name};
|
||||||
|
|
||||||
|
return ::AttrVal( $name, 'ASC_advEndDate', 'EpiphanyDay' );
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -48,12 +48,7 @@ use GPUtils qw(GP_Import);
|
|||||||
|
|
||||||
## Import der FHEM Funktionen
|
## Import der FHEM Funktionen
|
||||||
BEGIN {
|
BEGIN {
|
||||||
GP_Import(
|
GP_Import(qw(defs));
|
||||||
qw(
|
|
||||||
readingsSingleUpdate
|
|
||||||
ReadingsVal
|
|
||||||
defs)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setDelayCmdReading {
|
sub setDelayCmdReading {
|
||||||
@ -62,7 +57,7 @@ sub setDelayCmdReading {
|
|||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
readingsSingleUpdate(
|
::readingsSingleUpdate(
|
||||||
$hash,
|
$hash,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
. '_lastDelayPosValue',
|
. '_lastDelayPosValue',
|
||||||
@ -79,7 +74,7 @@ sub setStateReading {
|
|||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
readingsSingleUpdate(
|
::readingsSingleUpdate(
|
||||||
$hash, 'state',
|
$hash, 'state',
|
||||||
(
|
(
|
||||||
defined($value)
|
defined($value)
|
||||||
@ -97,7 +92,7 @@ sub setPosReading {
|
|||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
readingsSingleUpdate(
|
::readingsSingleUpdate(
|
||||||
$hash,
|
$hash,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
. '_PosValue',
|
. '_PosValue',
|
||||||
@ -113,7 +108,7 @@ sub setLastPosReading {
|
|||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
|
|
||||||
readingsSingleUpdate(
|
::readingsSingleUpdate(
|
||||||
$hash,
|
$hash,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
. '_lastPosValue',
|
. '_lastPosValue',
|
||||||
@ -128,7 +123,7 @@ sub getPartyMode {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'partyMode', 'off' );
|
return ::ReadingsVal( $name, 'partyMode', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getHardLockOut {
|
sub getHardLockOut {
|
||||||
@ -136,7 +131,7 @@ sub getHardLockOut {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'hardLockOut', 'none' );
|
return ::ReadingsVal( $name, 'hardLockOut', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getSunriseTimeWeHoliday {
|
sub getSunriseTimeWeHoliday {
|
||||||
@ -144,7 +139,7 @@ sub getSunriseTimeWeHoliday {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'sunriseTimeWeHoliday', 'none' );
|
return ::ReadingsVal( $name, 'sunriseTimeWeHoliday', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getMonitoredDevs {
|
sub getMonitoredDevs {
|
||||||
@ -152,14 +147,14 @@ sub getMonitoredDevs {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
$self->{monitoredDevs} = ReadingsVal( $name, '.monitoredDevs', 'none' );
|
$self->{monitoredDevs} = ::ReadingsVal( $name, '.monitoredDevs', 'none' );
|
||||||
return $self->{monitoredDevs};
|
return $self->{monitoredDevs};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getOutTemp {
|
sub getOutTemp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsVal(
|
return ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor,
|
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor,
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getTempSensorReading,
|
$FHEM::Automation::ShuttersControl::ascDev->getTempSensorReading,
|
||||||
-100 );
|
-100 );
|
||||||
@ -169,7 +164,8 @@ sub getResidentsStatus {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val =
|
my $val =
|
||||||
ReadingsVal( $FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
::ReadingsVal(
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getResidentsReading,
|
$FHEM::Automation::ShuttersControl::ascDev->getResidentsReading,
|
||||||
'none' );
|
'none' );
|
||||||
|
|
||||||
@ -178,7 +174,7 @@ sub getResidentsStatus {
|
|||||||
return $1 && $1 eq 'pet' ? 'absent' : $2;
|
return $1 && $1 eq 'pet' ? 'absent' : $2;
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
ReadingsVal(
|
::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
||||||
'homealoneType', '-' ) eq 'PET'
|
'homealoneType', '-' ) eq 'PET'
|
||||||
)
|
)
|
||||||
@ -196,7 +192,8 @@ sub getResidentsLastStatus {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val =
|
my $val =
|
||||||
ReadingsVal( $FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
::ReadingsVal(
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
||||||
'lastState', 'none' );
|
'lastState', 'none' );
|
||||||
|
|
||||||
if ( $val =~ m{^(?:(.+)_)?(.+)$}xms ) {
|
if ( $val =~ m{^(?:(.+)_)?(.+)$}xms ) {
|
||||||
@ -204,7 +201,7 @@ sub getResidentsLastStatus {
|
|||||||
return $1 && $1 eq 'pet' ? 'absent' : $2;
|
return $1 && $1 eq 'pet' ? 'absent' : $2;
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
ReadingsVal(
|
::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
|
||||||
'lastHomealoneType', '-' ) eq 'PET'
|
'lastHomealoneType', '-' ) eq 'PET'
|
||||||
)
|
)
|
||||||
@ -223,7 +220,7 @@ sub getAutoShuttersControlShading {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'controlShading', 'none' );
|
return ::ReadingsVal( $name, 'controlShading', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getSelfDefense {
|
sub getSelfDefense {
|
||||||
@ -231,7 +228,7 @@ sub getSelfDefense {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'selfDefense', 'none' );
|
return ::ReadingsVal( $name, 'selfDefense', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAzimuth {
|
sub getAzimuth {
|
||||||
@ -239,13 +236,13 @@ sub getAzimuth {
|
|||||||
|
|
||||||
my $azimuth;
|
my $azimuth;
|
||||||
|
|
||||||
$azimuth = ReadingsVal(
|
$azimuth = ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
||||||
'azimuth', -1 )
|
'azimuth', -1 )
|
||||||
if (
|
if (
|
||||||
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
|
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
|
||||||
->{TYPE} eq 'Twilight' );
|
->{TYPE} eq 'Twilight' );
|
||||||
$azimuth = ReadingsVal(
|
$azimuth = ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
||||||
'SunAz', -1 )
|
'SunAz', -1 )
|
||||||
if (
|
if (
|
||||||
@ -260,13 +257,13 @@ sub getElevation {
|
|||||||
|
|
||||||
my $elevation;
|
my $elevation;
|
||||||
|
|
||||||
$elevation = ReadingsVal(
|
$elevation = ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
||||||
'elevation', -1 )
|
'elevation', -1 )
|
||||||
if (
|
if (
|
||||||
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
|
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
|
||||||
->{TYPE} eq 'Twilight' );
|
->{TYPE} eq 'Twilight' );
|
||||||
$elevation = ReadingsVal(
|
$elevation = ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
|
||||||
'SunAlt', -1 )
|
'SunAlt', -1 )
|
||||||
if (
|
if (
|
||||||
@ -281,7 +278,7 @@ sub getASCenable {
|
|||||||
|
|
||||||
my $name = $self->{name};
|
my $name = $self->{name};
|
||||||
|
|
||||||
return ReadingsVal( $name, 'ascEnable', 'none' );
|
return ::ReadingsVal( $name, 'ascEnable', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2021 Copyright: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -52,7 +52,9 @@ use FHEM::Automation::ShuttersControl::Shading qw (:ALL);
|
|||||||
use FHEM::Automation::ShuttersControl::Rainprotection qw (:ALL);
|
use FHEM::Automation::ShuttersControl::Rainprotection qw (:ALL);
|
||||||
|
|
||||||
require Exporter;
|
require Exporter;
|
||||||
our @ISA = qw(Exporter);
|
use base qw(Exporter);
|
||||||
|
|
||||||
|
# our @ISA = qw(Exporter);
|
||||||
our @EXPORT_OK = qw(
|
our @EXPORT_OK = qw(
|
||||||
EventProcessingPartyMode
|
EventProcessingPartyMode
|
||||||
EventProcessingGeneral
|
EventProcessingGeneral
|
||||||
@ -70,21 +72,6 @@ our %EXPORT_TAGS = (
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
Log3
|
|
||||||
gettimeofday
|
|
||||||
computeAlignTime
|
|
||||||
CommandSet
|
|
||||||
ReadingsVal
|
|
||||||
RemoveInternalTimer
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub EventProcessingGeneral {
|
sub EventProcessingGeneral {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
my $devname = shift;
|
my $devname = shift;
|
||||||
@ -94,8 +81,12 @@ sub EventProcessingGeneral {
|
|||||||
|
|
||||||
if ( defined($devname) && ($devname) )
|
if ( defined($devname) && ($devname) )
|
||||||
{ # es wird lediglich der Devicename der Funktion mitgegeben wenn es sich nicht um global handelt daher hier die Unterscheidung
|
{ # es wird lediglich der Devicename der Funktion mitgegeben wenn es sich nicht um global handelt daher hier die Unterscheidung
|
||||||
my $windReading = $FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading // 'none';
|
my $windReading =
|
||||||
my $rainReading = $FHEM::Automation::ShuttersControl::ascDev->getRainSensorReading // 'none';
|
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading
|
||||||
|
// 'none';
|
||||||
|
my $rainReading =
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev->getRainSensorReading
|
||||||
|
// 'none';
|
||||||
|
|
||||||
while ( my ( $device, $deviceAttr ) =
|
while ( my ( $device, $deviceAttr ) =
|
||||||
each %{ $hash->{monitoredDevs}{$devname} } )
|
each %{ $hash->{monitoredDevs}{$devname} } )
|
||||||
@ -122,13 +113,16 @@ sub EventProcessingGeneral {
|
|||||||
EventProcessingExternalTriggerDevice( $hash, $device, $events )
|
EventProcessingExternalTriggerDevice( $hash, $device, $events )
|
||||||
if ( $deviceAttr eq 'ASC_ExternalTrigger' );
|
if ( $deviceAttr eq 'ASC_ExternalTrigger' );
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($device)
|
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev(
|
||||||
|
$device)
|
||||||
if ( $deviceAttr eq 'ASC_BrightnessSensor' );
|
if ( $deviceAttr eq 'ASC_BrightnessSensor' );
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$deviceAttr eq 'ASC_BrightnessSensor'
|
$deviceAttr eq 'ASC_BrightnessSensor'
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'brightness'
|
&& ( $FHEM::Automation::ShuttersControl::shutters->getDown eq
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq 'brightness' )
|
'brightness'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
||||||
|
'brightness' )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EventProcessingBrightness( $hash, $device, $events );
|
EventProcessingBrightness( $hash, $device, $events );
|
||||||
@ -139,6 +133,10 @@ sub EventProcessingGeneral {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { # alles was kein Devicenamen mit übergeben hat landet hier
|
else { # alles was kein Devicenamen mit übergeben hat landet hier
|
||||||
|
::Log3( $name, 4,
|
||||||
|
"AutoShuttersControl ($name) - EventProcessing: All without device name in the Event"
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$events =~ m{^ATTR\s(.*)
|
$events =~ m{^ATTR\s(.*)
|
||||||
\s(ASC_Roommate_Device|ASC_WindowRec|ASC_residentsDev|ASC_rainSensor
|
\s(ASC_Roommate_Device|ASC_WindowRec|ASC_residentsDev|ASC_rainSensor
|
||||||
@ -147,8 +145,9 @@ sub EventProcessingGeneral {
|
|||||||
\s(.*)$}xms
|
\s(.*)$}xms
|
||||||
)
|
)
|
||||||
{ # wurde den Attributen unserer Rolläden ein Wert zugewiesen ?
|
{ # wurde den Attributen unserer Rolläden ein Wert zugewiesen ?
|
||||||
FHEM::Automation::ShuttersControl::AddNotifyDev( $hash, $3, $1, $2 ) if ( $3 ne 'none' );
|
FHEM::Automation::ShuttersControl::AddNotifyDev( $hash, $3, $1, $2 )
|
||||||
Log3( $name, 4,
|
if ( $3 ne 'none' );
|
||||||
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessing: ATTR" );
|
"AutoShuttersControl ($name) - EventProcessing: ATTR" );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
@ -160,7 +159,7 @@ sub EventProcessingGeneral {
|
|||||||
$}xms
|
$}xms
|
||||||
)
|
)
|
||||||
{ # wurde das Attribut unserer Rolläden gelöscht ?
|
{ # wurde das Attribut unserer Rolläden gelöscht ?
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessing: DELETEATTR" );
|
"AutoShuttersControl ($name) - EventProcessing: DELETEATTR" );
|
||||||
FHEM::Automation::ShuttersControl::DeleteNotifyDev( $hash, $1, $2 );
|
FHEM::Automation::ShuttersControl::DeleteNotifyDev( $hash, $1, $2 );
|
||||||
}
|
}
|
||||||
@ -175,11 +174,17 @@ sub EventProcessingGeneral {
|
|||||||
(.*)?}xms
|
(.*)?}xms
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( $hash, $2 )
|
::Log3( $name, 4,
|
||||||
|
"AutoShuttersControl ($name) - EventProcessing: Morning and Evening Time Shedules"
|
||||||
|
);
|
||||||
|
|
||||||
|
FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer(
|
||||||
|
$hash, $2 )
|
||||||
if (
|
if (
|
||||||
$3 ne 'ASC_Time_Up_WE_Holiday'
|
$3 ne 'ASC_Time_Up_WE_Holiday'
|
||||||
|| ( $3 eq 'ASC_Time_Up_WE_Holiday'
|
|| ( $3 eq 'ASC_Time_Up_WE_Holiday'
|
||||||
&& $FHEM::Automation::ShuttersControl::ascDev->getSunriseTimeWeHoliday eq 'on' )
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
|
->getSunriseTimeWeHoliday eq 'on' )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
@ -189,7 +194,8 @@ sub EventProcessingGeneral {
|
|||||||
(.*)?}xms
|
(.*)?}xms
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FHEM::Automation::ShuttersControl::RenewSunRiseSetShuttersTimer($hash);
|
FHEM::Automation::ShuttersControl::RenewSunRiseSetShuttersTimer(
|
||||||
|
$hash);
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
$events =~ m{^(DELETEATTR|ATTR)
|
$events =~ m{^(DELETEATTR|ATTR)
|
||||||
@ -197,7 +203,8 @@ sub EventProcessingGeneral {
|
|||||||
(.*)?}xms
|
(.*)?}xms
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->deleteShadingStateChangeSunny;
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->deleteShadingStateChangeSunny;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -210,7 +217,7 @@ m{^(DELETEATTR|ATTR) #global ATTR myASC ASC_tempSensor Cellar
|
|||||||
(.*)?}xms
|
(.*)?}xms
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# ATTR RolloKinZimSteven_F1 ASC_Shading_Mode off
|
# ATTR RolloKinZimSteven_F1 ASC_Shading_Mode off
|
||||||
if ( $events =~ m{^ATTR\s(.*)\sASC_Shading_Mode\s(off)}xms ) {
|
if ( $events =~ m{^ATTR\s(.*)\sASC_Shading_Mode\s(off)}xms ) {
|
||||||
my %funcHash = (
|
my %funcHash = (
|
||||||
hash => $hash,
|
hash => $hash,
|
||||||
@ -219,11 +226,13 @@ m{^(DELETEATTR|ATTR) #global ATTR myASC ASC_tempSensor Cellar
|
|||||||
attrEvent => 1,
|
attrEvent => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn(\%funcHash);
|
FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn(
|
||||||
|
\%funcHash );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CommandSet( undef, $name . ' controlShading on' )
|
::CommandSet( undef, $name . ' controlShading on' )
|
||||||
if ( ReadingsVal( $name, 'controlShading', 'off' ) ne 'off' );
|
if (
|
||||||
|
::ReadingsVal( $name, 'controlShading', 'off' ) ne 'off' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,9 +252,17 @@ sub EventProcessingWindowRec {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getWinDevReading;
|
$FHEM::Automation::ShuttersControl::shutters->getWinDevReading;
|
||||||
|
|
||||||
if ( $events =~
|
if ( $events =~
|
||||||
m{.*$reading:.*?([Oo]pen(?>ed)?|[Cc]losed?|tilt(?>ed)?|true|false)}xms
|
m{.*$reading:.*?([Oo]pen(?>ed)?|[Cc]losed?|tilt(?>ed)?|true|false)}xms )
|
||||||
&& IsAfterShuttersManualBlocking($shuttersDev) )
|
|
||||||
{
|
{
|
||||||
|
return
|
||||||
|
if (
|
||||||
|
!IsAfterShuttersManualBlocking($shuttersDev)
|
||||||
|
&& ( $FHEM::Automation::ShuttersControl::shutters->getLockOut eq
|
||||||
|
'off'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace ne 'terrace' )
|
||||||
|
);
|
||||||
|
|
||||||
my $match = $1;
|
my $match = $1;
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
@ -260,11 +277,6 @@ sub EventProcessingWindowRec {
|
|||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev(
|
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev(
|
||||||
$shuttersDev);
|
$shuttersDev);
|
||||||
my $homemode =
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus;
|
|
||||||
$homemode =
|
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getResidentsStatus
|
|
||||||
if ( $homemode eq 'none' );
|
|
||||||
|
|
||||||
#### Hardware Lock der Rollläden
|
#### Hardware Lock der Rollläden
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setHardLockOut('off')
|
$FHEM::Automation::ShuttersControl::shutters->setHardLockOut('off')
|
||||||
@ -272,9 +284,25 @@ sub EventProcessingWindowRec {
|
|||||||
&& $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace
|
&& $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace
|
||||||
eq 'terrace' );
|
eq 'terrace' );
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on')
|
$FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on')
|
||||||
if ( $match =~ m{[Oo]pen|false}xms
|
if (
|
||||||
|
$match =~ m{[Oo]pen|false}xms
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace
|
&& $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace
|
||||||
eq 'terrace' );
|
eq 'terrace'
|
||||||
|
&& ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return
|
||||||
|
if ( !IsAfterShuttersManualBlocking($shuttersDev) );
|
||||||
|
|
||||||
|
my $homemode =
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus;
|
||||||
|
$homemode =
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev->getResidentsStatus
|
||||||
|
if ( $homemode eq 'none' );
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
'EventProcessingWindowRec: '
|
'EventProcessingWindowRec: '
|
||||||
@ -303,18 +331,33 @@ sub EventProcessingWindowRec {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos
|
$FHEM::Automation::ShuttersControl::shutters->getComfortOpenPos
|
||||||
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getLastDrive
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
eq 'ventilate - window open'
|
->getLastDrive eq 'ventilate - window open'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getSubTyp
|
&& $FHEM::Automation::ShuttersControl::shutters->getSubTyp
|
||||||
eq 'twostate'
|
eq 'twostate'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
eq 'on' )
|
->getVentilateOpen eq 'on' )
|
||||||
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getPrivacyDownPos
|
->getPrivacyDownPos
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getPrivacyDownStatus == 1
|
->getPrivacyDownStatus != 2
|
||||||
&& !$FHEM::Automation::ShuttersControl::shutters->getIsDay )
|
&& !$FHEM::Automation::ShuttersControl::shutters->getIsDay )
|
||||||
|
|| (
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
|
&& ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getLockOut ne 'off'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace' )
|
||||||
|
&& !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
|
)
|
||||||
|
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getDelayCmd ne 'none'
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace' )
|
||||||
)
|
)
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen
|
&& ( $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen
|
||||||
eq 'on'
|
eq 'on'
|
||||||
@ -355,13 +398,19 @@ sub EventProcessingWindowRec {
|
|||||||
elsif (
|
elsif (
|
||||||
!$FHEM::Automation::ShuttersControl::shutters
|
!$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getIfInShading
|
->getIfInShading
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters->getStatus
|
&& (
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getStatus
|
||||||
!= $FHEM::Automation::ShuttersControl::shutters
|
!= $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getOpenPos
|
->getOpenPos
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getStatus !=
|
->getStatus !=
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastManPos )
|
->getLastManPos
|
||||||
|
|| ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getDelayCmd ne 'none'
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace' )
|
||||||
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters
|
if ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -385,6 +434,13 @@ sub EventProcessingWindowRec {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->setDriveCmd(
|
->setDriveCmd(
|
||||||
(
|
(
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getDelayCmd ne 'none'
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace'
|
||||||
|
? $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getDelayCmd
|
||||||
|
: (
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getVentilatePosAfterDayClosed eq 'open'
|
->getVentilatePosAfterDayClosed eq 'open'
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
? $FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -392,19 +448,22 @@ sub EventProcessingWindowRec {
|
|||||||
: $FHEM::Automation::ShuttersControl::shutters
|
: $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastManPos
|
->getLastManPos
|
||||||
)
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
!$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
!$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getModeDown eq 'roommate'
|
&& $FHEM::Automation::ShuttersControl::shutters->getModeDown eq
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus eq 'home'
|
'roommate'
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus eq 'awoken' )
|
&& ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getRoommatesStatus eq 'home'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getRoommatesStatus eq 'awoken' )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
||||||
->setDriveCmd(
|
|
||||||
(
|
(
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getVentilatePosAfterDayClosed eq 'open'
|
->getVentilatePosAfterDayClosed eq 'open'
|
||||||
@ -468,9 +527,16 @@ sub EventProcessingWindowRec {
|
|||||||
)
|
)
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen
|
&& $FHEM::Automation::ShuttersControl::shutters->getVentilateOpen
|
||||||
eq 'on'
|
eq 'on'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& (
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getQueryShuttersPos(
|
->getQueryShuttersPos(
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getVentilatePos
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getVentilatePos
|
||||||
|
)
|
||||||
|
|| ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace'
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters->getSubTyp
|
||||||
|
eq 'twostate' )
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -501,7 +567,7 @@ sub EventProcessingWindowRec {
|
|||||||
if (
|
if (
|
||||||
$FHEM::Automation::ShuttersControl::ascDev
|
$FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlComfort eq 'on'
|
->getAutoShuttersControlComfort eq 'on'
|
||||||
and $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getQueryShuttersPos(
|
->getQueryShuttersPos(
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getComfortOpenPos
|
->getComfortOpenPos
|
||||||
@ -527,7 +593,7 @@ sub EventProcessingWindowRec {
|
|||||||
$setLastDrive = 'ventilate - window open';
|
$setLastDrive = 'ventilate - window open';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( defined($posValue) && $posValue ) {
|
if ( defined($posValue) ) {
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
$setLastDrive);
|
$setLastDrive);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(1);
|
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(1);
|
||||||
@ -553,14 +619,15 @@ sub EventProcessingRoommate {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading;
|
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading;
|
||||||
|
|
||||||
if ( $events =~ m{$reading:\s(absent|gotosleep|asleep|awoken|home)}xms ) {
|
if ( $events =~ m{$reading:\s(absent|gotosleep|asleep|awoken|home)}xms ) {
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate: "
|
"AutoShuttersControl ($name) - EventProcessingRoommate: "
|
||||||
. $FHEM::Automation::ShuttersControl::shutters
|
. $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getRoommatesReading );
|
->getRoommatesReading );
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate: $shuttersDev und Events $events"
|
"AutoShuttersControl ($name) - EventProcessingRoommate: $shuttersDev und Events $events"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $event = $1;
|
||||||
my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
|
my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
|
||||||
my $getModeDown =
|
my $getModeDown =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getModeDown;
|
$FHEM::Automation::ShuttersControl::shutters->getModeDown;
|
||||||
@ -568,21 +635,30 @@ sub EventProcessingRoommate {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus;
|
$FHEM::Automation::ShuttersControl::shutters->getRoommatesStatus;
|
||||||
my $getRoommatesLastStatus =
|
my $getRoommatesLastStatus =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getRoommatesLastStatus;
|
$FHEM::Automation::ShuttersControl::shutters->getRoommatesLastStatus;
|
||||||
my $event = $1;
|
my $getUp = $FHEM::Automation::ShuttersControl::shutters->getUp;
|
||||||
my $posValue = $FHEM::Automation::ShuttersControl::shutters->getStatus;
|
my $getDown = $FHEM::Automation::ShuttersControl::shutters->getDown;
|
||||||
|
my $getIsDay = $FHEM::Automation::ShuttersControl::shutters->getIsDay;
|
||||||
|
|
||||||
|
my $posValue = $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getStatus; # !!! ACHTUNG!!!
|
||||||
|
|
||||||
if (
|
if (
|
||||||
( $event eq 'home' || $event eq 'awoken' )
|
( $event eq 'home' || $event eq 'awoken' )
|
||||||
&& ( $getRoommatesStatus eq 'home'
|
&& ( $getRoommatesStatus eq 'home'
|
||||||
|| $getRoommatesStatus eq 'awoken' )
|
|| $getRoommatesStatus eq 'awoken' )
|
||||||
&& ( $FHEM::Automation::ShuttersControl::ascDev
|
&& (
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlMorning eq 'on'
|
->getAutoShuttersControlMorning eq 'on'
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
|| (
|
||||||
'roommate' )
|
$getUp eq 'roommate'
|
||||||
|
&& ( $getRoommatesLastStatus eq 'asleep'
|
||||||
|
|| $getRoommatesLastStatus ne 'awoken' )
|
||||||
|
)
|
||||||
|
)
|
||||||
&& IsAfterShuttersManualBlocking($shuttersDev)
|
&& IsAfterShuttersManualBlocking($shuttersDev)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate_1: $shuttersDev und Events $events"
|
"AutoShuttersControl ($name) - EventProcessingRoommate_1: $shuttersDev und Events $events"
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
@ -591,26 +667,24 @@ sub EventProcessingRoommate {
|
|||||||
$getRoommatesLastStatus eq 'asleep'
|
$getRoommatesLastStatus eq 'asleep'
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters
|
&& ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getModeUp eq 'always'
|
->getModeUp eq 'always'
|
||||||
or $FHEM::Automation::ShuttersControl::shutters
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getModeUp eq $event )
|
->getModeUp eq $event )
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
$getRoommatesLastStatus eq 'awoken'
|
$getRoommatesLastStatus eq 'awoken'
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters
|
&& ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getModeUp eq 'always'
|
->getModeUp eq 'always'
|
||||||
or $FHEM::Automation::ShuttersControl::shutters
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getModeUp eq $event )
|
->getModeUp eq $event )
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
&& ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
|
&& ( $getIsDay
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
|| $getUp eq 'roommate' )
|
||||||
'roommate' )
|
|
||||||
&& ( IsAfterShuttersTimeBlocking($shuttersDev)
|
&& ( IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
|| $getUp eq 'roommate' )
|
||||||
'roommate' )
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate_2: $shuttersDev und Events $events"
|
"AutoShuttersControl ($name) - EventProcessingRoommate_2: $shuttersDev und Events $events"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -648,7 +722,7 @@ sub EventProcessingRoommate {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
$getIsDay
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getIfInShading
|
->getIfInShading
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getStatus
|
&& $FHEM::Automation::ShuttersControl::shutters->getStatus
|
||||||
@ -668,12 +742,11 @@ sub EventProcessingRoommate {
|
|||||||
ShadingProcessingDriveCommand( $hash, $shuttersDev, 1 );
|
ShadingProcessingDriveCommand( $hash, $shuttersDev, 1 );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
!$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
!$getIsDay
|
||||||
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
&& ( $getModeDown eq 'home'
|
&& ( $getModeDown eq 'home'
|
||||||
|| $getModeDown eq 'always' )
|
|| $getModeDown eq 'always' )
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getDown ne
|
&& $getDown ne 'roommate'
|
||||||
'roommate'
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
@ -711,11 +784,7 @@ sub EventProcessingRoommate {
|
|||||||
$hash, $shuttersDev, $posValue );
|
$hash, $shuttersDev, $posValue );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
(
|
( $getIsDay || $getUp eq 'roommate' )
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp
|
|
||||||
eq 'roommate'
|
|
||||||
)
|
|
||||||
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
&& ( $getModeUp eq 'home'
|
&& ( $getModeUp eq 'home'
|
||||||
|| $getModeUp eq 'always' )
|
|| $getModeUp eq 'always' )
|
||||||
@ -797,11 +866,9 @@ sub EventProcessingRoommate {
|
|||||||
'absent'
|
'absent'
|
||||||
&& ( $FHEM::Automation::ShuttersControl::ascDev
|
&& ( $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlEvening eq 'on'
|
->getAutoShuttersControlEvening eq 'on'
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getDown eq
|
|| $getDown eq 'roommate' )
|
||||||
'roommate' )
|
|
||||||
&& ( IsAfterShuttersManualBlocking($shuttersDev)
|
&& ( IsAfterShuttersManualBlocking($shuttersDev)
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getDown eq
|
|| $getDown eq 'roommate' )
|
||||||
'roommate' )
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
@ -831,9 +898,8 @@ sub EventProcessingRoommate {
|
|||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
$event eq 'absent'
|
$event eq 'absent'
|
||||||
&& ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
&& ( !$getIsDay
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getDown eq
|
|| $getDown eq 'roommate'
|
||||||
'roommate'
|
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode
|
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode
|
||||||
eq 'absent'
|
eq 'absent'
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
|
|| $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
|
||||||
@ -842,16 +908,12 @@ sub EventProcessingRoommate {
|
|||||||
'absent' )
|
'absent' )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate absent: $shuttersDev"
|
"AutoShuttersControl ($name) - EventProcessingRoommate absent: $shuttersDev"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(
|
$getIsDay
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
|
||||||
'roommate'
|
|
||||||
)
|
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
&& $FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
||||||
&& !$FHEM::Automation::ShuttersControl::shutters
|
&& !$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getQueryShuttersPos(
|
->getQueryShuttersPos(
|
||||||
@ -861,7 +923,7 @@ sub EventProcessingRoommate {
|
|||||||
eq 'absent'
|
eq 'absent'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate Shading: $shuttersDev"
|
"AutoShuttersControl ($name) - EventProcessingRoommate Shading: $shuttersDev"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -873,17 +935,11 @@ sub EventProcessingRoommate {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
|
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (( !$getIsDay || $getDown eq 'roommate' )
|
||||||
(
|
|
||||||
!$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getDown eq
|
|
||||||
'roommate'
|
|
||||||
)
|
|
||||||
&& $getModeDown eq 'absent'
|
&& $getModeDown eq 'absent'
|
||||||
&& $getRoommatesStatus eq 'absent'
|
&& $getRoommatesStatus eq 'absent' )
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate Down: $shuttersDev"
|
"AutoShuttersControl ($name) - EventProcessingRoommate Down: $shuttersDev"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -895,12 +951,12 @@ sub EventProcessingRoommate {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elsif ($FHEM::Automation::ShuttersControl::shutters->getIsDay
|
elsif ($getIsDay
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
|
&& $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
|
||||||
'absent'
|
'absent'
|
||||||
&& $getRoommatesStatus eq 'absent' )
|
&& $getRoommatesStatus eq 'absent' )
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate Up: $shuttersDev"
|
"AutoShuttersControl ($name) - EventProcessingRoommate Up: $shuttersDev"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -911,7 +967,7 @@ sub EventProcessingRoommate {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getOpenPos );
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos );
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingRoommate NICHTS: $shuttersDev"
|
"AutoShuttersControl ($name) - EventProcessingRoommate NICHTS: $shuttersDev"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -948,6 +1004,7 @@ sub EventProcessingResidents {
|
|||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseMode ne 'off'
|
->getSelfDefenseMode ne 'off'
|
||||||
|| $getModeDown eq 'absent'
|
|| $getModeDown eq 'absent'
|
||||||
|
|
||||||
# || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github
|
# || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github
|
||||||
|| ( $FHEM::Automation::ShuttersControl::shutters
|
|| ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingMode eq 'absent'
|
->getShadingMode eq 'absent'
|
||||||
@ -965,13 +1022,17 @@ sub EventProcessingResidents {
|
|||||||
&& (
|
&& (
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseMode eq 'absent'
|
->getSelfDefenseMode eq 'absent'
|
||||||
|| ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
|| (
|
||||||
|
CheckIfShuttersWindowRecOpen($shuttersDev) == 2
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseMode eq 'gone'
|
->getSelfDefenseMode eq 'gone'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShuttersPlace eq 'terrace'
|
->getShuttersPlace eq 'terrace'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'EG_window' )
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseMode ne 'off' )
|
->getSelfDefenseMode ne 'off'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1022,11 +1083,14 @@ sub EventProcessingResidents {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastPos );
|
->getLastPos );
|
||||||
}
|
}
|
||||||
elsif ( $getModeDown eq 'absent' # || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github
|
elsif (
|
||||||
|
$getModeDown eq
|
||||||
|
'absent' # || $getModeDown eq 'always' ) Wird zu Testzwecken auskommentiert, siehe #90 Github
|
||||||
&& !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
&& !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getRoommatesStatus eq 'none' )
|
->getRoommatesStatus eq 'none'
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
'residents absent');
|
'residents absent');
|
||||||
@ -1086,6 +1150,8 @@ sub EventProcessingResidents {
|
|||||||
->getRoommatesStatus eq 'none'
|
->getRoommatesStatus eq 'none'
|
||||||
&& ( $getModeDown eq 'home'
|
&& ( $getModeDown eq 'home'
|
||||||
|| $getModeDown eq 'always' )
|
|| $getModeDown eq 'always' )
|
||||||
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
|
->getAutoShuttersControlEvening eq 'on'
|
||||||
&& $getResidentsLastStatus ne 'asleep'
|
&& $getResidentsLastStatus ne 'asleep'
|
||||||
&& $getResidentsLastStatus ne 'awoken'
|
&& $getResidentsLastStatus ne 'awoken'
|
||||||
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
@ -1169,7 +1235,7 @@ sub EventProcessingResidents {
|
|||||||
->getSelfDefenseState
|
->getSelfDefenseState
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
RemoveInternalTimer(
|
::RemoveInternalTimer(
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseAbsentTimerhash )
|
->getSelfDefenseAbsentTimerhash )
|
||||||
if ( $getResidentsLastStatus eq 'absent'
|
if ( $getResidentsLastStatus eq 'absent'
|
||||||
@ -1233,6 +1299,8 @@ sub EventProcessingResidents {
|
|||||||
->getRoommatesStatus eq 'none'
|
->getRoommatesStatus eq 'none'
|
||||||
&& ( $getModeUp eq 'home'
|
&& ( $getModeUp eq 'home'
|
||||||
|| $getModeUp eq 'always' )
|
|| $getModeUp eq 'always' )
|
||||||
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
|
->getAutoShuttersControlMorning eq 'on'
|
||||||
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
&& IsAfterShuttersTimeBlocking($shuttersDev)
|
||||||
&& !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
&& !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
||||||
&& !$FHEM::Automation::ShuttersControl::shutters
|
&& !$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -1295,6 +1363,7 @@ sub EventProcessingWind {
|
|||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
|
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
|
||||||
|
my $targetPos = $FHEM::Automation::ShuttersControl::shutters->getLastPos;
|
||||||
|
|
||||||
my $reading =
|
my $reading =
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading
|
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading
|
||||||
@ -1346,29 +1415,38 @@ sub EventProcessingWind {
|
|||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
'wind un-protected');
|
'wind un-protected');
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
|
||||||
(
|
if ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
&& !$FHEM::Automation::ShuttersControl::shutters
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
->getIfInShading
|
||||||
->getLastPos
|
&& $FHEM::Automation::ShuttersControl::shutters->getLastPos
|
||||||
: (
|
== $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShadingPos )
|
||||||
|
{
|
||||||
|
$targetPos =
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getOpenPos;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$targetPos =
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getLastPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay ) {
|
||||||
|
$targetPos = (
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getPrivacyDownStatus == 2
|
->getPrivacyDownStatus == 2
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
? $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getPrivacyDownPos
|
->getPrivacyDownPos
|
||||||
: (
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
|
||||||
->getSleepPos > 0
|
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
|
||||||
->getSleepPos
|
|
||||||
: $FHEM::Automation::ShuttersControl::shutters
|
: $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getClosedPos
|
->getClosedPos
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->setWindProtectionStatus('unprotected');
|
->setWindProtectionStatus('unprotected');
|
||||||
|
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
||||||
|
$targetPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
@ -1422,8 +1500,8 @@ sub EventProcessingBrightness {
|
|||||||
(
|
(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly
|
->getTimeUpEarly
|
||||||
@ -1444,8 +1522,8 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -1458,8 +1536,8 @@ sub EventProcessingBrightness {
|
|||||||
->getTimeUpWeHoliday ne '01:25'
|
->getTimeUpWeHoliday ne '01:25'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpLate
|
->getTimeUpLate
|
||||||
@ -1468,8 +1546,8 @@ sub EventProcessingBrightness {
|
|||||||
|
|
||||||
|| (
|
|| (
|
||||||
(
|
(
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly
|
->getTimeUpEarly
|
||||||
@ -1490,8 +1568,8 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -1504,8 +1582,8 @@ sub EventProcessingBrightness {
|
|||||||
->getTimeUpWeHoliday ne '01:25'
|
->getTimeUpWeHoliday ne '01:25'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) != int(
|
&& int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpLate
|
->getTimeUpLate
|
||||||
@ -1514,15 +1592,15 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
&& (
|
&& (
|
||||||
(
|
(
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownEarly
|
->getTimeDownEarly
|
||||||
) / 86400
|
) / 86400
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownLate
|
->getTimeDownLate
|
||||||
@ -1530,15 +1608,15 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownEarly
|
->getTimeDownEarly
|
||||||
) / 86400
|
) / 86400
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) != int(
|
&& int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownLate
|
->getTimeDownLate
|
||||||
@ -1611,8 +1689,8 @@ sub EventProcessingBrightness {
|
|||||||
(
|
(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly
|
->getTimeUpEarly
|
||||||
@ -1632,8 +1710,8 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -1646,8 +1724,8 @@ sub EventProcessingBrightness {
|
|||||||
->getTimeUpWeHoliday ne '01:25'
|
->getTimeUpWeHoliday ne '01:25'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpLate
|
->getTimeUpLate
|
||||||
@ -1677,7 +1755,7 @@ sub EventProcessingBrightness {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($shuttersDev) - EventProcessingBrightness: Steuerung für Morgens"
|
"AutoShuttersControl ($shuttersDev) - EventProcessingBrightness: Steuerung für Morgens"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1758,7 +1836,8 @@ sub EventProcessingBrightness {
|
|||||||
. $FHEM::Automation::ShuttersControl::shutters
|
. $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastDrive );
|
->getLastDrive );
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer( $hash, $shuttersDev );
|
FHEM::Automation::ShuttersControl::CreateSunRiseSetShuttersTimer(
|
||||||
|
$hash, $shuttersDev );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -1801,13 +1880,15 @@ sub EventProcessingBrightness {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime( '24:00',
|
::computeAlignTime(
|
||||||
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownEarly ) / 86400
|
->getTimeDownEarly
|
||||||
|
) / 86400
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownLate
|
->getTimeDownLate
|
||||||
@ -1827,7 +1908,7 @@ sub EventProcessingBrightness {
|
|||||||
->getAutoShuttersControlEvening eq 'on'
|
->getAutoShuttersControlEvening eq 'on'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($shuttersDev) - EventProcessingBrightness: Steuerung für Abends"
|
"AutoShuttersControl ($shuttersDev) - EventProcessingBrightness: Steuerung für Abends"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1935,10 +2016,8 @@ sub EventProcessingBrightness {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
$lastDrive);
|
$lastDrive);
|
||||||
|
|
||||||
if (
|
if ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
->getPrivacyDownStatus != 2 )
|
||||||
->getPrivacyDownStatus != 2
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setSunrise(0);
|
$FHEM::Automation::ShuttersControl::shutters->setSunrise(0);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setSunset(1);
|
$FHEM::Automation::ShuttersControl::shutters->setSunset(1);
|
||||||
@ -2008,7 +2087,7 @@ sub EventProcessingShadingBrightness {
|
|||||||
: $FHEM::Automation::ShuttersControl::ascDev->getOutTemp
|
: $FHEM::Automation::ShuttersControl::ascDev->getOutTemp
|
||||||
);
|
);
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($shuttersDev) - EventProcessingShadingBrightness"
|
"AutoShuttersControl ($shuttersDev) - EventProcessingShadingBrightness"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -2019,7 +2098,7 @@ sub EventProcessingShadingBrightness {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( $events =~ m{$reading:\s(\d+(\.\d+)?)}xms ) {
|
if ( $events =~ m{$reading:\s(\d+(\.\d+)?)}xms ) {
|
||||||
Log3(
|
::Log3(
|
||||||
$name, 4,
|
$name, 4,
|
||||||
"AutoShuttersControl ($shuttersDev) - EventProcessingShadingBrightness
|
"AutoShuttersControl ($shuttersDev) - EventProcessingShadingBrightness
|
||||||
Brightness: " . $1
|
Brightness: " . $1
|
||||||
@ -2186,18 +2265,18 @@ sub EventProcessingPartyMode {
|
|||||||
&& $FHEM::Automation::ShuttersControl::shutters->getSubTyp eq
|
&& $FHEM::Automation::ShuttersControl::shutters->getSubTyp eq
|
||||||
'threestate' )
|
'threestate' )
|
||||||
{
|
{
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingPartyMode Fenster offen"
|
"AutoShuttersControl ($name) - EventProcessingPartyMode Fenster offen"
|
||||||
);
|
);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setDelayCmd(
|
$FHEM::Automation::ShuttersControl::shutters->setDelayCmd(
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
);
|
);
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingPartyMode - Spring in ShuttersCommandDelaySet"
|
"AutoShuttersControl ($name) - EventProcessingPartyMode - Spring in ShuttersCommandDelaySet"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - EventProcessingPartyMode Fenster nicht offen"
|
"AutoShuttersControl ($name) - EventProcessingPartyMode Fenster nicht offen"
|
||||||
);
|
);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
@ -2207,12 +2286,14 @@ sub EventProcessingPartyMode {
|
|||||||
$shuttersDev,
|
$shuttersDev,
|
||||||
(
|
(
|
||||||
CheckIfShuttersWindowRecOpen($shuttersDev) == 0
|
CheckIfShuttersWindowRecOpen($shuttersDev) == 0
|
||||||
? ($FHEM::Automation::ShuttersControl::shutters
|
? (
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSleepPos > 0
|
->getSleepPos > 0
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
? $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSleepPos
|
->getSleepPos
|
||||||
: $FHEM::Automation::ShuttersControl::shutters
|
: $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getClosedPos)
|
->getClosedPos
|
||||||
|
)
|
||||||
: $FHEM::Automation::ShuttersControl::shutters
|
: $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getVentilatePos
|
->getVentilatePos
|
||||||
)
|
)
|
||||||
@ -2286,8 +2367,8 @@ sub EventProcessingShutters {
|
|||||||
'EventProcessingShutters: '
|
'EventProcessingShutters: '
|
||||||
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
. ' - Event vom Rollo erkannt. Es wird nun eine etwaige manuelle Fahrt ausgewertet.'
|
. ' - Event vom Rollo erkannt. Es wird nun eine etwaige manuelle Fahrt ausgewertet.'
|
||||||
. ' Int von gettimeofday: '
|
. ' Int von ::gettimeofday: '
|
||||||
. int( gettimeofday() )
|
. int( ::gettimeofday() )
|
||||||
. ' Last Position Timestamp: '
|
. ' Last Position Timestamp: '
|
||||||
. $FHEM::Automation::ShuttersControl::shutters
|
. $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastPosTimestamp
|
->getLastPosTimestamp
|
||||||
@ -2301,13 +2382,13 @@ sub EventProcessingShutters {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastPosTimestamp
|
->getLastPosTimestamp
|
||||||
) >
|
) >
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getDriveUpMaxDuration
|
$FHEM::Automation::ShuttersControl::shutters->getDriveUpMaxDuration
|
||||||
&& (
|
&& (
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getLastManPosTimestamp ) >
|
->getLastManPosTimestamp ) >
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getDriveUpMaxDuration
|
$FHEM::Automation::ShuttersControl::shutters->getDriveUpMaxDuration
|
||||||
@ -2332,6 +2413,22 @@ sub EventProcessingShutters {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDriveReading;
|
$FHEM::Automation::ShuttersControl::shutters->setLastDriveReading;
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->setStateReading;
|
$FHEM::Automation::ShuttersControl::ascDev->setStateReading;
|
||||||
|
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->setHardLockOut('on')
|
||||||
|
if (
|
||||||
|
(
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getComfortOpenPos
|
||||||
|
|| ( $FHEM::Automation::ShuttersControl::shutters->getStatus
|
||||||
|
== $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getOpenPos
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getLastDrive eq 'ventilate - window open' )
|
||||||
|
)
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShuttersPlace eq 'terrace'
|
||||||
|
);
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
'EventProcessingShutters: eine automatisierte Fahrt durch ASC wurde erkannt! Es werden nun die LastDriveReading und StateReading Werte gesetzt!'
|
'EventProcessingShutters: eine automatisierte Fahrt durch ASC wurde erkannt! Es werden nun die LastDriveReading und StateReading Werte gesetzt!'
|
||||||
);
|
);
|
||||||
@ -2426,7 +2523,7 @@ sub EventProcessingExternalTriggerDevice {
|
|||||||
'external trigger device inactive');
|
'external trigger device inactive');
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(1);
|
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(1);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setExternalTriggerStatus(
|
$FHEM::Automation::ShuttersControl::shutters->setExternalTriggerStatus(
|
||||||
1);
|
0);
|
||||||
FHEM::Automation::ShuttersControl::ShuttersCommandSet(
|
FHEM::Automation::ShuttersControl::ShuttersCommandSet(
|
||||||
$hash,
|
$hash,
|
||||||
$shuttersDev,
|
$shuttersDev,
|
||||||
@ -2444,7 +2541,4 @@ sub EventProcessingExternalTriggerDevice {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (fhemsupport@cooltux.net)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -46,7 +46,9 @@ use POSIX qw(strftime);
|
|||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
require Exporter;
|
require Exporter;
|
||||||
our @ISA = qw(Exporter);
|
use base qw(Exporter);
|
||||||
|
|
||||||
|
# our @ISA = qw(Exporter);
|
||||||
our @EXPORT_OK = qw(
|
our @EXPORT_OK = qw(
|
||||||
PositionValueWindowRec
|
PositionValueWindowRec
|
||||||
AutoSearchTwilightDev
|
AutoSearchTwilightDev
|
||||||
@ -89,21 +91,7 @@ our %EXPORT_TAGS = (
|
|||||||
use GPUtils qw(GP_Import);
|
use GPUtils qw(GP_Import);
|
||||||
## Import der FHEM Funktionen
|
## Import der FHEM Funktionen
|
||||||
BEGIN {
|
BEGIN {
|
||||||
GP_Import(
|
GP_Import(qw(cmdFromAnalyze));
|
||||||
qw(
|
|
||||||
devspec2array
|
|
||||||
CommandAttr
|
|
||||||
AttrVal
|
|
||||||
Log3
|
|
||||||
computeAlignTime
|
|
||||||
gettimeofday
|
|
||||||
sunset
|
|
||||||
sunset_abs
|
|
||||||
sunrise
|
|
||||||
sunrise_abs
|
|
||||||
cmdFromAnalyze
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub PositionValueWindowRec {
|
sub PositionValueWindowRec {
|
||||||
@ -156,12 +144,12 @@ sub AutoSearchTwilightDev {
|
|||||||
|
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
if ( devspec2array('TYPE=(Astro|Twilight)') > 0 ) {
|
if ( ::devspec2array('TYPE=(Astro|Twilight)') > 0 ) {
|
||||||
CommandAttr( undef,
|
::CommandAttr( undef,
|
||||||
$name
|
$name
|
||||||
. ' ASC_twilightDevice '
|
. ' ASC_twilightDevice '
|
||||||
. ( devspec2array('TYPE=(Astro|Twilight)') )[0] )
|
. ( ::devspec2array('TYPE=(Astro|Twilight)') )[0] )
|
||||||
if ( AttrVal( $name, 'ASC_twilightDevice', 'none' ) eq 'none' );
|
if ( ::AttrVal( $name, 'ASC_twilightDevice', 'none' ) eq 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -172,8 +160,10 @@ sub GetAttrValues {
|
|||||||
my $attribut = shift;
|
my $attribut = shift;
|
||||||
my $default = shift;
|
my $default = shift;
|
||||||
|
|
||||||
my @values = split( ' ',
|
my @values = split(
|
||||||
AttrVal( $dev, $attribut, ( defined($default) ? $default : 'none' ) ) );
|
' ',
|
||||||
|
::AttrVal( $dev, $attribut, ( defined($default) ? $default : 'none' ) )
|
||||||
|
);
|
||||||
my ( $value1, $value2 ) = split( ':', $values[0] );
|
my ( $value1, $value2 ) = split( ':', $values[0] );
|
||||||
|
|
||||||
my ( $value3, $value4, $value5, $value6, $value7, $value8 );
|
my ( $value3, $value4, $value5, $value6, $value7, $value8 );
|
||||||
@ -227,10 +217,10 @@ sub ExtractNotifyDevFromEvent {
|
|||||||
|
|
||||||
my %notifyDevs;
|
my %notifyDevs;
|
||||||
while ( my $notifyDev = each %{ $hash->{monitoredDevs} } ) {
|
while ( my $notifyDev = each %{ $hash->{monitoredDevs} } ) {
|
||||||
Log3( $hash->{NAME}, 4,
|
::Log3( $hash->{NAME}, 4,
|
||||||
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - NotifyDev: "
|
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - NotifyDev: "
|
||||||
. $notifyDev );
|
. $notifyDev );
|
||||||
Log3( $hash->{NAME}, 5,
|
::Log3( $hash->{NAME}, 5,
|
||||||
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDev: "
|
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDev: "
|
||||||
. $shuttersDev );
|
. $shuttersDev );
|
||||||
|
|
||||||
@ -238,10 +228,10 @@ sub ExtractNotifyDevFromEvent {
|
|||||||
&& $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} eq
|
&& $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} eq
|
||||||
$shuttersAttr )
|
$shuttersAttr )
|
||||||
{
|
{
|
||||||
Log3( $hash->{NAME}, 4,
|
::Log3( $hash->{NAME}, 4,
|
||||||
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDevHash: "
|
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDevHash: "
|
||||||
. $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} );
|
. $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} );
|
||||||
Log3( $hash->{NAME}, 5,
|
::Log3( $hash->{NAME}, 5,
|
||||||
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - return ShuttersDev: "
|
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - return ShuttersDev: "
|
||||||
. $notifyDev );
|
. $notifyDev );
|
||||||
$notifyDevs{$notifyDev} = $shuttersDev;
|
$notifyDevs{$notifyDev} = $shuttersDev;
|
||||||
@ -279,24 +269,27 @@ sub _IsDay {
|
|||||||
(
|
(
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime( '24:00',
|
::computeAlignTime(
|
||||||
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly ) / 86400
|
->getTimeUpEarly
|
||||||
|
) / 86400
|
||||||
)
|
)
|
||||||
&& ( !IsWe()
|
&& (
|
||||||
|| ( IsWe()
|
!IsWe()
|
||||||
|
|| (
|
||||||
|
IsWe()
|
||||||
&& ( $FHEM::Automation::ShuttersControl::ascDev
|
&& ( $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getSunriseTimeWeHoliday eq 'off'
|
->getSunriseTimeWeHoliday eq 'off'
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday eq '01:25'
|
->getTimeUpWeHoliday eq '01:25' )
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -309,23 +302,23 @@ sub _IsDay {
|
|||||||
->getTimeUpWeHoliday ne '01:25'
|
->getTimeUpWeHoliday ne '01:25'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate
|
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate
|
||||||
) / 86400
|
) / 86400
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownEarly
|
->getTimeDownEarly
|
||||||
) / 86400
|
) / 86400
|
||||||
)
|
)
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeDownLate
|
->getTimeDownLate
|
||||||
@ -390,17 +383,24 @@ sub _IsDay {
|
|||||||
. $FHEM::Automation::ShuttersControl::shutters->getSunrise );
|
. $FHEM::Automation::ShuttersControl::shutters->getSunrise );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$respIsDay = 1
|
$respIsDay = 1
|
||||||
if (
|
if (
|
||||||
( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'roommate'
|
(
|
||||||
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'asleep'
|
$FHEM::Automation::ShuttersControl::shutters->getDown eq 'roommate'
|
||||||
or $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'gotosleep' )
|
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne
|
||||||
|
'asleep'
|
||||||
|
or $FHEM::Automation::ShuttersControl::shutters->getRoommates
|
||||||
|
ne 'gotosleep' )
|
||||||
)
|
)
|
||||||
or ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'roommate'
|
or (
|
||||||
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'asleep'
|
$FHEM::Automation::ShuttersControl::shutters->getUp eq 'roommate'
|
||||||
or $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'gotosleep' )
|
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne
|
||||||
|
'asleep'
|
||||||
|
or $FHEM::Automation::ShuttersControl::shutters->getRoommates
|
||||||
|
ne 'gotosleep' )
|
||||||
)
|
)
|
||||||
|
or ( $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq
|
||||||
|
'awning' )
|
||||||
);
|
);
|
||||||
|
|
||||||
return $respIsDay;
|
return $respIsDay;
|
||||||
@ -436,7 +436,7 @@ sub ShuttersSunrise {
|
|||||||
my $oldFuncHash =
|
my $oldFuncHash =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
|
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
|
||||||
my $shuttersSunriseUnixtime =
|
my $shuttersSunriseUnixtime =
|
||||||
computeAlignTime( '24:00', sunrise( 'REAL', 0, '4:30', '8:30' ) );
|
::computeAlignTime( '24:00', ::sunrise( 'REAL', 0, '4:30', '8:30' ) );
|
||||||
|
|
||||||
if ( $tm eq 'unix' ) {
|
if ( $tm eq 'unix' ) {
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'astro' ) {
|
if ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'astro' ) {
|
||||||
@ -449,11 +449,11 @@ sub ShuttersSunrise {
|
|||||||
if ( !IsWe('tomorrow') ) {
|
if ( !IsWe('tomorrow') ) {
|
||||||
if (
|
if (
|
||||||
IsWe()
|
IsWe()
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -465,9 +465,9 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -477,11 +477,11 @@ sub ShuttersSunrise {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -495,9 +495,9 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -508,9 +508,9 @@ sub ShuttersSunrise {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -526,11 +526,11 @@ sub ShuttersSunrise {
|
|||||||
if (
|
if (
|
||||||
IsWe()
|
IsWe()
|
||||||
&& (
|
&& (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -539,11 +539,11 @@ sub ShuttersSunrise {
|
|||||||
) + 1
|
) + 1
|
||||||
) / 86400
|
) / 86400
|
||||||
)
|
)
|
||||||
|| int( gettimeofday() / 86400 ) != int(
|
|| int( ::gettimeofday() / 86400 ) != int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -556,9 +556,9 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -568,11 +568,11 @@ sub ShuttersSunrise {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -586,9 +586,9 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -601,11 +601,11 @@ sub ShuttersSunrise {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (
|
if (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -617,9 +617,9 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -630,9 +630,9 @@ sub ShuttersSunrise {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -646,9 +646,9 @@ sub ShuttersSunrise {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = (
|
$shuttersSunriseUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -669,11 +669,11 @@ sub ShuttersSunrise {
|
|||||||
{
|
{
|
||||||
if ( !IsWe('tomorrow') ) {
|
if ( !IsWe('tomorrow') ) {
|
||||||
if (
|
if (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
(
|
(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunrise_abs(
|
::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -690,7 +690,7 @@ sub ShuttersSunrise {
|
|||||||
( $shuttersSunriseUnixtime + 86400 )
|
( $shuttersSunriseUnixtime + 86400 )
|
||||||
if ( $shuttersSunriseUnixtime <
|
if ( $shuttersSunriseUnixtime <
|
||||||
( $oldFuncHash->{sunrisetime} + 180 )
|
( $oldFuncHash->{sunrisetime} + 180 )
|
||||||
&& $oldFuncHash->{sunrisetime} < gettimeofday() );
|
&& $oldFuncHash->{sunrisetime} < ::gettimeofday() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -698,7 +698,7 @@ sub ShuttersSunrise {
|
|||||||
$shuttersSunriseUnixtime = ( $shuttersSunriseUnixtime + 86400 )
|
$shuttersSunriseUnixtime = ( $shuttersSunriseUnixtime + 86400 )
|
||||||
if ( $shuttersSunriseUnixtime <
|
if ( $shuttersSunriseUnixtime <
|
||||||
( $oldFuncHash->{sunrisetime} + 180 )
|
( $oldFuncHash->{sunrisetime} + 180 )
|
||||||
&& $oldFuncHash->{sunrisetime} < gettimeofday() );
|
&& $oldFuncHash->{sunrisetime} < ::gettimeofday() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'time' )
|
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'time' )
|
||||||
@ -711,8 +711,8 @@ sub ShuttersSunrise {
|
|||||||
{
|
{
|
||||||
if ( !IsWe('tomorrow') ) {
|
if ( !IsWe('tomorrow') ) {
|
||||||
if (
|
if (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -720,13 +720,13 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday );
|
->getTimeUpWeHoliday );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly
|
->getTimeUpEarly
|
||||||
@ -736,12 +736,12 @@ sub ShuttersSunrise {
|
|||||||
->getSunrise
|
->getSunrise
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly ) + 86400;
|
->getTimeUpEarly ) + 86400;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly );
|
->getTimeUpEarly );
|
||||||
}
|
}
|
||||||
@ -749,8 +749,8 @@ sub ShuttersSunrise {
|
|||||||
else {
|
else {
|
||||||
if (
|
if (
|
||||||
IsWe()
|
IsWe()
|
||||||
&& int( gettimeofday() / 86400 ) == int(
|
&& int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -758,13 +758,13 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday );
|
->getTimeUpWeHoliday );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) == int(
|
int( ::gettimeofday() / 86400 ) == int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly
|
->getTimeUpEarly
|
||||||
@ -772,13 +772,13 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly );
|
->getTimeUpEarly );
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
int( gettimeofday() / 86400 ) != int(
|
int( ::gettimeofday() / 86400 ) != int(
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday
|
->getTimeUpWeHoliday
|
||||||
@ -786,19 +786,19 @@ sub ShuttersSunrise {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday );
|
->getTimeUpWeHoliday );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpWeHoliday ) + 86400;
|
->getTimeUpWeHoliday ) + 86400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getTimeUpEarly );
|
->getTimeUpEarly );
|
||||||
}
|
}
|
||||||
@ -806,15 +806,14 @@ sub ShuttersSunrise {
|
|||||||
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq
|
||||||
'brightness' )
|
'brightness' )
|
||||||
{
|
{
|
||||||
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
|
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate
|
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate );
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $shuttersSunriseUnixtime;
|
return $shuttersSunriseUnixtime;
|
||||||
}
|
}
|
||||||
elsif ( $tm eq 'real' ) {
|
elsif ( $tm eq 'real' ) {
|
||||||
return sunrise_abs(
|
return ::sunrise_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeUpEarly,
|
$FHEM::Automation::ShuttersControl::shutters->getTimeUpEarly,
|
||||||
@ -858,15 +857,15 @@ sub ShuttersSunset {
|
|||||||
my $oldFuncHash =
|
my $oldFuncHash =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
|
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
|
||||||
my $shuttersSunsetUnixtime =
|
my $shuttersSunsetUnixtime =
|
||||||
computeAlignTime( '24:00', sunset( 'REAL', 0, '15:30', '21:30' ) );
|
::computeAlignTime( '24:00', ::sunset( 'REAL', 0, '15:30', '21:30' ) );
|
||||||
|
|
||||||
if ( $tm eq 'unix' ) {
|
if ( $tm eq 'unix' ) {
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'astro' )
|
if ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'astro' )
|
||||||
{
|
{
|
||||||
$shuttersSunsetUnixtime = (
|
$shuttersSunsetUnixtime = (
|
||||||
computeAlignTime(
|
::computeAlignTime(
|
||||||
'24:00',
|
'24:00',
|
||||||
sunset_abs(
|
::sunset_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -880,13 +879,13 @@ sub ShuttersSunset {
|
|||||||
$shuttersSunsetUnixtime += 86400
|
$shuttersSunsetUnixtime += 86400
|
||||||
if ( $shuttersSunsetUnixtime <
|
if ( $shuttersSunsetUnixtime <
|
||||||
( $oldFuncHash->{sunsettime} + 180 )
|
( $oldFuncHash->{sunsettime} + 180 )
|
||||||
&& $oldFuncHash->{sunsettime} < gettimeofday() );
|
&& $oldFuncHash->{sunsettime} < ::gettimeofday() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getDown eq 'time' )
|
$FHEM::Automation::ShuttersControl::shutters->getDown eq 'time' )
|
||||||
{
|
{
|
||||||
$shuttersSunsetUnixtime = computeAlignTime( '24:00',
|
$shuttersSunsetUnixtime = ::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly
|
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -894,13 +893,13 @@ sub ShuttersSunset {
|
|||||||
'brightness' )
|
'brightness' )
|
||||||
{
|
{
|
||||||
$shuttersSunsetUnixtime =
|
$shuttersSunsetUnixtime =
|
||||||
computeAlignTime( '24:00',
|
::computeAlignTime( '24:00',
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeDownLate );
|
$FHEM::Automation::ShuttersControl::shutters->getTimeDownLate );
|
||||||
}
|
}
|
||||||
return $shuttersSunsetUnixtime;
|
return $shuttersSunsetUnixtime;
|
||||||
}
|
}
|
||||||
elsif ( $tm eq 'real' ) {
|
elsif ( $tm eq 'real' ) {
|
||||||
return sunset_abs(
|
return ::sunset_abs(
|
||||||
$autoAstroMode,
|
$autoAstroMode,
|
||||||
0,
|
0,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly,
|
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly,
|
||||||
@ -923,7 +922,7 @@ sub IsAfterShuttersTimeBlocking {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
|
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
|
||||||
) <
|
) <
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
|
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
|
||||||
@ -933,7 +932,7 @@ sub IsAfterShuttersTimeBlocking {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
||||||
)
|
)
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
&& $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
||||||
- ( int( gettimeofday() ) ) <
|
- ( int( ::gettimeofday() ) ) <
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getBlockingTimeBeforDayOpen
|
->getBlockingTimeBeforDayOpen
|
||||||
)
|
)
|
||||||
@ -943,7 +942,7 @@ sub IsAfterShuttersTimeBlocking {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
||||||
)
|
)
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getSunsetUnixTime
|
&& $FHEM::Automation::ShuttersControl::shutters->getSunsetUnixTime
|
||||||
- ( int( gettimeofday() ) ) <
|
- ( int( ::gettimeofday() ) ) <
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getBlockingTimeBeforNightClose
|
->getBlockingTimeBeforNightClose
|
||||||
)
|
)
|
||||||
@ -982,7 +981,7 @@ sub IsAfterShuttersManualBlocking {
|
|||||||
}
|
}
|
||||||
elsif (
|
elsif (
|
||||||
(
|
(
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
|
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
|
||||||
) <
|
) <
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
|
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
|
||||||
@ -994,25 +993,6 @@ sub IsAfterShuttersManualBlocking {
|
|||||||
else { return 1 }
|
else { return 1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
sub makeReadingName {
|
|
||||||
my ($rname) = shift;
|
|
||||||
my %charHash = (
|
|
||||||
chr(0xe4) => "ae", # ä
|
|
||||||
chr(0xc4) => "Ae", # Ä
|
|
||||||
chr(0xfc) => "ue", # ü
|
|
||||||
chr(0xdc) => "Ue", # Ü
|
|
||||||
chr(0xf6) => "oe", # ö
|
|
||||||
chr(0xd6) => "Oe", # Ö
|
|
||||||
chr(0xdf) => "ss" # ß
|
|
||||||
);
|
|
||||||
my $charHashkeys = join( "", keys(%charHash) );
|
|
||||||
|
|
||||||
return $rname if ( $rname =~ m{^\./}xms );
|
|
||||||
$rname =~ s/([$charHashkeys])/$charHash{$1}/xgi;
|
|
||||||
$rname =~ s/[^a-z0-9._\-\/]/_/xgi;
|
|
||||||
return $rname;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub IsWe {
|
sub IsWe {
|
||||||
return main::IsWe( shift, shift );
|
return main::IsWe( shift, shift );
|
||||||
}
|
}
|
||||||
@ -1038,23 +1018,31 @@ sub PerlCodeCheck {
|
|||||||
sub IsAdv {
|
sub IsAdv {
|
||||||
use HTTP::Date;
|
use HTTP::Date;
|
||||||
my ( undef, undef, undef, $monthday, $month, $year, undef, undef, undef ) =
|
my ( undef, undef, undef, $monthday, $month, $year, undef, undef, undef ) =
|
||||||
localtime( gettimeofday() );
|
localtime( ::gettimeofday() );
|
||||||
my $adv = 0;
|
my $adv = 0;
|
||||||
$year += 1900;
|
$year += 1900;
|
||||||
|
|
||||||
if ( $month < 1 ) {
|
if ( $month < 1
|
||||||
if ( $monthday < 7 ) {
|
&& $FHEM::Automation::ShuttersControl::ascDev->getAdvEndDate eq
|
||||||
$adv = 1;
|
'EpiphanyDay' )
|
||||||
|
{
|
||||||
|
$adv = $monthday < 7 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
elsif ($month < 2
|
||||||
|
&& $FHEM::Automation::ShuttersControl::ascDev->getAdvEndDate eq
|
||||||
|
'CandlemasDay' )
|
||||||
|
{
|
||||||
|
$adv = $month = 1 || ( $month = 2 && $monthday < 3 ) ? 1 : 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my $time = str2time( $year . '-12-25' );
|
my $time = str2time( $year . '-12-25' );
|
||||||
my $wday = ( localtime($time) )[6];
|
my $wday = ( localtime($time) )[6];
|
||||||
$wday = $wday ? $wday : 7;
|
$wday = $wday ? $wday : 7;
|
||||||
$time -= ( $FHEM::Automation::ShuttersControl::ascDev
|
$time -= (
|
||||||
->getAdvDate eq 'DeadSunday'
|
$FHEM::Automation::ShuttersControl::ascDev->getAdvStartDate eq
|
||||||
? ($wday + 27) * 86400
|
'DeadSunday'
|
||||||
: ($wday + 21) * 86400
|
? ( $wday + 27 ) * 86400
|
||||||
|
: ( $wday + 21 ) * 86400
|
||||||
);
|
);
|
||||||
$adv = 1 if ( $time < time );
|
$adv = 1 if ( $time < time );
|
||||||
}
|
}
|
||||||
@ -1066,14 +1054,15 @@ sub IsInTime {
|
|||||||
my $dfi = shift;
|
my $dfi = shift;
|
||||||
|
|
||||||
$dfi =~ s/{([^\x7d]*)}/$cmdFromAnalyze=$1; eval $1/ge; # Forum #69787
|
$dfi =~ s/{([^\x7d]*)}/$cmdFromAnalyze=$1; eval $1/ge; # Forum #69787
|
||||||
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime(gettimeofday());
|
my ( $sec, $min, $hour, $mday, $month, $year, $wday, $yday, $isdst ) =
|
||||||
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
|
localtime( ::gettimeofday() );
|
||||||
foreach my $ft (split(" ", $dfi)) {
|
my $dhms = sprintf( "%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec );
|
||||||
my ($from, $to) = split("-", $ft);
|
foreach my $ft ( split( " ", $dfi ) ) {
|
||||||
if(defined($from) && defined($to)) {
|
my ( $from, $to ) = split( "-", $ft );
|
||||||
$from = "$wday\@$from" if(index($from,"@") < 0);
|
if ( defined($from) && defined($to) ) {
|
||||||
$to = "$wday\@$to" if(index($to, "@") < 0);
|
$from = "$wday\@$from" if ( index( $from, "@" ) < 0 );
|
||||||
return 1 if($from le $dhms && $dhms le $to);
|
$to = "$wday\@$to" if ( index( $to, "@" ) < 0 );
|
||||||
|
return 1 if ( $from le $dhms && $dhms le $to );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2021 Copyright: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -47,7 +47,9 @@ use utf8;
|
|||||||
use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
|
use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
|
||||||
|
|
||||||
require Exporter;
|
require Exporter;
|
||||||
our @ISA = qw(Exporter);
|
use base qw(Exporter);
|
||||||
|
|
||||||
|
# our @ISA = qw(Exporter);
|
||||||
our @EXPORT_OK = qw(
|
our @EXPORT_OK = qw(
|
||||||
RainProcessing
|
RainProcessing
|
||||||
);
|
);
|
||||||
@ -59,7 +61,6 @@ our %EXPORT_TAGS = (
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
sub RainProcessing {
|
sub RainProcessing {
|
||||||
my ( $hash, $val, $triggerMax, $triggerMin ) = @_;
|
my ( $hash, $val, $triggerMax, $triggerMin ) = @_;
|
||||||
|
|
||||||
@ -75,7 +76,8 @@ sub RainProcessing {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getRainProtection eq
|
$FHEM::Automation::ShuttersControl::shutters->getRainProtection eq
|
||||||
'off' );
|
'off' );
|
||||||
|
|
||||||
if ( $val > $triggerMax
|
if (
|
||||||
|
$val > $triggerMax
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
|
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
|
||||||
$rainClosedPos
|
$rainClosedPos
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -83,7 +85,7 @@ sub RainProcessing {
|
|||||||
|| ( $FHEM::Automation::ShuttersControl::shutters
|
|| ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getRainProtectionStatus eq 'unprotected'
|
->getRainProtectionStatus eq 'unprotected'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getRainUnprotectionDelayObj ne 'none')
|
->getRainUnprotectionDelayObj ne 'none' )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_RainProtected();
|
_RainProtected();
|
||||||
@ -95,18 +97,33 @@ sub RainProcessing {
|
|||||||
&& $FHEM::Automation::ShuttersControl::shutters
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getRainProtectionStatus eq 'protected' )
|
->getRainProtectionStatus eq 'protected' )
|
||||||
{
|
{
|
||||||
my %funcHash = (
|
my %funcHash = ( shuttersdevice => $shuttersDev, );
|
||||||
shuttersdevice => $shuttersDev,
|
|
||||||
);
|
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj(\%funcHash);
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
::InternalTimer( ::gettimeofday() + $FHEM::Automation::ShuttersControl::ascDev->getRainWaitingTime
|
->setRainUnprotectionDelayObj( \%funcHash );
|
||||||
, \&_RainUnprotected
|
::InternalTimer(
|
||||||
, \%funcHash );
|
::gettimeofday() +
|
||||||
|
$FHEM::Automation::ShuttersControl::ascDev
|
||||||
|
->getRainWaitingTime,
|
||||||
|
\&_RainUnprotected, \%funcHash
|
||||||
|
);
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->setRainProtectionStatus('unprotected');
|
->setRainProtectionStatus('unprotected');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if ( $FHEM::Automation::ShuttersControl::shutters->getStatus !=
|
||||||
|
$rainClosedPos
|
||||||
|
&& ( $val == 0 || $val < $triggerMin ) )
|
||||||
|
{
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->setRainProtectionStatus('unprotected');
|
||||||
|
}
|
||||||
|
elsif ( $val > $triggerMax ) {
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->setRainProtectionStatus('protected');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -114,55 +131,76 @@ sub RainProcessing {
|
|||||||
|
|
||||||
### es muss noch beobachtet werden ob die Auswahl des Rollos welches bearbeitet werden soll bestehen bleibt oder mit in die neuen Funktionen übergeben werden muss
|
### es muss noch beobachtet werden ob die Auswahl des Rollos welches bearbeitet werden soll bestehen bleibt oder mit in die neuen Funktionen übergeben werden muss
|
||||||
sub _RainProtected {
|
sub _RainProtected {
|
||||||
::RemoveInternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj)
|
::RemoveInternalTimer( $FHEM::Automation::ShuttersControl::shutters
|
||||||
if($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj ne 'none');
|
->getRainUnprotectionDelayObj )
|
||||||
|
if ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getRainUnprotectionDelayObj ne 'none' );
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none');
|
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj(
|
||||||
|
'none');
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
'rain protected');
|
'rain protected');
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev
|
$FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getRainSensorShuttersClosedPos);
|
->getRainSensorShuttersClosedPos );
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
|
||||||
->setRainProtectionStatus('protected');
|
$FHEM::Automation::ShuttersControl::shutters->setRainProtectionStatus(
|
||||||
|
'protected');
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _RainUnprotected {
|
sub _RainUnprotected {
|
||||||
my $h = shift;
|
my $h = shift;
|
||||||
|
my $targetPos = $FHEM::Automation::ShuttersControl::shutters->getLastPos;
|
||||||
|
|
||||||
my $shuttersDev = $h->{shuttersdevice};
|
my $shuttersDev = $h->{shuttersdevice};
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev(
|
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
|
||||||
$shuttersDev);
|
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
|
||||||
'rain un-protected');
|
'rain un-protected');
|
||||||
|
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj ne 'none' ) {
|
if ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
::RemoveInternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj);
|
->getRainUnprotectionDelayObj ne 'none' )
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none');
|
{
|
||||||
|
::RemoveInternalTimer( $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getRainUnprotectionDelayObj );
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->setRainUnprotectionDelayObj('none');
|
||||||
}
|
}
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
|
if ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
(
|
&& !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
&& $FHEM::Automation::ShuttersControl::shutters->getLastPos ==
|
||||||
? $FHEM::Automation::ShuttersControl::shutters->getLastPos
|
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
|
||||||
: (
|
{
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$targetPos = $FHEM::Automation::ShuttersControl::shutters->getOpenPos;
|
||||||
->getPrivacyDownStatus == 2
|
}
|
||||||
? $FHEM::Automation::ShuttersControl::shutters
|
else {
|
||||||
->getPrivacyDownPos
|
$targetPos = $FHEM::Automation::ShuttersControl::shutters->getLastPos;
|
||||||
: $FHEM::Automation::ShuttersControl::shutters
|
}
|
||||||
->getClosedPos
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
if ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
->setRainProtectionStatus('unprotected');
|
&& $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace ne
|
||||||
|
'awning' )
|
||||||
|
{
|
||||||
|
$targetPos = (
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getPrivacyDownStatus
|
||||||
|
== 2
|
||||||
|
? $FHEM::Automation::ShuttersControl::shutters->getPrivacyDownPos
|
||||||
|
: $FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->setRainProtectionStatus(
|
||||||
|
'unprotected');
|
||||||
|
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd($targetPos)
|
||||||
|
if ( IsAfterShuttersTimeBlocking($shuttersDev) );
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -44,37 +44,41 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
require Exporter;
|
||||||
|
use base qw(Exporter);
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
# our @ISA = qw(Exporter);
|
||||||
BEGIN {
|
our @EXPORT_OK = qw(
|
||||||
GP_Import(
|
getRoommateStatus
|
||||||
|
getRoommateLastStatus
|
||||||
|
);
|
||||||
|
our %EXPORT_TAGS = (
|
||||||
|
ALL => [
|
||||||
qw(
|
qw(
|
||||||
ReadingsVal)
|
getRoommateStatus
|
||||||
);
|
getRoommateLastStatus
|
||||||
}
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
sub _getRoommateStatus {
|
sub getRoommateStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $roommate = $self->{roommate};
|
my $roommate = $self->{roommate};
|
||||||
|
|
||||||
return ReadingsVal( $roommate,
|
return ::ReadingsVal( $roommate,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading,
|
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading,
|
||||||
'none' );
|
'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _getRoommateLastStatus {
|
sub getRoommateLastStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $roommate = $self->{roommate};
|
my $roommate = $self->{roommate};
|
||||||
my $default = $self->{defaultarg};
|
my $default = $self->{defaultarg};
|
||||||
|
|
||||||
$default = 'none' if ( !defined($default) );
|
$default = 'none' if ( !defined($default) );
|
||||||
return ReadingsVal( $roommate, 'lastState', $default );
|
return ::ReadingsVal( $roommate, 'lastState', $default );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (fhemsupport@cooltux.net)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -48,7 +48,9 @@ use utf8;
|
|||||||
use FHEM::Automation::ShuttersControl::Helper qw (IsInTime);
|
use FHEM::Automation::ShuttersControl::Helper qw (IsInTime);
|
||||||
|
|
||||||
require Exporter;
|
require Exporter;
|
||||||
our @ISA = qw(Exporter);
|
use base qw(Exporter);
|
||||||
|
|
||||||
|
# our @ISA = qw(Exporter);
|
||||||
our @EXPORT_OK = qw(
|
our @EXPORT_OK = qw(
|
||||||
CheckASC_ConditionsForShadingFn
|
CheckASC_ConditionsForShadingFn
|
||||||
ShadingProcessing
|
ShadingProcessing
|
||||||
@ -64,24 +66,6 @@ our %EXPORT_TAGS = (
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
Log3
|
|
||||||
gettimeofday
|
|
||||||
InternalTimer
|
|
||||||
ReadingsVal
|
|
||||||
readingsBeginUpdate
|
|
||||||
readingsBulkUpdate
|
|
||||||
readingsBulkUpdateIfChanged
|
|
||||||
readingsEndUpdate
|
|
||||||
defs
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub CheckASC_ConditionsForShadingFn {
|
sub CheckASC_ConditionsForShadingFn {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
my $value = shift;
|
my $value = shift;
|
||||||
@ -104,8 +88,8 @@ sub CheckASC_ConditionsForShadingFn {
|
|||||||
attrEvent => 0,
|
attrEvent => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
InternalTimer(
|
::InternalTimer(
|
||||||
gettimeofday() + $count,
|
::gettimeofday() + $count,
|
||||||
'FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn',
|
'FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn',
|
||||||
\%funcHash
|
\%funcHash
|
||||||
);
|
);
|
||||||
@ -128,7 +112,7 @@ sub _CheckShuttersConditionsForShadingFn {
|
|||||||
my $value = $funcHash->{value};
|
my $value = $funcHash->{value};
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
|
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
|
||||||
my $shuttersDevHash = $defs{$shuttersDev};
|
my $shuttersDevHash = $::defs{$shuttersDev};
|
||||||
my $message = '';
|
my $message = '';
|
||||||
my $errorMessage;
|
my $errorMessage;
|
||||||
my $warnMessage;
|
my $warnMessage;
|
||||||
@ -136,22 +120,26 @@ sub _CheckShuttersConditionsForShadingFn {
|
|||||||
|
|
||||||
if ( $value eq 'off' ) {
|
if ( $value eq 'off' ) {
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShadingStatus('out');
|
$FHEM::Automation::ShuttersControl::shutters->setShadingStatus('out');
|
||||||
$infoMessage .= ' shading was deactivated ' . ($funcHash->{attrEvent} ? 'in the device' : 'globally');
|
$infoMessage .= ' shading was deactivated '
|
||||||
|
. ( $funcHash->{attrEvent} ? 'in the device' : 'globally' );
|
||||||
$errorMessage .= '';
|
$errorMessage .= '';
|
||||||
ShadingProcessingDriveCommand( $hash, $shuttersDev );
|
ShadingProcessingDriveCommand( $hash, $shuttersDev );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$infoMessage .= (
|
$infoMessage .= (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne 'off'
|
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
|
||||||
|
'off'
|
||||||
&& $FHEM::Automation::ShuttersControl::ascDev
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlShading eq 'on'
|
->getAutoShuttersControlShading eq 'on'
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getOutTemp == -100
|
&& $FHEM::Automation::ShuttersControl::shutters->getOutTemp ==
|
||||||
|
-100
|
||||||
? ' shading active, global temp sensor is set, but shutters temperature sensor is not set'
|
? ' shading active, global temp sensor is set, but shutters temperature sensor is not set'
|
||||||
: ''
|
: ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$warnMessage .= (
|
$warnMessage .= (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
|
$FHEM::Automation::ShuttersControl::shutters->getShadingMode eq
|
||||||
|
'off'
|
||||||
&& $FHEM::Automation::ShuttersControl::ascDev
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlShading eq 'on'
|
->getAutoShuttersControlShading eq 'on'
|
||||||
? ' global shading active but ASC_Shading_Mode attribut is not set or off'
|
? ' global shading active but ASC_Shading_Mode attribut is not set or off'
|
||||||
@ -159,7 +147,8 @@ sub _CheckShuttersConditionsForShadingFn {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$errorMessage .= (
|
$errorMessage .= (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne 'off'
|
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
|
||||||
|
'off'
|
||||||
&& $FHEM::Automation::ShuttersControl::ascDev
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlShading ne 'on'
|
->getAutoShuttersControlShading ne 'on'
|
||||||
&& $FHEM::Automation::ShuttersControl::ascDev
|
&& $FHEM::Automation::ShuttersControl::ascDev
|
||||||
@ -167,17 +156,17 @@ sub _CheckShuttersConditionsForShadingFn {
|
|||||||
? ' ASC_Shading_Mode attribut is set but global shading has errors, look at ASC device '
|
? ' ASC_Shading_Mode attribut is set but global shading has errors, look at ASC device '
|
||||||
. '<a href="'
|
. '<a href="'
|
||||||
. '/fhem?detail='
|
. '/fhem?detail='
|
||||||
. ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
|
. ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
|
||||||
. $::FW_CSRF . '">'
|
. $::FW_CSRF . '">'
|
||||||
. ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
|
. ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
|
||||||
. '</a>'
|
. '</a>'
|
||||||
: ''
|
: ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$errorMessage .= (
|
$errorMessage .= (
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getBrightness == -1
|
$FHEM::Automation::ShuttersControl::shutters->getBrightness == -1
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
|
&& $FHEM::Automation::ShuttersControl::shutters->getShadingMode
|
||||||
'off'
|
ne 'off'
|
||||||
? ' no brightness sensor found, please set ASC_BrightnessSensor attribut'
|
? ' no brightness sensor found, please set ASC_BrightnessSensor attribut'
|
||||||
: ''
|
: ''
|
||||||
);
|
);
|
||||||
@ -197,10 +186,12 @@ sub _CheckShuttersConditionsForShadingFn {
|
|||||||
&& $infoMessage ne ''
|
&& $infoMessage ne ''
|
||||||
&& $errorMessage eq '' );
|
&& $errorMessage eq '' );
|
||||||
|
|
||||||
readingsBeginUpdate($shuttersDevHash);
|
::readingsBeginUpdate($shuttersDevHash);
|
||||||
readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
|
::readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
|
||||||
'<html>' . $message . ' </html>' );
|
'<html>' . $message . ' </html>' );
|
||||||
readingsEndUpdate( $shuttersDevHash, 1 );
|
::readingsEndUpdate( $shuttersDevHash, 1 );
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub ShadingProcessing {
|
sub ShadingProcessing {
|
||||||
@ -216,10 +207,16 @@ sub ShadingProcessing {
|
|||||||
my $brightness =
|
my $brightness =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getBrightnessAverage;
|
$FHEM::Automation::ShuttersControl::shutters->getBrightnessAverage;
|
||||||
|
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setShadingBetweenTheTimeSuspend(
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
( IsInTime($FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTime)
|
->setShadingBetweenTheTimeSuspend(
|
||||||
|
(
|
||||||
|
IsInTime(
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShadingBetweenTheTime
|
||||||
|
)
|
||||||
? 0
|
? 0
|
||||||
: 1 )
|
: 1
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
@ -250,7 +247,7 @@ sub ShadingProcessing {
|
|||||||
. ', Ist es nach der Hälfte der Beschattungswartezeit: '
|
. ', Ist es nach der Hälfte der Beschattungswartezeit: '
|
||||||
. (
|
. (
|
||||||
(
|
(
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingStatusTimestamp
|
->getShadingStatusTimestamp
|
||||||
) < (
|
) < (
|
||||||
@ -260,7 +257,7 @@ sub ShadingProcessing {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
||||||
. $shuttersDev
|
. $shuttersDev
|
||||||
. " Azimuth: "
|
. " Azimuth: "
|
||||||
@ -279,18 +276,22 @@ sub ShadingProcessing {
|
|||||||
|| $brightness == -1
|
|| $brightness == -1
|
||||||
|| $outTemp == -100
|
|| $outTemp == -100
|
||||||
|| (
|
|| (
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingStatusTimestamp ) < (
|
->getShadingStatusTimestamp ) < (
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingWaitingPeriod / 2
|
->getShadingWaitingPeriod / 2
|
||||||
)
|
)
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getExternalTriggerStatus
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
|
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
|
||||||
|| $FHEM::Automation::ShuttersControl::ascDev
|
|| $FHEM::Automation::ShuttersControl::ascDev
|
||||||
->getAutoShuttersControlShading eq 'off'
|
->getAutoShuttersControlShading eq 'off'
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getExternalTriggerStatus
|
||||||
);
|
);
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
||||||
. $shuttersDev
|
. $shuttersDev
|
||||||
. " Nach dem return" );
|
. " Nach dem return" );
|
||||||
@ -300,7 +301,7 @@ sub ShadingProcessing {
|
|||||||
my $getStatus = $FHEM::Automation::ShuttersControl::shutters->getStatus;
|
my $getStatus = $FHEM::Automation::ShuttersControl::shutters->getStatus;
|
||||||
my $oldShadingStatus =
|
my $oldShadingStatus =
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus;
|
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus;
|
||||||
my $shuttersDevHash = $defs{$shuttersDev};
|
my $shuttersDevHash = $::defs{$shuttersDev};
|
||||||
|
|
||||||
my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
|
my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
|
||||||
my $homemode = $FHEM::Automation::ShuttersControl::shutters->getHomemode;
|
my $homemode = $FHEM::Automation::ShuttersControl::shutters->getHomemode;
|
||||||
@ -317,8 +318,8 @@ sub ShadingProcessing {
|
|||||||
|| $azimuth < $azimuthLeft
|
|| $azimuth < $azimuthLeft
|
||||||
|| $azimuth > $azimuthRight
|
|| $azimuth > $azimuthRight
|
||||||
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
|
&& $FHEM::Automation::ShuttersControl::shutters
|
||||||
- ( int( gettimeofday() ) ) > 7200 )
|
->getSunriseUnixTime - ( int( ::gettimeofday() ) ) > 7200 )
|
||||||
)
|
)
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne
|
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne
|
||||||
'out'
|
'out'
|
||||||
@ -331,7 +332,7 @@ sub ShadingProcessing {
|
|||||||
. ' - Es ist Nacht oder die Aussentemperatur unterhalb der Shading Temperatur. Die Beschattung wird Zwangsbeendet'
|
. ' - Es ist Nacht oder die Aussentemperatur unterhalb der Shading Temperatur. Die Beschattung wird Zwangsbeendet'
|
||||||
);
|
);
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing - Der Sonnenstand ist ausserhalb der Winkelangaben oder die Aussentemperatur unterhalb der Shading Temperatur "
|
"AutoShuttersControl ($name) - Shading Processing - Der Sonnenstand ist ausserhalb der Winkelangaben oder die Aussentemperatur unterhalb der Shading Temperatur "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -358,7 +359,7 @@ sub ShadingProcessing {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus
|
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus
|
||||||
eq 'out reserved'
|
eq 'out reserved'
|
||||||
and (
|
and (
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingStatusTimestamp )
|
->getShadingStatusTimestamp )
|
||||||
) > $FHEM::Automation::ShuttersControl::shutters
|
) > $FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -369,7 +370,7 @@ sub ShadingProcessing {
|
|||||||
'out');
|
'out');
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
||||||
. $shuttersDev
|
. $shuttersDev
|
||||||
. " In der Out Abfrage, Shadingwert: "
|
. " In der Out Abfrage, Shadingwert: "
|
||||||
@ -411,7 +412,7 @@ sub ShadingProcessing {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
|
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
|
||||||
'in reserved'
|
'in reserved'
|
||||||
and (
|
and (
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingStatusTimestamp ) > (
|
->getShadingStatusTimestamp ) > (
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
@ -423,7 +424,7 @@ sub ShadingProcessing {
|
|||||||
'in');
|
'in');
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
|
||||||
. $shuttersDev
|
. $shuttersDev
|
||||||
. " In der In Abfrage, Shadingwert: "
|
. " In der In Abfrage, Shadingwert: "
|
||||||
@ -469,21 +470,17 @@ sub ShadingProcessing {
|
|||||||
$homemode )
|
$homemode )
|
||||||
&& (
|
&& (
|
||||||
$getModeUp eq 'always'
|
$getModeUp eq 'always'
|
||||||
|| $getModeUp eq
|
|| $getModeUp eq $homemode
|
||||||
$homemode
|
|
||||||
|| $getModeUp eq 'off'
|
|| $getModeUp eq 'off'
|
||||||
|| $getModeUp eq
|
|| $getModeUp eq 'absent'
|
||||||
'absent'
|
|| $getModeUp eq 'gone'
|
||||||
|| $getModeUp eq
|
|| ( $getModeUp eq 'home'
|
||||||
'gone'
|
|
||||||
|| ( $getModeUp eq
|
|
||||||
'home'
|
|
||||||
&& $homemode ne 'asleep' )
|
&& $homemode ne 'asleep' )
|
||||||
)
|
)
|
||||||
&& (
|
&& (
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
int( gettimeofday() ) -
|
int( ::gettimeofday() ) -
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getShadingStatusTimestamp
|
->getShadingStatusTimestamp
|
||||||
) < 2
|
) < 2
|
||||||
@ -499,16 +496,16 @@ sub ShadingProcessing {
|
|||||||
)
|
)
|
||||||
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
&& $FHEM::Automation::ShuttersControl::shutters->getStatus ==
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
|
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
|
||||||
)
|
|| ( !$FHEM::Automation::ShuttersControl::shutters
|
||||||
|| ( !$FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTimeSuspend
|
->getShadingBetweenTheTimeSuspend
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
|
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
|
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
readingsBeginUpdate($shuttersDevHash);
|
::readingsBeginUpdate($shuttersDevHash);
|
||||||
readingsBulkUpdate(
|
::readingsBulkUpdate(
|
||||||
$shuttersDevHash,
|
$shuttersDevHash,
|
||||||
'ASC_ShadingMessage',
|
'ASC_ShadingMessage',
|
||||||
'INFO: current shading status is \''
|
'INFO: current shading status is \''
|
||||||
@ -531,7 +528,7 @@ sub ShadingProcessing {
|
|||||||
) / 60
|
) / 60
|
||||||
. 'm'
|
. 'm'
|
||||||
);
|
);
|
||||||
readingsEndUpdate( $shuttersDevHash, 1 );
|
::readingsEndUpdate( $shuttersDevHash, 1 );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -551,18 +548,27 @@ sub ShadingProcessingDriveCommand {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setShadingStatus(
|
$FHEM::Automation::ShuttersControl::shutters->setShadingStatus(
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
|
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
|
||||||
|
|
||||||
if ( IsInTime($FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTime)
|
if (
|
||||||
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq 'in'
|
IsInTime(
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
|
->getShadingBetweenTheTime
|
||||||
|
)
|
||||||
|
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
|
||||||
|
'in'
|
||||||
&& $getShadingPos != $getStatus
|
&& $getShadingPos != $getStatus
|
||||||
&& ( $getStatus != $FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
&& (
|
||||||
|| ( $getStatus == $FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
$getStatus !=
|
||||||
&& $marker
|
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
)
|
|| ( $getStatus ==
|
||||||
)
|
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|
||||||
&& ( $getStatus != $FHEM::Automation::ShuttersControl::shutters->getSleepPos
|
&& $marker )
|
||||||
|| ( $getStatus == $FHEM::Automation::ShuttersControl::shutters->getSleepPos
|
|
||||||
&& $marker
|
|
||||||
)
|
)
|
||||||
|
&& (
|
||||||
|
$getStatus !=
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getSleepPos
|
||||||
|
|| ( $getStatus ==
|
||||||
|
$FHEM::Automation::ShuttersControl::shutters->getSleepPos
|
||||||
|
&& $marker )
|
||||||
)
|
)
|
||||||
&& (
|
&& (
|
||||||
FHEM::Automation::ShuttersControl::CheckIfShuttersWindowRecOpen(
|
FHEM::Automation::ShuttersControl::CheckIfShuttersWindowRecOpen(
|
||||||
@ -626,8 +632,10 @@ sub ShadingProcessingDriveCommand {
|
|||||||
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) if ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
|
)
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace eq 'awning' );
|
if ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
|
||||||
|
|| $FHEM::Automation::ShuttersControl::shutters->getShuttersPlace
|
||||||
|
eq 'awning' );
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug(
|
FHEM::Automation::ShuttersControl::ASC_Debug(
|
||||||
'ShadingProcessingDriveCommand: '
|
'ShadingProcessingDriveCommand: '
|
||||||
@ -639,7 +647,7 @@ sub ShadingProcessingDriveCommand {
|
|||||||
. ' zum beenden der Beschattung gefahren' );
|
. ' zum beenden der Beschattung gefahren' );
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3( $name, 4,
|
::Log3( $name, 4,
|
||||||
"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
|
"AutoShuttersControl ($name) - Shading Processing - In der Routine zum fahren der Rollläden, Shading Wert: "
|
||||||
. $FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
|
. $FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -45,18 +45,18 @@
|
|||||||
|
|
||||||
package FHEM::Automation::ShuttersControl::Shutters;
|
package FHEM::Automation::ShuttersControl::Shutters;
|
||||||
|
|
||||||
use FHEM::Automation::ShuttersControl::Shutters::Readings;
|
|
||||||
use FHEM::Automation::ShuttersControl::Shutters::Attr;
|
|
||||||
use FHEM::Automation::ShuttersControl::Roommate;
|
|
||||||
use FHEM::Automation::ShuttersControl::Window;
|
|
||||||
|
|
||||||
our @ISA =
|
|
||||||
qw(FHEM::Automation::ShuttersControl::Shutters::Readings FHEM::Automation::ShuttersControl::Shutters::Attr FHEM::Automation::ShuttersControl::Roommate FHEM::Automation::ShuttersControl::Window);
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
|
use FHEM::Automation::ShuttersControl::Shutters::Readings;
|
||||||
|
use FHEM::Automation::ShuttersControl::Shutters::Attr;
|
||||||
|
use FHEM::Automation::ShuttersControl::Roommate qw (:ALL);
|
||||||
|
use FHEM::Automation::ShuttersControl::Window;
|
||||||
|
|
||||||
|
use base
|
||||||
|
qw(FHEM::Automation::ShuttersControl::Shutters::Readings FHEM::Automation::ShuttersControl::Shutters::Attr FHEM::Automation::ShuttersControl::Roommate FHEM::Automation::ShuttersControl::Window);
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $self = {
|
my $self = {
|
||||||
@ -161,9 +161,6 @@ sub setDriveCmd {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setDelayCmd($posValue);
|
$FHEM::Automation::ShuttersControl::shutters->setDelayCmd($posValue);
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->setDelayCmdReading;
|
$FHEM::Automation::ShuttersControl::ascDev->setDelayCmdReading;
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(0);
|
$FHEM::Automation::ShuttersControl::shutters->setNoDelay(0);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setExternalTriggerStatus(0)
|
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters
|
|
||||||
->getExternalTriggerStatus );
|
|
||||||
|
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug( 'setDriveCmd: '
|
FHEM::Automation::ShuttersControl::ASC_Debug( 'setDriveCmd: '
|
||||||
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
@ -177,7 +174,8 @@ sub setDriveCmd {
|
|||||||
if ( $FHEM::Automation::ShuttersControl::shutters->getDelayCmd ne
|
if ( $FHEM::Automation::ShuttersControl::shutters->getDelayCmd ne
|
||||||
'none' )
|
'none' )
|
||||||
; # setzt den Wert auf none da der Rolladen nun gesteuert werden kann.
|
; # setzt den Wert auf none da der Rolladen nun gesteuert werden kann.
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setExternalTriggerStatus(0)
|
$FHEM::Automation::ShuttersControl::shutters->setExternalTriggerStatus(
|
||||||
|
0)
|
||||||
if ( $FHEM::Automation::ShuttersControl::shutters
|
if ( $FHEM::Automation::ShuttersControl::shutters
|
||||||
->getExternalTriggerStatus );
|
->getExternalTriggerStatus );
|
||||||
|
|
||||||
@ -233,7 +231,7 @@ sub setDriveCmd {
|
|||||||
::gettimeofday() +
|
::gettimeofday() +
|
||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getSelfDefenseAbsentDelay,
|
->getSelfDefenseAbsentDelay,
|
||||||
\&FHEM::Automation::ShuttersControl::_SetCmdFn, \%h
|
\&FHEM::Automation::ShuttersControl::SetCmdFn, \%h
|
||||||
);
|
);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->setSelfDefenseAbsent(
|
$FHEM::Automation::ShuttersControl::shutters->setSelfDefenseAbsent(
|
||||||
1, 0, \%h );
|
1, 0, \%h );
|
||||||
@ -247,7 +245,7 @@ sub setDriveCmd {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters
|
$FHEM::Automation::ShuttersControl::shutters
|
||||||
->getDelayStart
|
->getDelayStart
|
||||||
),
|
),
|
||||||
\&FHEM::Automation::ShuttersControl::_SetCmdFn,
|
\&FHEM::Automation::ShuttersControl::SetCmdFn,
|
||||||
\%h
|
\%h
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -258,7 +256,7 @@ sub setDriveCmd {
|
|||||||
elsif ($offSetStart < 1
|
elsif ($offSetStart < 1
|
||||||
|| $FHEM::Automation::ShuttersControl::shutters->getNoDelay )
|
|| $FHEM::Automation::ShuttersControl::shutters->getNoDelay )
|
||||||
{
|
{
|
||||||
FHEM::Automation::ShuttersControl::_SetCmdFn( \%h );
|
FHEM::Automation::ShuttersControl::SetCmdFn( \%h );
|
||||||
FHEM::Automation::ShuttersControl::ASC_Debug( 'FnSetDriveCmd: '
|
FHEM::Automation::ShuttersControl::ASC_Debug( 'FnSetDriveCmd: '
|
||||||
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
|
||||||
. ' - NICHT versetztes fahren' );
|
. ' - NICHT versetztes fahren' );
|
||||||
@ -346,8 +344,7 @@ sub setLastDriveReading {
|
|||||||
);
|
);
|
||||||
|
|
||||||
::InternalTimer( ::gettimeofday() + 0.1,
|
::InternalTimer( ::gettimeofday() + 0.1,
|
||||||
\&FHEM::Automation::ShuttersControl::_setShuttersLastDriveDelayed,
|
\&FHEM::Automation::ShuttersControl::setShuttersLastDriveDelayed, \%h );
|
||||||
\%h );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,7 +457,8 @@ sub setRainUnprotectionDelayObj {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $value = shift;
|
my $value = shift;
|
||||||
|
|
||||||
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL} = $value
|
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
|
||||||
|
= $value
|
||||||
if ( defined($value) );
|
if ( defined($value) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -545,7 +543,8 @@ sub getAttrUpdateChanges {
|
|||||||
sub getIsDay {
|
sub getIsDay {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return FHEM::Automation::ShuttersControl::Helper::_IsDay( $self->{shuttersDev} );
|
return FHEM::Automation::ShuttersControl::Helper::_IsDay(
|
||||||
|
$self->{shuttersDev} );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getAntiFreezeStatus {
|
sub getAntiFreezeStatus {
|
||||||
@ -756,10 +755,12 @@ sub getRainUnprotectionDelayObj {
|
|||||||
(
|
(
|
||||||
defined( $self->{ $self->{shuttersDev} }->{RainProtection} )
|
defined( $self->{ $self->{shuttersDev} }->{RainProtection} )
|
||||||
&& defined(
|
&& defined(
|
||||||
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
|
$self->{ $self->{shuttersDev} }->{RainProtection}
|
||||||
|
->{UNPROTECTIONDELAYOBJVAL}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
? $self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
|
? $self->{ $self->{shuttersDev} }->{RainProtection}
|
||||||
|
->{UNPROTECTIONDELAYOBJVAL}
|
||||||
: 'none'
|
: 'none'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -821,7 +822,7 @@ sub getRoommatesStatus {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
|
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
|
||||||
my $currentPrio =
|
my $currentPrio =
|
||||||
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
|
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
|
||||||
->_getRoommateStatus };
|
->getRoommateStatus };
|
||||||
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
|
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,7 +855,7 @@ sub getRoommatesLastStatus {
|
|||||||
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
|
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
|
||||||
my $currentPrio =
|
my $currentPrio =
|
||||||
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
|
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
|
||||||
->_getRoommateLastStatus };
|
->getRoommateLastStatus };
|
||||||
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
|
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -899,7 +900,8 @@ sub setShadingStatus {
|
|||||||
|
|
||||||
$self->{ $self->{shuttersDev} }{ShadingStatus}{VAL} = $value
|
$self->{ $self->{shuttersDev} }{ShadingStatus}{VAL} = $value
|
||||||
if ( defined($value) );
|
if ( defined($value) );
|
||||||
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} = int( ::gettimeofday() )
|
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} =
|
||||||
|
int( ::gettimeofday() )
|
||||||
if ( defined( $self->{ $self->{shuttersDev} }{ShadingStatus} ) );
|
if ( defined( $self->{ $self->{shuttersDev} }{ShadingStatus} ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1011,8 +1013,12 @@ sub getShadingBetweenTheTimeSuspend { # Werte für value = 0, 1
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
defined( $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend} )
|
defined(
|
||||||
&& defined( $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL} )
|
$self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}
|
||||||
|
)
|
||||||
|
&& defined(
|
||||||
|
$self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL}
|
||||||
|
)
|
||||||
? $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL}
|
? $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL}
|
||||||
: 0
|
: 0
|
||||||
);
|
);
|
||||||
@ -1084,9 +1090,7 @@ sub getShadingLastPos {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
defined( $self->{ $self->{shuttersDev} }{ShadingLastPos} )
|
defined( $self->{ $self->{shuttersDev} }{ShadingLastPos} )
|
||||||
&& defined(
|
&& defined( $self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL} )
|
||||||
$self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL}
|
|
||||||
)
|
|
||||||
? $self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL}
|
? $self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL}
|
||||||
: $FHEM::Automation::ShuttersControl::shutters->getShadingPos
|
: $FHEM::Automation::ShuttersControl::shutters->getShadingPos
|
||||||
);
|
);
|
||||||
@ -1094,7 +1098,4 @@ sub getShadingLastPos {
|
|||||||
|
|
||||||
### Ende Beschattung
|
### Ende Beschattung
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -46,24 +46,12 @@ use utf8;
|
|||||||
|
|
||||||
use FHEM::Automation::ShuttersControl::Helper qw (IsAdv PerlCodeCheck);
|
use FHEM::Automation::ShuttersControl::Helper qw (IsAdv PerlCodeCheck);
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
AttrVal
|
|
||||||
CommandAttr
|
|
||||||
gettimeofday)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub _setAttributs {
|
sub _setAttributs {
|
||||||
my $shuttersDev = shift;
|
my $shuttersDev = shift;
|
||||||
my $attr = shift;
|
my $attr = shift;
|
||||||
my $attrVal = shift;
|
my $attrVal = shift;
|
||||||
|
|
||||||
CommandAttr( undef, $shuttersDev . ' ' . $attr . ' ' . $attrVal );
|
::CommandAttr( undef, $shuttersDev . ' ' . $attr . ' ' . $attrVal );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -77,28 +65,28 @@ sub _getPosition {
|
|||||||
return $self->{ $self->{shuttersDev} }->{$attr}->{position}
|
return $self->{ $self->{shuttersDev} }->{$attr}->{position}
|
||||||
if (
|
if (
|
||||||
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
|
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
|
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
|
|
||||||
my $position;
|
my $position;
|
||||||
my $posAssignment;
|
my $posAssignment;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
AttrVal( $self->{shuttersDev}, $attr,
|
::AttrVal( $self->{shuttersDev}, $attr,
|
||||||
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ] ) =~
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ] ) =~
|
||||||
m{\A\{.+\}\z}xms
|
m{\A\{.+\}\z}xms
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
my $response = PerlCodeCheck(
|
my $response = PerlCodeCheck(
|
||||||
AttrVal(
|
::AttrVal(
|
||||||
$self->{shuttersDev},
|
$self->{shuttersDev},
|
||||||
$attr,
|
$attr,
|
||||||
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -108,7 +96,7 @@ sub _getPosition {
|
|||||||
$position =~ m{\A\d+(\.\d+)?\z}xms
|
$position =~ m{\A\d+(\.\d+)?\z}xms
|
||||||
? $position
|
? $position
|
||||||
: $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
: $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
||||||
);
|
);
|
||||||
|
|
||||||
$posAssignment = (
|
$posAssignment = (
|
||||||
@ -124,7 +112,7 @@ sub _getPosition {
|
|||||||
$self->{shuttersDev},
|
$self->{shuttersDev},
|
||||||
$attr,
|
$attr,
|
||||||
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,8 +133,7 @@ sub _getPosition {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
$self->{ $self->{shuttersDev} }->{$attr}->{position} =
|
$self->{ $self->{shuttersDev} }->{$attr}->{position} =
|
||||||
PerlCodeCheck(
|
PerlCodeCheck( $self->{ $self->{shuttersDev} }->{$attr}->{position} );
|
||||||
$self->{ $self->{shuttersDev} }->{$attr}->{position} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -154,7 +141,7 @@ sub _getPosition {
|
|||||||
m{^\d+(\.\d+)?$}xms
|
m{^\d+(\.\d+)?$}xms
|
||||||
? $self->{ $self->{shuttersDev} }->{$attr}->{position}
|
? $self->{ $self->{shuttersDev} }->{$attr}->{position}
|
||||||
: $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
: $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +154,7 @@ sub _getPositionAssignment {
|
|||||||
return $self->{ $self->{shuttersDev} }->{$attr}->{posAssignment}
|
return $self->{ $self->{shuttersDev} }->{$attr}->{posAssignment}
|
||||||
if (
|
if (
|
||||||
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
|
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
|
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$FHEM::Automation::ShuttersControl::shutters->$getFn;
|
$FHEM::Automation::ShuttersControl::shutters->$getFn;
|
||||||
@ -213,7 +200,7 @@ sub setShuttersPlace {
|
|||||||
sub getShuttersPlace {
|
sub getShuttersPlace {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_ShuttersPlace', 'window' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_ShuttersPlace', 'window' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setSlatPosCmd {
|
sub setSlatPosCmd {
|
||||||
@ -236,15 +223,15 @@ sub getSlatPosCmd {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}->{LASTGETTIME}
|
||||||
= int( gettimeofday() );
|
= int( ::gettimeofday() );
|
||||||
my ( $slatPosCmd, $slatDevice ) =
|
my ( $slatPosCmd, $slatDevice ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_SlatPosCmd_SlatDevice', 'none:none' );
|
$self->{shuttersDev}, 'ASC_SlatPosCmd_SlatDevice', 'none:none' );
|
||||||
|
|
||||||
## Erwartetes Ergebnis
|
## Erwartetes Ergebnis
|
||||||
# upTime:upBrightnessVal
|
# upTime:upBrightnessVal
|
||||||
@ -268,7 +255,7 @@ sub getSlatDevice {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -299,15 +286,15 @@ sub getPrivacyUpTime {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
||||||
->{LASTGETTIME} = int( gettimeofday() );
|
->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $upTime, $upBrightnessVal ) =
|
my ( $upTime, $upBrightnessVal ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_PrivacyUpValue_beforeDayOpen', '-1:-1' );
|
$self->{shuttersDev}, 'ASC_PrivacyUpValue_beforeDayOpen', '-1:-1' );
|
||||||
|
|
||||||
## Erwartetes Ergebnis
|
## Erwartetes Ergebnis
|
||||||
# upTime:upBrightnessVal
|
# upTime:upBrightnessVal
|
||||||
@ -341,7 +328,7 @@ sub getPrivacyUpBrightnessVal {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -378,14 +365,15 @@ sub getPrivacyDownTime {
|
|||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
|
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
|
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_PrivacyDownValue_beforeNightClose}
|
$self->{ $self->{shuttersDev} }->{ASC_PrivacyDownValue_beforeNightClose}
|
||||||
->{LASTGETTIME} = int( gettimeofday() );
|
->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $downTime, $downBrightnessVal ) =
|
my ( $downTime, $downBrightnessVal ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
|
$self->{shuttersDev},
|
||||||
'ASC_PrivacyDownValue_beforeNightClose', '-1:-1' );
|
'ASC_PrivacyDownValue_beforeNightClose', '-1:-1' );
|
||||||
|
|
||||||
## Erwartetes Ergebnis
|
## Erwartetes Ergebnis
|
||||||
@ -420,7 +408,7 @@ sub getPrivacyDownBrightnessVal {
|
|||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
|
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
|
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -497,7 +485,7 @@ sub setSelfDefenseMode {
|
|||||||
sub getSelfDefenseMode {
|
sub getSelfDefenseMode {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_Mode', 'gone' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_Mode', 'gone' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setSelfDefenseAbsentDelay {
|
sub setSelfDefenseAbsentDelay {
|
||||||
@ -513,7 +501,14 @@ sub setSelfDefenseAbsentDelay {
|
|||||||
sub getSelfDefenseAbsentDelay {
|
sub getSelfDefenseAbsentDelay {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_AbsentDelay', 300 );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_AbsentDelay',
|
||||||
|
300 );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub getCommandTemplate {
|
||||||
|
my $self = shift;
|
||||||
|
|
||||||
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_CommandTemplate', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setWiggleValue {
|
sub setWiggleValue {
|
||||||
@ -528,7 +523,7 @@ sub setWiggleValue {
|
|||||||
sub getWiggleValue {
|
sub getWiggleValue {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_WiggleValue', 5 );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_WiggleValue', 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setAdv {
|
sub setAdv {
|
||||||
@ -544,7 +539,7 @@ sub getAdv {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
AttrVal( $self->{shuttersDev}, 'ASC_Adv', 'off' ) eq 'on'
|
::AttrVal( $self->{shuttersDev}, 'ASC_Adv', 'off' ) eq 'on'
|
||||||
? ( IsAdv == 1 ? 1 : 0 )
|
? ( IsAdv == 1 ? 1 : 0 )
|
||||||
: 0
|
: 0
|
||||||
);
|
);
|
||||||
@ -587,7 +582,7 @@ sub setShadingMode {
|
|||||||
sub getShadingMode {
|
sub getShadingMode {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_Mode', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Shading_Mode', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _getTempSensor {
|
sub _getTempSensor {
|
||||||
@ -598,15 +593,15 @@ sub _getTempSensor {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
|
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
|
||||||
< 2
|
< 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
my ( $device, $reading ) =
|
my ( $device, $reading ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_TempSensor', 'none' );
|
$self->{shuttersDev}, 'ASC_TempSensor', 'none' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# DEVICE:READING
|
# DEVICE:READING
|
||||||
@ -625,7 +620,7 @@ sub getTempSensorReading {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
|
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
|
||||||
< 2
|
< 2
|
||||||
);
|
);
|
||||||
@ -658,15 +653,15 @@ sub _getIdleDetectionReading {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
|
||||||
= int( gettimeofday() );
|
= int( ::gettimeofday() );
|
||||||
my ( $reading, $value ) =
|
my ( $reading, $value ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_Shutter_IdleDetection', 'none' );
|
$self->{shuttersDev}, 'ASC_Shutter_IdleDetection', 'none' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# READING:VALUE
|
# READING:VALUE
|
||||||
@ -688,7 +683,7 @@ sub getIdleDetectionValue {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -722,15 +717,15 @@ sub _getBrightnessSensor {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
my ( $device, $reading, $max, $min ) =
|
my ( $device, $reading, $max, $min ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_BrightnessSensor', 'none' );
|
$self->{shuttersDev}, 'ASC_BrightnessSensor', 'none' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# DEVICE:READING MAX:MIN
|
# DEVICE:READING MAX:MIN
|
||||||
@ -754,7 +749,7 @@ sub getBrightnessReading {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -779,7 +774,7 @@ sub getShadingAzimuthLeft {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -808,15 +803,15 @@ sub getShadingAzimuthRight {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}->{LASTGETTIME}
|
||||||
= int( gettimeofday() );
|
= int( ::gettimeofday() );
|
||||||
my ( $left, $right ) =
|
my ( $left, $right ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_Shading_InOutAzimuth', '95:265' );
|
$self->{shuttersDev}, 'ASC_Shading_InOutAzimuth', '95:265' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# MIN:MAX
|
# MIN:MAX
|
||||||
@ -843,8 +838,8 @@ sub setShadingMinOutsideTemperature {
|
|||||||
sub getShadingMinOutsideTemperature {
|
sub getShadingMinOutsideTemperature {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_Min_OutsideTemperature',
|
return ::AttrVal( $self->{shuttersDev},
|
||||||
18 );
|
'ASC_Shading_Min_OutsideTemperature', 18 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setShadingMinMaxElevation {
|
sub setShadingMinMaxElevation {
|
||||||
@ -867,15 +862,15 @@ sub getShadingMinElevation {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
||||||
->{LASTGETTIME} = int( gettimeofday() );
|
->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $min, $max ) =
|
my ( $min, $max ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_Shading_MinMax_Elevation', '25.0:100.0' );
|
$self->{shuttersDev}, 'ASC_Shading_MinMax_Elevation', '25.0:100.0' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# MIN:MAX
|
# MIN:MAX
|
||||||
@ -899,7 +894,7 @@ sub getShadingMaxElevation {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -937,15 +932,15 @@ sub getShadingStateChangeSunny {
|
|||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_Shading_StateChange_SunnyCloudy}
|
$self->{ $self->{shuttersDev} }->{ASC_Shading_StateChange_SunnyCloudy}
|
||||||
->{LASTGETTIME} = int( gettimeofday() );
|
->{LASTGETTIME} = int( ::gettimeofday() );
|
||||||
my ( $sunny, $cloudy, $maxBrightnessAverageArrayObjects ) =
|
my ( $sunny, $cloudy, $maxBrightnessAverageArrayObjects ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_Shading_StateChange_SunnyCloudy',
|
$self->{shuttersDev}, 'ASC_Shading_StateChange_SunnyCloudy',
|
||||||
'35000:20000' );
|
'35000:20000' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
@ -976,7 +971,7 @@ sub getShadingStateChangeCloudy {
|
|||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -996,7 +991,7 @@ sub getMaxBrightnessAverageArrayObjects {
|
|||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }
|
$self->{ $self->{shuttersDev} }
|
||||||
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1019,7 +1014,7 @@ sub setShadingWaitingPeriod {
|
|||||||
sub getShadingWaitingPeriod {
|
sub getShadingWaitingPeriod {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_WaitingPeriod', 1200 );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Shading_WaitingPeriod', 1200 );
|
||||||
}
|
}
|
||||||
### Ende Beschattung
|
### Ende Beschattung
|
||||||
sub setExternalTrigger {
|
sub setExternalTrigger {
|
||||||
@ -1040,16 +1035,16 @@ sub getExternalTriggerDevice {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
my ( $device, $reading, $valueActive, $valueInactive, $posActive,
|
my ( $device, $reading, $valueActive, $valueInactive, $posActive,
|
||||||
$posInactive, $valueActive2, $posActive2 )
|
$posInactive, $valueActive2, $posActive2 )
|
||||||
= FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
= FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_ExternalTrigger', 'none' );
|
$self->{shuttersDev}, 'ASC_ExternalTrigger', 'none' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE VALUEACTIVE2:POSACTIVE2
|
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE VALUEACTIVE2:POSACTIVE2
|
||||||
@ -1064,10 +1059,11 @@ sub getExternalTriggerDevice {
|
|||||||
$valueInactive;
|
$valueInactive;
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive} =
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive} =
|
||||||
$posActive;
|
$posActive;
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posinactive} =
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posinactive} = (
|
||||||
( $posInactive ne 'none'
|
$posInactive ne 'none'
|
||||||
? $posInactive
|
? $posInactive
|
||||||
: $FHEM::Automation::ShuttersControl::shutters->getLastPos );
|
: $FHEM::Automation::ShuttersControl::shutters->getLastPos
|
||||||
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{valueactive2} =
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{valueactive2} =
|
||||||
$valueActive2;
|
$valueActive2;
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive2} =
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive2} =
|
||||||
@ -1086,7 +1082,7 @@ sub getExternalTriggerReading {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1104,7 +1100,7 @@ sub getExternalTriggerValueActive {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1124,7 +1120,7 @@ sub getExternalTriggerValueActive2 {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1144,7 +1140,7 @@ sub getExternalTriggerValueInactive {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1163,7 +1159,7 @@ sub getExternalTriggerPosActive {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1181,7 +1177,7 @@ sub getExternalTriggerPosActive2 {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1199,7 +1195,7 @@ sub getExternalTriggerPosInactive {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1221,7 +1217,7 @@ sub setDelay {
|
|||||||
sub getDelay {
|
sub getDelay {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Drive_Delay', -1 );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Drive_Delay', -1 );
|
||||||
return ( $val =~ m{^\d+$}xms ? $val : -1 );
|
return ( $val =~ m{^\d+$}xms ? $val : -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1237,7 +1233,7 @@ sub setDelayStart {
|
|||||||
sub getDelayStart {
|
sub getDelayStart {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Drive_DelayStart', -1 );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Drive_DelayStart', -1 );
|
||||||
return ( ( $val > 0 && $val =~ m{^\d+$}xms ) ? $val : -1 );
|
return ( ( $val > 0 && $val =~ m{^\d+$}xms ) ? $val : -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1254,7 +1250,7 @@ sub setBlockingTimeAfterManual {
|
|||||||
sub getBlockingTimeAfterManual {
|
sub getBlockingTimeAfterManual {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_afterManual',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_afterManual',
|
||||||
1200 );
|
1200 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1271,7 +1267,7 @@ sub setBlockingTimeBeforNightClose {
|
|||||||
sub getBlockingTimeBeforNightClose {
|
sub getBlockingTimeBeforNightClose {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforNightClose',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforNightClose',
|
||||||
3600 );
|
3600 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1288,7 +1284,7 @@ sub setBlockingTimeBeforDayOpen {
|
|||||||
sub getBlockingTimeBeforDayOpen {
|
sub getBlockingTimeBeforDayOpen {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforDayOpen',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforDayOpen',
|
||||||
3600 );
|
3600 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1304,9 +1300,9 @@ sub setPosCmd {
|
|||||||
sub getPosCmd {
|
sub getPosCmd {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Pos_Reading',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Pos_Reading',
|
||||||
$FHEM::Automation::ShuttersControl::userAttrList{'ASC_Pos_Reading'}
|
$FHEM::Automation::ShuttersControl::userAttrList{'ASC_Pos_Reading'}
|
||||||
[ AttrVal( $self->{shuttersDev}, 'ASC', 1 ) ] );
|
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 1 ) ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setOpenPos {
|
sub setOpenPos {
|
||||||
@ -1371,7 +1367,7 @@ sub setVentilatePosAfterDayClosed {
|
|||||||
sub getVentilatePosAfterDayClosed {
|
sub getVentilatePosAfterDayClosed {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_PosAfterDayClosed',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_PosAfterDayClosed',
|
||||||
'open' );
|
'open' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1436,7 +1432,7 @@ sub setVentilateOpen {
|
|||||||
sub getVentilateOpen {
|
sub getVentilateOpen {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Ventilate_Window_Open', 'on' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Ventilate_Window_Open', 'on' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setComfortOpenPos {
|
sub setComfortOpenPos {
|
||||||
@ -1476,7 +1472,7 @@ sub setPartyMode {
|
|||||||
sub getPartyMode {
|
sub getPartyMode {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Partymode', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Partymode', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setRoommates {
|
sub setRoommates {
|
||||||
@ -1491,7 +1487,7 @@ sub setRoommates {
|
|||||||
sub getRoommates {
|
sub getRoommates {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Device', 'none' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Device', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setRoommatesReading {
|
sub setRoommatesReading {
|
||||||
@ -1506,7 +1502,7 @@ sub setRoommatesReading {
|
|||||||
sub getRoommatesReading {
|
sub getRoommatesReading {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Reading', 'state' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Reading', 'state' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getWindPos {
|
sub getWindPos {
|
||||||
@ -1519,7 +1515,7 @@ sub getWindPos {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
) < 2
|
) < 2
|
||||||
);
|
);
|
||||||
@ -1538,15 +1534,15 @@ sub getWindMax {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
) < 2
|
) < 2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
my ( $max, $hyst, $pos ) =
|
my ( $max, $hyst, $pos ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_WindParameters', '50:20' );
|
$self->{shuttersDev}, 'ASC_WindParameters', '50:20' );
|
||||||
|
|
||||||
## Erwartetes Ergebnis
|
## Erwartetes Ergebnis
|
||||||
# max:hyst pos
|
# max:hyst pos
|
||||||
@ -1554,10 +1550,11 @@ sub getWindMax {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax} = $max;
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax} = $max;
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggerhyst} =
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggerhyst} =
|
||||||
( $hyst ne 'none' ? $max - $hyst : $max - 20 );
|
( $hyst ne 'none' ? $max - $hyst : $max - 20 );
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{closedPos} =
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{closedPos} = (
|
||||||
( $pos ne 'none'
|
$pos ne 'none'
|
||||||
? $pos
|
? $pos
|
||||||
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos );
|
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos
|
||||||
|
);
|
||||||
|
|
||||||
return $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax};
|
return $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax};
|
||||||
}
|
}
|
||||||
@ -1581,7 +1578,7 @@ sub getWindMin {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
|
||||||
) < 2
|
) < 2
|
||||||
);
|
);
|
||||||
@ -1602,7 +1599,7 @@ sub setWindProtection {
|
|||||||
sub getWindProtection {
|
sub getWindProtection {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_WindProtection', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindProtection', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setRainProtection {
|
sub setRainProtection {
|
||||||
@ -1617,7 +1614,7 @@ sub setRainProtection {
|
|||||||
sub getRainProtection {
|
sub getRainProtection {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_RainProtection', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_RainProtection', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setModeUp {
|
sub setModeUp {
|
||||||
@ -1632,7 +1629,7 @@ sub setModeUp {
|
|||||||
sub getModeUp {
|
sub getModeUp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Mode_Up', 'always' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Mode_Up', 'always' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setModeDown {
|
sub setModeDown {
|
||||||
@ -1647,7 +1644,7 @@ sub setModeDown {
|
|||||||
sub getModeDown {
|
sub getModeDown {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Mode_Down', 'always' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Mode_Down', 'always' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setLockOut {
|
sub setLockOut {
|
||||||
@ -1662,7 +1659,7 @@ sub setLockOut {
|
|||||||
sub getLockOut {
|
sub getLockOut {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_LockOut', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_LockOut', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setLockOutCmd {
|
sub setLockOutCmd {
|
||||||
@ -1677,7 +1674,7 @@ sub setLockOutCmd {
|
|||||||
sub getLockOutCmd {
|
sub getLockOutCmd {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_LockOut_Cmd', 'none' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_LockOut_Cmd', 'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setAntiFreeze {
|
sub setAntiFreeze {
|
||||||
@ -1692,7 +1689,7 @@ sub setAntiFreeze {
|
|||||||
sub getAntiFreeze {
|
sub getAntiFreeze {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Antifreeze', 'off' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Antifreeze', 'off' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setAutoAstroModeMorning {
|
sub setAutoAstroModeMorning {
|
||||||
@ -1707,7 +1704,8 @@ sub setAutoAstroModeMorning {
|
|||||||
sub getAutoAstroModeMorning {
|
sub getAutoAstroModeMorning {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorning', 'none' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorning',
|
||||||
|
'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setAutoAstroModeEvening {
|
sub setAutoAstroModeEvening {
|
||||||
@ -1722,7 +1720,8 @@ sub setAutoAstroModeEvening {
|
|||||||
sub getAutoAstroModeEvening {
|
sub getAutoAstroModeEvening {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEvening', 'none' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEvening',
|
||||||
|
'none' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setAutoAstroModeMorningHorizon {
|
sub setAutoAstroModeMorningHorizon {
|
||||||
@ -1738,7 +1737,7 @@ sub setAutoAstroModeMorningHorizon {
|
|||||||
sub getAutoAstroModeMorningHorizon {
|
sub getAutoAstroModeMorningHorizon {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorningHorizon',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorningHorizon',
|
||||||
0 );
|
0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1755,7 +1754,7 @@ sub setAutoAstroModeEveningHorizon {
|
|||||||
sub getAutoAstroModeEveningHorizon {
|
sub getAutoAstroModeEveningHorizon {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEveningHorizon',
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEveningHorizon',
|
||||||
0 );
|
0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1771,7 +1770,7 @@ sub setUp {
|
|||||||
sub getUp {
|
sub getUp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Up', 'astro' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Up', 'astro' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setDown {
|
sub setDown {
|
||||||
@ -1786,14 +1785,15 @@ sub setDown {
|
|||||||
sub getDown {
|
sub getDown {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Down', 'astro' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Down', 'astro' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setShadingBetweenTheTime {
|
sub setShadingBetweenTheTime {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $attrVal = shift;
|
my $attrVal = shift;
|
||||||
|
|
||||||
_setAttributs( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime', $attrVal );
|
_setAttributs( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime',
|
||||||
|
$attrVal );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1801,7 +1801,8 @@ sub setShadingBetweenTheTime {
|
|||||||
sub getShadingBetweenTheTime {
|
sub getShadingBetweenTheTime {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime', '00:00-24:00' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime',
|
||||||
|
'00:00-24:00' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setTimeUpEarly {
|
sub setTimeUpEarly {
|
||||||
@ -1816,7 +1817,7 @@ sub setTimeUpEarly {
|
|||||||
sub getTimeUpEarly {
|
sub getTimeUpEarly {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_Early', '05:00' );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_Early', '05:00' );
|
||||||
|
|
||||||
if ( defined( PerlCodeCheck($val) ) ) {
|
if ( defined( PerlCodeCheck($val) ) ) {
|
||||||
$val = PerlCodeCheck($val);
|
$val = PerlCodeCheck($val);
|
||||||
@ -1841,7 +1842,7 @@ sub setTimeUpLate {
|
|||||||
sub getTimeUpLate {
|
sub getTimeUpLate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_Late', '08:30' );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_Late', '08:30' );
|
||||||
|
|
||||||
if ( defined( PerlCodeCheck($val) ) ) {
|
if ( defined( PerlCodeCheck($val) ) ) {
|
||||||
$val = PerlCodeCheck($val);
|
$val = PerlCodeCheck($val);
|
||||||
@ -1866,7 +1867,7 @@ sub setTimeDownEarly {
|
|||||||
sub getTimeDownEarly {
|
sub getTimeDownEarly {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Time_Down_Early', '16:00' );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Time_Down_Early', '16:00' );
|
||||||
|
|
||||||
if ( defined( PerlCodeCheck($val) ) ) {
|
if ( defined( PerlCodeCheck($val) ) ) {
|
||||||
$val = PerlCodeCheck($val);
|
$val = PerlCodeCheck($val);
|
||||||
@ -1891,7 +1892,7 @@ sub setTimeDownLate {
|
|||||||
sub getTimeDownLate {
|
sub getTimeDownLate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val = AttrVal( $self->{shuttersDev}, 'ASC_Time_Down_Late', '22:00' );
|
my $val = ::AttrVal( $self->{shuttersDev}, 'ASC_Time_Down_Late', '22:00' );
|
||||||
|
|
||||||
if ( defined( PerlCodeCheck($val) ) ) {
|
if ( defined( PerlCodeCheck($val) ) ) {
|
||||||
$val = PerlCodeCheck($val);
|
$val = PerlCodeCheck($val);
|
||||||
@ -1917,7 +1918,7 @@ sub getTimeUpWeHoliday {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $val =
|
my $val =
|
||||||
AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_WE_Holiday', '01:25' );
|
::AttrVal( $self->{shuttersDev}, 'ASC_Time_Up_WE_Holiday', '01:25' );
|
||||||
|
|
||||||
if ( defined( PerlCodeCheck($val) ) ) {
|
if ( defined( PerlCodeCheck($val) ) ) {
|
||||||
$val = PerlCodeCheck($val);
|
$val = PerlCodeCheck($val);
|
||||||
@ -1939,7 +1940,7 @@ sub getBrightnessMinVal {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1958,7 +1959,7 @@ sub getBrightnessMaxVal {
|
|||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME}
|
->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
|
||||||
->{LASTGETTIME} ) < 2
|
->{LASTGETTIME} ) < 2
|
||||||
);
|
);
|
||||||
@ -1980,7 +1981,7 @@ sub setDriveUpMaxDuration {
|
|||||||
sub getDriveUpMaxDuration {
|
sub getDriveUpMaxDuration {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_DriveUpMaxDuration', 60 );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_DriveUpMaxDuration', 60 );
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -44,21 +44,10 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
ReadingsVal
|
|
||||||
ReadingsNum)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub getBrightness {
|
sub getBrightness {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsNum(
|
return ::ReadingsNum(
|
||||||
$FHEM::Automation::ShuttersControl::shutters->_getBrightnessSensor,
|
$FHEM::Automation::ShuttersControl::shutters->_getBrightnessSensor,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getBrightnessReading,
|
$FHEM::Automation::ShuttersControl::shutters->getBrightnessReading,
|
||||||
-1 );
|
-1 );
|
||||||
@ -67,7 +56,7 @@ sub getBrightness {
|
|||||||
sub getWindStatus {
|
sub getWindStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsVal(
|
return ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor,
|
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor,
|
||||||
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading, -1 );
|
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading, -1 );
|
||||||
}
|
}
|
||||||
@ -75,7 +64,7 @@ sub getWindStatus {
|
|||||||
sub getStatus {
|
sub getStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsNum( $self->{shuttersDev},
|
return ::ReadingsNum( $self->{shuttersDev},
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getPosCmd, 0 );
|
$FHEM::Automation::ShuttersControl::shutters->getPosCmd, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +77,7 @@ sub getDelayCmd {
|
|||||||
sub getASCenable {
|
sub getASCenable {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsVal( $self->{shuttersDev}, 'ASC_Enable', 'on' );
|
return ::ReadingsVal( $self->{shuttersDev}, 'ASC_Enable', 'on' );
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -47,7 +47,7 @@ use utf8;
|
|||||||
use FHEM::Automation::ShuttersControl::Window::Attr;
|
use FHEM::Automation::ShuttersControl::Window::Attr;
|
||||||
use FHEM::Automation::ShuttersControl::Window::Readings;
|
use FHEM::Automation::ShuttersControl::Window::Readings;
|
||||||
|
|
||||||
our @ISA =
|
use base
|
||||||
qw(FHEM::Automation::ShuttersControl::Window::Attr FHEM::Automation::ShuttersControl::Window::Readings);
|
qw(FHEM::Automation::ShuttersControl::Window::Attr FHEM::Automation::ShuttersControl::Window::Readings);
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -44,17 +44,6 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
AttrVal
|
|
||||||
gettimeofday)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub setSubTyp {
|
sub setSubTyp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $attrVal = shift;
|
my $attrVal = shift;
|
||||||
@ -67,7 +56,8 @@ sub setSubTyp {
|
|||||||
sub getSubTyp {
|
sub getSubTyp {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_subType', 'twostate' );
|
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_subType',
|
||||||
|
'twostate' );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub setWinDev {
|
sub setWinDev {
|
||||||
@ -87,15 +77,15 @@ sub _getWinDev {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
|
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} =
|
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} =
|
||||||
int( gettimeofday() );
|
int( ::gettimeofday() );
|
||||||
my ( $device, $reading ) =
|
my ( $device, $reading ) =
|
||||||
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
|
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
|
||||||
'ASC_WindowRec', 'none' );
|
$self->{shuttersDev}, 'ASC_WindowRec', 'none' );
|
||||||
|
|
||||||
### erwartetes Ergebnis
|
### erwartetes Ergebnis
|
||||||
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE
|
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE
|
||||||
@ -116,7 +106,7 @@ sub getWinDevReading {
|
|||||||
exists(
|
exists(
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
|
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
|
||||||
)
|
)
|
||||||
&& ( gettimeofday() -
|
&& ( ::gettimeofday() -
|
||||||
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
|
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Developed with Kate
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2018-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
|
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -44,20 +44,10 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use GPUtils qw(GP_Import);
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
|
||||||
BEGIN {
|
|
||||||
GP_Import(
|
|
||||||
qw(
|
|
||||||
ReadingsVal)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub getWinStatus {
|
sub getWinStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
return ReadingsVal(
|
return ::ReadingsVal(
|
||||||
$FHEM::Automation::ShuttersControl::shutters->_getWinDev,
|
$FHEM::Automation::ShuttersControl::shutters->_getWinDev,
|
||||||
$FHEM::Automation::ShuttersControl::shutters->getWinDevReading,
|
$FHEM::Automation::ShuttersControl::shutters->getWinDevReading,
|
||||||
'closed' );
|
'closed' );
|
||||||
|
Reference in New Issue
Block a user