Compare commits

...

146 Commits

Author SHA1 Message Date
52930d9a07 Merge pull request 'patch-remove-eperimental' (#127) from patch-remove-eperimental into dev
Reviewed-on: #127
2024-10-12 05:59:27 +00:00
e1592b8b7d docs: Changelog 2024-10-12 07:40:57 +02:00
7eb1079458 fix: remove experimental features
change copyright
2024-10-12 07:40:39 +02:00
ceecbb063a Merge pull request 'testing' (#123) from testing into main
Reviewed-on: #123
2023-01-03 07:50:14 +01:00
49b0ff17fa Merge pull request 'dev' (#122) from dev into testing
Reviewed-on: #122
2023-01-03 07:48:55 +01:00
ae5057fbc5 Merge pull request 'patch-adv' (#121) from patch-adv into dev
Reviewed-on: #121
2022-12-20 14:20:57 +01:00
9cd0d364b4 change Copyright text
new year range
2022-12-20 14:17:08 +01:00
f216e1b308 Merge branch 'dev' of git.cooltux.net:FHEM/mod-AutoShuttersControl into dev 2022-12-20 13:56:59 +01:00
6f137256e0 Merge pull request 'fix selfdefense' (#120) from patch-selfdefense into dev
Reviewed-on: #120
2022-12-20 13:55:47 +01:00
cc5ef41e21 fix selfdefense
change selfdefense condition in SunRiseShuttersAfterTimerFn
2022-12-15 09:56:26 +01:00
587d4e4316 Merge branch 'dev' of https://github.com/fhem/AutoShuttersControl into dev 2022-11-17 10:13:20 +01:00
Marko Oldenburg
f517b72f23
Merge pull request #97 from riedel2/patch-1
Update 73_AutoShuttersControl.pm
2022-11-05 23:18:48 +01:00
riedel2
ad5cbaac12
Update 73_AutoShuttersControl.pm
HORIZON option not yet added to german help
2022-11-05 21:52:39 +01:00
8da3b13bcc Merge pull request 'testing' (#119) from testing into main
Reviewed-on: #119
2022-08-30 18:20:26 +02:00
c09edf5496 Merge pull request 'dev' (#118) from dev into testing
Reviewed-on: #118
2022-08-30 18:20:03 +02:00
cd1c2c104a Merge pull request 'closes: #116' (#117) from patch-cant_locate_object_method into dev
Reviewed-on: #117
2022-08-30 18:13:21 +02:00
51256c1ed9 closes: #116
[Ticket: #116]
2022-08-30 18:12:01 +02:00
c0a7bfa6df Merge pull request 'patch-CommandRef' (#115) from patch-CommandRef into dev
Reviewed-on: #115
2022-08-29 13:31:17 +02:00
403936fe73 fix CommandRef ASC_Up and ASC_Down entry 2022-08-29 13:30:37 +02:00
5095c65d80 Merge pull request 'main' (#113) from main into testing
Reviewed-on: #113
2022-08-29 10:17:58 +02:00
0bd8d6273f Merge pull request 'dev' (#112) from dev into main
Reviewed-on: #112
2022-08-29 10:09:12 +02:00
c3b61def25 Merge pull request 'fix is in external trigger and shading is aktive' (#111) from patch-externalTriggerAndShading into dev
Reviewed-on: #111
2022-08-29 10:08:01 +02:00
9c096902e8 Merge branch 'dev' into patch-externalTriggerAndShading 2022-08-29 10:07:37 +02:00
6dfc92c35e Merge pull request 'fix little typo in ASC_WindParameter' (#110) from patch-Commandref into dev
Reviewed-on: #110
2022-08-29 10:00:58 +02:00
9994af6ca2 fix is in external trigger and shading is aktive
[Ticket: X]
2022-08-29 10:00:01 +02:00
eb85a74a07 fix little typo in ASC_WindParameter
[Ticket: no]
2022-08-29 09:43:06 +02:00
358c760b45 Merge pull request 'Change WindUnprotectionFn if ShuttersPlace awning' (#109) from patch-windIsDay into dev
Reviewed-on: #109
2022-08-29 09:27:13 +02:00
34a6a88401 Change WindUnprotectionFn if ShuttersPlace awning
[Ticket: X]
2022-08-29 09:25:34 +02:00
bb80fb5d3a Merge pull request 'fix ASC_Shading_BetweenTheTime Commandref entry' (#108) from patch-IsInTimeFn into dev
Reviewed-on: #108
2022-08-29 09:08:34 +02:00
2907e19d3b fix ASC_Shading_BetweenTheTime Commandref entry
[Ticket: no]
2022-08-29 08:45:51 +02:00
ae86468077 Merge pull request 'dev' (#107) from dev into main
Reviewed-on: #107
2022-08-29 07:45:43 +02:00
7cba141447 Merge pull request 'patch-regen' (#106) from patch-regen into dev
Reviewed-on: #106
2022-08-29 07:42:17 +02:00
f67d56e1cc expane rain and wind protection control
add condition for wind and rain protection

[Ticket: none]
2022-06-20 15:56:47 +02:00
527d72dd57 code review rain unprotection drive 2022-04-19 12:32:19 +02:00
459b8508ec Merge pull request 'dev' (#105) from dev into main
Reviewed-on: #105
2022-04-07 21:29:10 +02:00
ac87015478 Merge pull request 'patch-shading_markise_IsDay' (#104) from patch-shading_markise_IsDay into dev
Reviewed-on: #104
2022-04-07 21:27:00 +02:00
26105fa434 more Log out with information 2022-04-07 21:25:03 +02:00
15be0a6885 observed ShuttersPlace awning for shading condition
[Ticket: no]
2022-03-24 09:54:55 +01:00
cca6e90303 Merge pull request 'dev' (#102) from dev into main
Reviewed-on: #102
2022-03-04 07:03:43 +01:00
de5d6cbc6a Merge pull request 'patch-informationTable' (#101) from patch-informationTable into dev
Reviewed-on: #101
2022-03-04 07:03:20 +01:00
Marko Oldenburg
4925e654ec change ShuttersInformation fn
add table frame and whitespace-character to ShuttersInformation

[Ticket: no]
2022-03-04 07:01:54 +01:00
97caf64308 Merge pull request 'dev' (#100) from dev into main
Reviewed-on: #100
2022-03-02 16:49:31 +01:00
6bf2b17d6f Merge pull request 'patch-codeRewrite' (#99) from patch-codeRewrite into dev
Reviewed-on: #99
2022-03-02 16:48:54 +01:00
Marko Oldenburg
fb27bedf48 fix bug if comfotPos 0
if Comfort_Pos 0 and window is open then shutter is no drive

[Ticket: no]
2022-03-02 16:47:56 +01:00
f52187ad35 Merge pull request 'testing' (#98) from testing into main
Reviewed-on: #98
2022-01-15 15:46:42 +01:00
103697184e Merge pull request 'dev' (#97) from dev into testing
Reviewed-on: #97
2022-01-15 15:46:13 +01:00
c9894453bb Merge pull request 'patch-wrongReadingsNameFromSetter' (#96) from patch-wrongReadingsNameFromSetter into dev
Reviewed-on: #96
2022-01-15 15:42:33 +01:00
14eee0e6dd fix setter readings Bug 2022-01-15 15:39:29 +01:00
9545dda125 Merge pull request 'testing' (#94) from testing into main
Reviewed-on: #94
2022-01-14 08:48:29 +01:00
3135a27c63 Merge pull request 'dev' (#93) from dev into testing
Reviewed-on: #93
2022-01-10 11:10:09 +01:00
13689963f1 Merge pull request 'patch-codeRewrite' (#92) from patch-codeRewrite into dev
Reviewed-on: #92
2022-01-10 11:09:39 +01:00
d8881ff6d1 change default value for ASC_advEndDate 2022-01-10 11:07:42 +01:00
12f48e98b5 fix condition 2022-01-10 11:04:43 +01:00
a1d19a797d fix error in adv condition 2022-01-10 11:01:07 +01:00
f1f265b89a add end of advent season variable
change attribut ASC_advDate to ASC_advStartDate
2022-01-10 10:43:51 +01:00
ca99e2bd0c Merge pull request 'dev' (#91) from dev into testing
Reviewed-on: #91
2022-01-02 08:52:18 +01:00
29e3a1a8d7 Merge pull request 'patch-codeRewrite' (#90) from patch-codeRewrite into dev
Reviewed-on: #90
2022-01-02 08:51:45 +01:00
e02395a82f no critic for perlcritic parser 2022-01-02 08:49:58 +01:00
663ce748e2 bugfix 2022-01-02 08:31:38 +01:00
d35dda835a coderewrite 2022-01-02 08:26:14 +01:00
47be49617d Merge pull request 'dev' (#89) from dev into testing
Reviewed-on: #89
2022-01-02 07:56:13 +01:00
0dc0a9c6e4 Merge pull request 'patch-codeRewrite' (#88) from patch-codeRewrite into dev
Reviewed-on: #88
2022-01-02 07:55:49 +01:00
79d369b9f5 little bugfix 2022-01-02 07:55:00 +01:00
8109cd7ebe change condition syntax of SetFn 2022-01-02 07:49:03 +01:00
842e41e3dc export object variable 2022-01-02 07:13:04 +01:00
35a4f60a53 chnage require@ISA to use base 2022-01-02 06:42:49 +01:00
ef650b2d4b Merge pull request 'testing' (#87) from testing into dev
Reviewed-on: #87
2022-01-01 20:25:58 +01:00
bf773ca2d7 Merge pull request 'bugfix' (#86) from patch-fix into testing
Reviewed-on: #86
2022-01-01 20:22:17 +01:00
ae88630277 bugfix 2022-01-01 20:21:26 +01:00
f811cfd87f Merge pull request 'dev' (#85) from dev into testing
Reviewed-on: #85
2022-01-01 09:46:43 +01:00
1a71c63652 Merge pull request 'change version' (#84) from patch-newVersion into dev
Reviewed-on: #84
2022-01-01 09:41:47 +01:00
7d3d11d1e2 change version 2022-01-01 09:39:28 +01:00
1eeeb85eaf Merge pull request 'patch_issues73-DriveUpDriveDownRoommate' (#83) from patch_issues73-DriveUpDriveDownRoommate into dev
Reviewed-on: #83
2022-01-01 09:29:52 +01:00
Marko Oldenburg
397f949a21 fix FHEM::Automation::ShuttersControl::Helper::GetAttrValues 2022-01-01 09:22:19 +01:00
Marko Oldenburg
4ea1db3aa0 fix bareword sunsettime 2022-01-01 09:08:49 +01:00
Marko Oldenburg
004a15ea42 fix error wrong hash sunrisetime bareword 2022-01-01 09:04:09 +01:00
Marko Oldenburg
9a1b6acad3 change modul header 2022-01-01 08:55:31 +01:00
4aa24587a5 Merge branch 'dev' into patch_issues73-DriveUpDriveDownRoommate 2021-12-11 14:24:14 +01:00
c76280639f Merge pull request 'patch_issues75-ShadingOutBreaksExternalTrigger' (#80) from patch_issues75-ShadingOutBreaksExternalTrigger into dev
Reviewed-on: #80
2021-12-09 10:30:43 +01:00
a3c023711c Merge branch 'dev' into patch_issues75-ShadingOutBreaksExternalTrigger 2021-12-09 10:29:22 +01:00
c6e88f2d45 Merge pull request 'patch_issues67-Lockout_and_BlockingManualTime' (#79) from patch_issues67-Lockout_and_BlockingManualTime into dev
Reviewed-on: #79
2021-12-09 10:20:43 +01:00
f0f5cbde4b fix syntax error 2021-12-08 11:45:22 +01:00
5928276b74 fix little bug is shutter position above the window tilted position
and shutters place is terrace and sybType is twoState and event is
window open
2021-12-08 11:35:55 +01:00
32a3ac9d13 change condition for BlockingAfterManualDrive in WendowRec Section 2021-12-08 11:14:46 +01:00
ef590e002e change logical in condition 2021-12-05 11:01:19 +01:00
427018ab46 bugfix 2021-12-05 07:44:51 +01:00
89431a2af3 change hardBlock action if shutters pos close 2021-12-04 20:48:53 +01:00
39c7ec3dc5 Merge branch 'devel' into patch_issues75-ShadingOutBreaksExternalTrigger 2021-12-04 10:57:50 +01:00
37044b2316 Merge branch 'devel' into patch_issues73-DriveUpDriveDownRoommate 2021-12-04 10:57:06 +01:00
a44fffe94e Merge branch 'devel' into patch_issues67-Lockout_and_BlockingManualTime 2021-12-04 10:56:05 +01:00
870f2be5d8 Merge pull request 'fix: #77' (#78) from patch_issues77-DriveDownResidentsHomeButAutoControlOFF into devel
Reviewed-on: #78
2021-12-04 10:53:12 +01:00
36669f1405 fix: #77 2021-12-04 10:50:29 +01:00
a61458cfc2 fix logical issues 2021-12-04 10:22:22 +01:00
8c17eb5f6a change condition of Window events if the place is terrace 2021-12-04 09:55:46 +01:00
d87ddb146c all shading functions are disabled when external trigger active 2021-12-04 09:28:38 +01:00
58b2f20f19 fix condition 2021-12-04 09:07:31 +01:00
301fd32048 change condition for GetUp roommate. no shutters drive if you have been on absent or gone 2021-12-04 08:36:56 +01:00
0255be94b5 Merge pull request 'patch-commandrefChangeToId' (#74) from patch-commandrefChangeToId into devel
Reviewed-on: #74
2021-11-29 15:26:57 +01:00
4773fd0ea0 add commandref change of Beta_User 2021-11-29 15:20:33 +01:00
1ce3805427 Merge branch 'devel' of git.cooltux.net:FHEM/mod-AutoShuttersControl into devel 2021-11-25 08:26:44 +01:00
5f00d33fa9 Merge pull request 'devel' (#72) from jochenluedering/mod-AutoShuttersControl:devel into devel
Reviewed-on: #72
2021-11-22 22:38:45 +01:00
Jochen Luedering
da79e25929 rain un-protect: keep awning open at night 2021-11-22 22:20:05 +01:00
jochenluedering
0b22ac9e12 Merge pull request 'devel' (#1) from FHEM/mod-AutoShuttersControl:devel into devel
Reviewed-on: jochenluedering/mod-AutoShuttersControl#1
2021-11-22 22:08:16 +01:00
e6a01cdb18 Merge pull request 'merge from testing' (#71) from testing into master
Reviewed-on: #71
2021-11-14 14:00:43 +01:00
fb44ff9f1a Merge pull request 'merge from devel' (#70) from devel into testing
Reviewed-on: #70
2021-11-14 13:54:53 +01:00
9663b2dd43 Merge pull request 'closed: #68' (#69) from fix-Umlaute-uninitialized-value into devel
Reviewed-on: #69
2021-11-14 13:49:04 +01:00
d6cb059eaf closed: #68
fix bug PERL WARNING: Use of uninitialized value within %charHash in
substitution iterator at lib/FHEM/Automation/ShuttersControl/Helper.pm
line 1021 is FHEM startup.
2021-11-14 13:44:35 +01:00
6774e3a918 Merge pull request 'testing' (#64) from testing into master
Reviewed-on: #64
2021-10-27 10:01:55 +02:00
e28fad13d7 Merge pull request 'devel' (#63) from devel into testing
Reviewed-on: #63
2021-10-27 10:01:35 +02:00
1c1ac77851 Merge pull request 'patch-commandref' (#62) from patch-commandref into devel
Reviewed-on: #62
2021-10-27 10:01:13 +02:00
1ac38a7216 fix commandref 2021-10-27 09:59:53 +02:00
8d6044c404 Merge pull request 'testing' (#61) from testing into master
Reviewed-on: #61
2021-10-27 09:46:54 +02:00
fcce22b102 Merge pull request 'devel' (#60) from devel into testing
Reviewed-on: #60
2021-10-27 09:46:23 +02:00
4b5b03a8fc Merge pull request 'patch-renameConntrolTemplateVariables' (#59) from patch-renameConntrolTemplateVariables into devel
Reviewed-on: #59
2021-10-27 09:45:51 +02:00
f412e88325 change names of CommandTemplate variables, change commadref for
CommandTemplate
2021-10-27 09:43:16 +02:00
0dca852ad0 Merge pull request 'merge testing to master' (#58) from testing into master
Reviewed-on: #58
2021-10-27 08:49:21 +02:00
8ea4101747 Merge pull request 'merge from devel to testing' (#57) from devel into testing
Reviewed-on: #57
2021-10-27 08:43:44 +02:00
b9a7328661 Merge pull request 'closed: #53 Patch beliebigen Fahrbefehl zulassen' (#54) from patch-implementationCommandTemplate into devel
Reviewed-on: #54
2021-10-27 08:37:27 +02:00
f03a7d690f Merge branch 'devel' into patch-implementationCommandTemplate 2021-10-26 20:20:15 +02:00
5ccceaba16 add example with owner perlfunction for ASC_CommandTemplate 2021-10-26 19:42:19 +02:00
54450962ac Merge pull request 'closed: #55 fix ASC_BlockingTime_beforNightClose wird bei Regen(-schutz) ignoriert' (#56) from patch-rainprotection_blockingtime into devel
Reviewed-on: #56
2021-10-26 19:31:28 +02:00
9409c60400 change ASC_BlockingTime_beforNightClose and
ASC_BlockingTime_beforDayOpen Attributs
2021-10-26 19:29:29 +02:00
75f5b6bf01 add drive reason to CommandTemplte varibales 2021-10-26 14:05:06 +02:00
98edf0c5f6 change commandref 2021-10-25 19:54:51 +02:00
a9a47f9e70 fix ASC_BlockingTime_beforNightClose wird bei Regen(-schutz) ignoriert 2021-10-25 19:25:13 +02:00
f2b7e8490f fix Can't locate object method "getCommandTemplte" 2021-10-25 18:43:30 +02:00
3d7f9fcf92 add commandref enrty for ASC_CommandTemplate Attribut 2021-10-25 18:24:17 +02:00
e037a12879 change version 2021-10-25 17:58:08 +02:00
096e4ab815 Patch beliebigen Fahrbefehl zulassen #53 2021-10-25 17:51:37 +02:00
feba24bf99 Merge pull request 'closed: #40 Terrasse schließen Prüfung auf externe Trigger zum nachholen der Fahrt' (#52) from patch-ExternalTrigger_TerraceClose into devel
Reviewed-on: #52
2021-10-25 10:04:47 +02:00
e5a6bbdbe5 Terrasse schließen Prüfung auf externe Trigger zum nachholen der Fahrt 2021-10-25 10:02:29 +02:00
a66daa7d5a Merge pull request 'close: #50 expand regex to detect position event with dot's' (#51) from patch-driveDetection into devel
Reviewed-on: #51
2021-10-24 18:33:45 +02:00
617b7a7531 expand regex to detect position event with dot's 2021-10-24 17:16:11 +02:00
f498829347 fix set rainstate by night 2021-10-23 10:08:37 +02:00
4cc3ecc40a Merge branch 'patch-shadingOut_externalTrigger' into devel 2021-10-21 09:33:11 +02:00
95446cc91e change code for ExternlTriggerStatus. 2021-10-09 08:10:09 +02:00
63393b4cd4 add EG_window to ShuttersPlace and expand ProcessingResidents Fn for
close Shutter by open window then gone
2021-10-09 07:53:53 +02:00
6a62226a39 Merge branch 'testing' 2021-10-09 07:12:54 +02:00
cbd058773d Merge branch 'devel' into testing 2021-10-09 07:12:37 +02:00
649d21f19b Merge branch 'devel' into testing 2021-10-08 11:44:44 +02:00
62a4a249b4 Merge pull request 'devel' (#48) from devel into testing
Reviewed-on: #48
2021-10-08 10:02:12 +02:00
a2c878e333 Merge branch 'devel' into testing 2021-10-01 08:09:29 +02:00
4c1d6c7885 Merge branch 'devel' into testing 2021-09-14 09:51:23 +02:00
6babb451c9 Merge branch 'devel' into testing 2021-09-14 09:20:52 +02:00
bd6e901ca1 Merge pull request 'testing' (#39) from testing into master
Reviewed-on: #39
2021-06-02 11:53:51 +02:00
f36101f48a Merge pull request 'devel' (#38) from devel into testing
Reviewed-on: #38
2021-05-27 09:03:30 +02:00
20 changed files with 10011 additions and 1384 deletions

8426
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
###############################################################################
#
# Developed with Kate
# Developed with VSCodium and richterger perl plugin
#
# (c) 2018-2021 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# All rights reserved
#
# Special thanks goes to:
@ -49,26 +49,17 @@ use utf8;
use FHEM::Meta;
use FHEM::Automation::ShuttersControl;
use GPUtils qw(GP_Import GP_Export);
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
#-- Run before package compilation
BEGIN {
# Import from main context
GP_Import(
qw(
readingFnAttributes
)
);
#-- Export to main context with different name
GP_Export(
qw(
Initialize
)
);
GP_Import(qw(readingFnAttributes));
}
sub ::AutoShuttersControl_Initialize { goto &Initialize }
sub Initialize {
my $hash = shift;
@ -100,7 +91,8 @@ sub Initialize {
. 'ASC_expert:1 '
. 'ASC_blockAscDrivesAfterManual:0,1 '
. 'ASC_debug:1 '
. 'ASC_advDate:DeadSunday,FirstAdvent '
. 'ASC_advStartDate:DeadSunday,FirstAdvent '
. 'ASC_advEndDate:CandlemasDay,EpiphanyDay '
. $readingFnAttributes;
$hash->{NotifyOrderPrefix} = '51-'; # Order Nummer für NotifyFn
$hash->{FW_detailFn} =
@ -328,8 +320,11 @@ __END__
<li><strong>ASC_freezeTemp</strong> - Temperature threshold for the freeze protection. The freeze protection
prevents the shutter to be operated by <abbr>ASC</abbr>. Last operating order will be kept.
</li>
<a id="AutoShuttersControl-attr-ASC_advDate"></a>
<li><strong>ASC_advDate</strong> - Advent Season, selected FirstAdvent or DeadSunday.
<a id="AutoShuttersControl-attr-ASC_advStartDate"></a>
<li><strong>ASC_advStartDate</strong> - Begin of Advent Season, selected FirstAdvent or DeadSunday.
</li>
<a id="AutoShuttersControl-attr-ASC_advEndDate"></a>
<li><strong>ASC_advEndDate</strong> - End of Advent Season, selected CandlemasDay 6. January or EpiphanyDay 2. February.
</li>
<a id="AutoShuttersControl-attr-ASC_rainSensor"></a>
<li><strong>ASC_rainSensor DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS]</strong> - Contains
@ -639,6 +634,19 @@ __END__
</li>
<a id="AutoShuttersControl-attr-ASC_SlatPosCmd_SlatDevice"></a>
<li><strong>ASC_SlatPosCmd_SlatDevice</strong> - If your shutter is "venetian blind" type (with turnable slats, lamellas or similar), this is the place to set additional command and/or device info to control the slat level. Examples: <i>attr ROLLO ASC_SlatPosCmd_SlatDevice slatPct</i> or <i>attr ROLLO ASC_SlatPosCmd_SlatDevice dim:ROLLOSLATDEVICE</i>. Providing a device name for the slat device is only needed in case it's different to the shutter itself. If attribute is set, additional positioning values for the respective slat levels can be set in attributes <i>ASC_Open_Pos</i>, <i>ASC_Closed_Pos</i>, <i>ASC_Ventilate_Pos</i>, <i>ASC_ComfortOpen_Pos</i>, <i>ASC_Shading_Pos</i> and <i>ASC_Sleep_Pos</i>.</li>
<a id="AutoShuttersControl-attr-ASC_CommandTemplate"></a>
<li><strong>ASC_CommandTemplate</strong> - <strong>FHEM or Perl command</strong> (Perl in braces as usual needs escaping semicolons etc.).<br>
This optional attribute will override the internally determined command to drive this shutter. Setting it, is only recommended in <strong>some rare and special cases,</strong>, in most cases there's <strong>no need</strong> to set this attribute!
The parameters <i>$name</i> (name of the shutter device), <i>$pos</i> (target position for the respective drive command), <i>$slatPos</i> (target position for the (turnable) lammellas in venetion blinds) and <i>$cause</i> (internal label for the cause of the driving command) will be replaced by the appropirate values. You may have to take care to avoid unneeded driving commands.
Examples:
<ul>
<li><i>attr ROLLO ASC_CommandTemplate set $name $pos</i> - Address the position command directly to the main switch of the device</li>
<li><i>attr ROLLO ASC_CommandTemplate set $name pct $pos</i> - Address the setter <i>pct</i> for positioning commands</li>
<li><i>attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatPos 4.LEVEL $pos</i> - combined positioning command, e.g. appropriate for HM-IP-venetian blind type actors</li>
<li><i>attr ROLLO ASC_CommandTemplate { fhem("set $name ".($pos+1024)).";set $name 0")}</i> - positioning command with Perl calculation and additional "execute" command, e.g. for an SPS type blind</li>
<li><i>attr ROLLO ASC_CommandTemplate { myPerlFn("$name",$pos,$slatPos,"$cause")}</i> - call own Perl function (e.g. from 99_myUtils.pm)</li>
</ul>
</li>
<a id="AutoShuttersControl-attr-ASC_WindowRec_PosAfterDayClosed"></a>
<li><strong>ASC_WindowRec_PosAfterDayClosed</strong> - open,lastManual / auf welche Position soll das Rollo nach dem schlie&szlig;en am Tag fahren. Open Position oder letzte gespeicherte manuelle Position (default: open)</li>
<blockquote>
@ -699,7 +707,7 @@ __END__
are used for shading. Defaults to 120.
</li>
<a id="AutoShuttersControl-attr-ASC_Shading_BetweenTheTime"></a>
<li><strong>ASC_Shading_BetweenTheTime</strong> - Limit the time slots for shading functionality. Example: 9:00-13:00 11:25-15:30</li>
<li><strong>ASC_Shading_BetweenTheTime</strong> - Limit the time slots for shading functionality. Example: 09:00-13:00 11:25-15:30</li>
</ul>
</blockquote>
</ul>
@ -993,8 +1001,10 @@ __END__
<li><strong>ASC_expert</strong> - ist der Wert 1, so werden erweiterte Informationen bez&uuml;glich des NotifyDevs unter set und get angezeigt</li>
<a id="AutoShuttersControl-attr-ASC_freezeTemp"></a>
<li><strong>ASC_freezeTemp</strong> - Temperatur, ab welcher der Frostschutz greifen soll und der Rollladen nicht mehr f&auml;hrt. Der letzte Fahrbefehl wird gespeichert.</li>
<a id="AutoShuttersControl-attr-ASC_advDate"></a>
<li><strong>ASC_advDate</strong> - Adventszeit, Auswahl ab wann die Adventszeit beginnen soll.</li>
<a id="AutoShuttersControl-attr-ASC_advStartDate"></a>
<li><strong>ASC_advStartDate</strong> - Start der Adventszeit, Auswahl ab wann die Adventszeit beginnen soll. 1. Advent oder Totensonntag</li>
<a id="AutoShuttersControl-attr-ASC_advEndDate"></a>
<li><strong>ASC_advEndDate</strong> - Ende der Adventszeit, Auswahl ab wann die Adventszeit Enden soll. EpiphanyDay 6. Januar oder CandlemasDay 2. Februar</li>
<a id="AutoShuttersControl-attr-ASC_rainSensor"></a>
<li><strong>ASC_rainSensor - DEVICENAME[:READINGNAME] MAXTRIGGER[:HYSTERESE] [CLOSEDPOS:[WAITINGTIME]]</strong> - der Inhalt ist eine Kombination aus Devicename, Readingname, Wert ab dem getriggert werden soll, Hysterese Wert ab dem der Status Regenschutz aufgehoben werden soll und der "wegen Regen geschlossen Position", sowie der Wartezeit bis dann tats&auml;chlich die aktion ausgeführt wird.</li>
<a id="AutoShuttersControl-attr-ASC_residentsDev"></a>
@ -1019,11 +1029,11 @@ __END__
<a id="AutoShuttersControl-attr-ASC_Antifreeze_Pos"></a>
<li><strong>ASC_Antifreeze_Pos</strong> - Position die angefahren werden soll, wenn der Fahrbefehl komplett schlie&szlig;en lautet, aber der Frostschutz aktiv ist (Default: ist abh&auml;ngig vom Attribut<em>ASC</em> 85/15) !!!Verwendung von Perlcode ist m&ouml;glich, dieser muss in {} eingeschlossen sein. R&uuml;ckgabewert muss eine positive Zahl/Dezimalzahl sein!!!</li>
<a id="AutoShuttersControl-attr-ASC_AutoAstroModeEvening"></a>
<li><strong>ASC_AutoAstroModeEvening</strong> - aktuell REAL,CIVIL,NAUTIC,ASTRONOMIC (default: none)</li>
<li><strong>ASC_AutoAstroModeEvening</strong> - aktuell REAL,CIVIL,NAUTIC,ASTRONOMIC oder HORIZON (default: none)</li>
<a id="AutoShuttersControl-attr-ASC_AutoAstroModeEveningHorizon"></a>
<li><strong>ASC_AutoAstroModeEveningHorizon</strong> - H&ouml;he &uuml;ber Horizont, wenn beim Attribut ASC_autoAstroModeEvening HORIZON ausgew&auml;hlt (default: none)</li>
<a id="AutoShuttersControl-attr-ASC_AutoAstroModeMorning"></a>
<li><strong>ASC_AutoAstroModeMorning</strong> - aktuell REAL,CIVIL,NAUTIC,ASTRONOMIC (default: none)</li>
<li><strong>ASC_AutoAstroModeMorning</strong> - aktuell REAL,CIVIL,NAUTIC,ASTRONOMIC oder HORIZON (default: none)</li>
<a id="AutoShuttersControl-attr-ASC_AutoAstroModeMorningHorizon"></a>
<li><strong>ASC_AutoAstroModeMorningHorizon</strong> - H&ouml;he &uuml;ber Horizont,a wenn beim Attribut ASC_autoAstroModeMorning HORIZON ausgew&auml;hlt (default: none)</li>
<a id="AutoShuttersControl-attr-ASC_BlockingTime_afterManual"></a>
@ -1035,7 +1045,7 @@ __END__
<a id="AutoShuttersControl-attr-ASC_BrightnessSensor"></a>
<li><strong>ASC_BrightnessSensor - DEVICE[:READING] WERT-MORGENS:WERT-ABENDS</strong> / 'Sensorname[:brightness [400:800]]' Angaben zum Helligkeitssensor mit (Readingname, optional) f&uuml;r die Beschattung und dem Fahren der Rollladen nach brightness und den optionalen Brightnesswerten f&uuml;r Sonnenauf- und Sonnenuntergang. (default: none)</li>
<a id="AutoShuttersControl-attr-ASC_Down"></a>
<li><strong>ASC_Down - astro/time/brightness</strong> - bei astro wird Sonnenuntergang berechnet, bei time wird der Wert aus ASC_Time_Down_Early als Fahrzeit verwendet und bei brightness muss ASC_Time_Down_Early und ASC_Time_Down_Late korrekt gesetzt werden. Der Timer l&auml;uft dann nach ASC_Time_Down_Late Zeit, es wird aber in der Zeit zwischen ASC_Time_Down_Early und ASC_Time_Down_Late geschaut, ob die als Attribut im Moduldevice hinterlegte ASC_brightnessDriveUpDown der Down Wert erreicht wurde. Wenn ja, wird der Rollladen runter gefahren (default: astro)</li>
<li><strong>ASC_Down - astro/time/brightness/roommate</strong> - bei astro wird Sonnenuntergang berechnet, bei time wird der Wert aus ASC_Time_Down_Early als Fahrzeit verwendet und bei brightness muss ASC_Time_Down_Early und ASC_Time_Down_Late korrekt gesetzt werden. Der Timer l&auml;uft dann nach ASC_Time_Down_Late Zeit, es wird aber in der Zeit zwischen ASC_Time_Down_Early und ASC_Time_Down_Late geschaut, ob die als Attribut im Moduldevice hinterlegte ASC_brightnessDriveUpDown der Down Wert erreicht wurde. Wenn ja, wird der Rollladen runter gefahren (default: astro)</li>
<ul></p>
<strong><u>Beschreibung der besonderen Positionsattribute</u></strong>
<a id="AutoShuttersControl-attr-ASC_Closed_Pos"></a>
@ -1127,7 +1137,7 @@ __END__
<a id="AutoShuttersControl-attr-ASC_Shading_WaitingPeriod"></a>
<li><strong>ASC_Shading_WaitingPeriod</strong> - wie viele Sekunden soll gewartet werden bevor eine weitere Auswertung der Sensordaten f&uuml;r die Beschattung stattfinden soll (default: 1200)</li>
<a id="AutoShuttersControl-attr-ASC_Shading_BetweenTheTime"></a>
<li><strong>ASC_Shading_BetweenTheTime</strong> - das Fahren in die Beschattung erfolgt bei Angabe nur innerhalb des Zeitraumes, Bsp: 9:00-13:00 11:25-15:30</li>
<li><strong>ASC_Shading_BetweenTheTime</strong> - das Fahren in die Beschattung erfolgt bei Angabe nur innerhalb des Zeitraumes, Bsp: 09:00-13:00 11:25-15:30</li>
</ul></p>
<a id="AutoShuttersControl-attr-ASC_ShuttersPlace"></a>
<li><strong>ASC_ShuttersPlace - window/terrace/awning</strong> - Wenn dieses Attribut auf terrace gesetzt ist, das Residence Device in den Status "gone" geht und SelfDefense aktiv ist (ohne das das Reading selfDefense gesetzt sein muss), wird das Rollo geschlossen. awning steht für Markise und wirkt sich auf die Beschattungssteuerung aus. (default: window)</li>
@ -1142,13 +1152,13 @@ __END__
<a id="AutoShuttersControl-attr-ASC_Time_Up_WE_Holiday"></a>
<li><strong>ASC_Time_Up_WE_Holiday</strong> - Sonnenaufgang fr&uuml;hste Zeit zum Hochfahren am Wochenende und/oder Urlaub (holiday2we wird beachtet). (default: 08:00) ACHTUNG!!! in Verbindung mit Brightness f&uuml;r <em>ASC_Up</em> muss die Uhrzeit kleiner sein wie die Uhrzeit aus <em>ASC_Time_Up_Late</em> !!!Verwendung von Perlcode ist möglich, dieser muss in {} eingeschlossen sein. Rückgabewert muss ein Zeitformat in Form HH:MM[:SS] sein!!!</li>
<a id="AutoShuttersControl-attr-ASC_Up"></a>
<li><strong>ASC_Up - astro/time/brightness</strong> - bei astro wird Sonnenaufgang berechnet, bei time wird der Wert aus ASC_Time_Up_Early als Fahrzeit verwendet und bei brightness muss ASC_Time_Up_Early und ASC_Time_Up_Late korrekt gesetzt werden. Der Timer l&auml;uft dann nach ASC_Time_Up_Late Zeit, es wird aber in der Zeit zwischen ASC_Time_Up_Early und ASC_Time_Up_Late geschaut, ob die als Attribut im Moduldevice hinterlegte Down Wert von ASC_brightnessDriveUpDown erreicht wurde. Wenn ja, wird der Rollladen hoch gefahren (default: astro)</li>
<li><strong>ASC_Up - astro/time/brightness/roommate</strong> - bei astro wird Sonnenaufgang berechnet, bei time wird der Wert aus ASC_Time_Up_Early als Fahrzeit verwendet und bei brightness muss ASC_Time_Up_Early und ASC_Time_Up_Late korrekt gesetzt werden. Der Timer l&auml;uft dann nach ASC_Time_Up_Late Zeit, es wird aber in der Zeit zwischen ASC_Time_Up_Early und ASC_Time_Up_Late geschaut, ob die als Attribut im Moduldevice hinterlegte Down Wert von ASC_brightnessDriveUpDown erreicht wurde. Wenn ja, wird der Rollladen hoch gefahren (default: astro)</li>
<a id="AutoShuttersControl-attr-ASC_Ventilate_Window_Open"></a>
<li><strong>ASC_Ventilate_Window_Open</strong> - auf l&uuml;ften, wenn das Fenster gekippt/ge&ouml;ffnet wird und aktuelle Position unterhalb der L&uuml;ften-Position ist (default: on)</li>
<a id="AutoShuttersControl-attr-ASC_WiggleValue"></a>
<li><strong>ASC_WiggleValue</strong> - Wert um welchen sich die Position des Rollladens &auml;ndern soll (default: 5)</li>
<a id="AutoShuttersControl-attr-ASC_WindParameters"></a>
<li><strong>ASC_WindParameters - TRIGGERMAX[:HYSTERESE] [DRIVEPOSITION]</strong> / Angabe von Max Wert ab dem f&uuml;r Wind getriggert werden soll, Hytsrese Wert ab dem der Windschutz aufgehoben werden soll TRIGGERMAX - HYSTERESE / Ist es bei einigen Rolll&auml;den nicht gew&uuml;nscht das gefahren werden soll, so ist der TRIGGERMAX Wert mit -1 an zu geben. (default: '50:20 ClosedPosition')</li>
<li><strong>ASC_WindParameters - TRIGGERMAX[:HYSTERESE] [DRIVEPOSITION]</strong> / ACHTUNG! Wird nur beachtet wenn ASC_WindProtection auf on gesetzt ist. - Angabe von Max Wert ab dem f&uuml;r Wind getriggert werden soll, Hytsrese Wert ab dem der Windschutz aufgehoben werden soll TRIGGERMAX - HYSTERESE / Ist es bei einigen Rolll&auml;den nicht gew&uuml;nscht das gefahren werden soll, so ist der TRIGGERMAX Wert mit -1 an zu geben. (default: '50:20 ASC_Closed_Pos')</li>
<a id="AutoShuttersControl-attr-ASC_WindowRec_PosAfterDayClosed"></a>
<li><strong>ASC_WindowRec_PosAfterDayClosed</strong> - open,lastManual / auf welche Position soll das Rollo nach dem schlie&szlig;en am Tag fahren. Open Position oder letzte gespeicherte manuelle Position (default: open)</li>
<a id="AutoShuttersControl-attr-ASC_WindowRec"></a>
@ -1157,6 +1167,22 @@ __END__
<li><strong>ASC_WindowRec_subType</strong> - Typ des verwendeten Fensterkontaktes: twostate (optisch oder magnetisch) oder threestate (Drehgriffkontakt) (default: twostate)</li>
<a id="AutoShuttersControl-attr-ASC_SlatPosCmd_SlatDevice"></a>
<li><strong>ASC_SlatPosCmd_SlatDevice</strong> - Angaben zu einem Slat (Lamellen) CMD und - sofern diese Lamellen &uuml;ber ein anderes Device gesteuert werden - zum Slat Device. Beispiele: <i>attr ROLLO ASC_SlatPosCmd_SlatDevice slatPct</i> oder <i>attr ROLLO ASC_SlatPosCmd_SlatDevice dim:ROLLOSLATDEVICE</i>. Die Angabe des Devices ist nur erforderlich, wenn zur Steuerung der Lamellen ein anderes Device verwendet wird. Damit das ganze dann auch greift, muss in den 6 Positionsangaben ASC_Open_Pos, ASC_Closed_Pos, ASC_Ventilate_Pos, ASC_ComfortOpen_Pos, ASC_Shading_Pos und ASC_Sleep_Pos ein weiterer Parameter f&uuml;r die Lamellenstellung mit angegeben werden.</li>
<a id="AutoShuttersControl-attr-ASC_CommandTemplate"></a>
<a id="AutoShuttersControl-attr-ASC_CommandTemplate"></a>
<li><strong>ASC_CommandTemplate</strong> - <strong>FHEM-Kommando(s) oder Perl-Anweisung</strong> (in geschweiften Klammern unter Beachtung der üblichen Regeln für das escapen von Semicolons etc.).<br>
Dieses Attribut übersteuert das sonst intern ermittelte Fahrkommando und ist <strong>für seltene und spezielle Fälle</strong> gedacht. In der Regel ist es nicht erforderlich, dieses Attribut zu setzen!<br>
Die Variablen <i>$name</i> (der Name des Rollladen-Devices), <i>$pos</i> (die Zielposition des Fahrbefehls), <i>$slatPos</i> (die Zielposition des Fahrbefehls für eventuelle Lamellen) und <i>$cause</i> (die interne Benennung des Fahranlasses) werden durch die ermittelten Werte ersetzt, es muss selbst dafür gesorgt werden, dass eventuell unnötige Fahrbefehle aussortiert werden.
Beispiele:
<ul>
<li><i>attr ROLLO ASC_CommandTemplate set $name $pos</i> - Positionsbefehl direkt an Gerät
setzen</li>
<li><i>attr ROLLO ASC_CommandTemplate set $name pct $pos</i> - Positionsbefehl auf den setter <i>pct</i> absetzen</li>
<li><i>attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatPos 4.LEVEL $pos</i> - Positionsbefehl und Lamellen-Ansteuerung für HM-IP-Jalousieaktoren</li>
<li><i>attr ROLLO ASC_CommandTemplate { fhem("set $name ".($pos+1024)).";set $name 0")}</i> - Positionsbefehl für eine SPS in Perl umrechnen</li>
<li><i>attr ROLLO ASC_CommandTemplate { myPerlFn("$name",$pos,$slatPos,"$cause")}</i> - eigene Perl-Funktion (z.B. in 99_myUtils.pm) aufrufen</li>
</ul>
<strong>Hinweis: ASC_CommandTemplate</strong> ist für seltene und spezielle Fälle gedacht. In der Regel ist es nicht erforderlich, dieses Attribut zu setzen!
</li>
</ul>
</ul>
</p>
@ -1297,7 +1323,7 @@ __END__
<tr><td>Sunrise</td><td>1=Morgenfahrt wurde durchgef&uuml;hrt, 0=noch keine Morgenfahrt durchgef&uuml;hrt</td></tr>
<tr><td>RoommatesStatus</td><td>aktueller Status der/des Roommate/s f&uuml;r den Rollladen</td></tr>
<tr><td>RoommatesLastStatus</td><td>letzter Status der/des Roommate/s f&uuml;r den Rollladen</td></tr>
<tr><td>ShadingStatus</td><td>Ausgabe des aktuellen Shading Status, in, out, in reserved, out reserved</td></tr>
<tr><td>ShadingStatus</td><td>Ausgabe des aktuellen Shading Status, <EFBFBD><EFBFBD><EFBFBD>in, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>out, in reserved, out reserved</td></tr>
<tr><td>ShadingStatusTimestamp</td><td>Timestamp des letzten Beschattungsstatus</td></tr>
<tr><td>IfInShading</td><td>Befindet sich der Rollladen, in Abh&auml;ngigkeit des Shading Mode, in der Beschattung</td></tr>
<tr><td>DelayCmd</td><td>letzter Fahrbefehl welcher in die Warteschlange kam. Grund z.B. Partymodus.</td></tr>
@ -1436,7 +1462,7 @@ __END__
],
"release_status": "stable",
"license": "GPL_2",
"version": "v0.10.16",
"version": "v0.99.10",
"author": [
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
],
@ -1450,7 +1476,7 @@ __END__
"runtime": {
"requires": {
"FHEM": 5.00918799,
"perl": 5.016,
"perl": 5.023,
"Meta": 0,
"JSON": 0,
"Date::Parse": 0

View File

@ -1,16 +1,16 @@
UPD 2021-10-09_07:07:29 111901 FHEM/73_AutoShuttersControl.pm
UPD 2021-09-14_09:51:23 74456 lib/FHEM/Automation/ShuttersControl.pm
UPD 2021-09-14_09:51:23 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2021-10-09_07:08:59 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm
UPD 2021-10-09_07:09:33 31894 lib/FHEM/Automation/ShuttersControl/Shutters.pm
UPD 2021-10-09_07:09:29 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm
UPD 2021-10-01_08:09:29 109370 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2021-09-14_09:51:23 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm
UPD 2021-10-09_07:09:47 2173 lib/FHEM/Automation/ShuttersControl/Window.pm
UPD 2021-10-09_07:10:04 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
UPD 2021-10-09_07:10:16 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm
UPD 2021-10-09_07:10:38 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
UPD 2021-10-09_07:10:47 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
UPD 2021-10-09_07:11:04 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
UPD 2021-10-09_07:11:27 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm
UPD 2021-10-08_11:44:44 6506 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm
UPD 2024-10-12_07:38:48 116314 FHEM/73_AutoShuttersControl.pm
UPD 2024-10-12_07:35:03 76335 lib/FHEM/Automation/ShuttersControl.pm
UPD 2024-10-12_07:33:39 2691 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2024-10-12_07:34:12 2675 lib/FHEM/Automation/ShuttersControl/Roommate.pm
UPD 2024-10-12_07:34:38 31828 lib/FHEM/Automation/ShuttersControl/Shutters.pm
UPD 2024-10-12_07:34:24 25541 lib/FHEM/Automation/ShuttersControl/Shading.pm
UPD 2024-10-12_07:33:49 112297 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2024-10-12_07:34:00 40681 lib/FHEM/Automation/ShuttersControl/Helper.pm
UPD 2024-10-12_07:34:46 2209 lib/FHEM/Automation/ShuttersControl/Window.pm
UPD 2024-10-12_07:38:13 11857 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
UPD 2024-10-12_07:38:06 7265 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm
UPD 2024-10-12_07:37:57 52751 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
UPD 2024-10-12_07:37:49 2799 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
UPD 2024-10-12_07:37:43 3887 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
UPD 2024-10-12_07:33:29 2200 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm
UPD 2024-10-12_07:34:06 7394 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm

36
hooks/commit-msg Executable file
View 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
View 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

View File

@ -1,8 +1,8 @@
###############################################################################
#
# Developed with Kate
# Developed with VSCodium and richterger perl plugin
#
# (c) 2018-2021 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# All rights reserved
#
# Special thanks goes to:
@ -43,7 +43,7 @@ package FHEM::Automation::ShuttersControl::Dev;
use FHEM::Automation::ShuttersControl::Dev::Readings;
use FHEM::Automation::ShuttersControl::Dev::Attr;
our @ISA =
use base
qw(FHEM::Automation::ShuttersControl::Dev::Readings FHEM::Automation::ShuttersControl::Dev::Attr);
use strict;

View File

@ -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
#
# Special thanks goes to:
@ -44,23 +44,12 @@ use strict;
use warnings;
use utf8;
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
AttrVal
gettimeofday)
);
}
sub getShuttersOffset {
my $self = shift;
my $name = $self->{name};
return AttrVal( $name, 'ASC_shuttersDriveDelay', -1 );
return ::AttrVal( $name, 'ASC_shuttersDriveDelay', -1 );
}
sub getBrightnessMinVal {
@ -70,7 +59,7 @@ sub getBrightnessMinVal {
return $self->{ASC_brightness}->{triggermin}
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->getBrightnessMaxVal;
return $self->{ASC_brightness}->{triggermin};
@ -83,8 +72,8 @@ sub getBrightnessMaxVal {
return $self->{ASC_brightness}->{triggermax}
if ( exists( $self->{ASC_brightness}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
$self->{ASC_brightness}->{LASTGETTIME} = int( gettimeofday() );
&& ( ::gettimeofday() - $self->{ASC_brightness}->{LASTGETTIME} ) < 2 );
$self->{ASC_brightness}->{LASTGETTIME} = int( ::gettimeofday() );
my ( $triggermax, $triggermin ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
@ -104,7 +93,7 @@ sub _getTwilightDevice {
my $name = $self->{name};
return AttrVal( $name, 'ASC_twilightDevice', 'none' );
return ::AttrVal( $name, 'ASC_twilightDevice', 'none' );
}
sub getAutoAstroModeEvening {
@ -112,7 +101,7 @@ sub getAutoAstroModeEvening {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoAstroModeEvening', 'REAL' );
return ::AttrVal( $name, 'ASC_autoAstroModeEvening', 'REAL' );
}
sub getAutoAstroModeEveningHorizon {
@ -120,7 +109,7 @@ sub getAutoAstroModeEveningHorizon {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoAstroModeEveningHorizon', 0 );
return ::AttrVal( $name, 'ASC_autoAstroModeEveningHorizon', 0 );
}
sub getAutoAstroModeMorning {
@ -128,7 +117,7 @@ sub getAutoAstroModeMorning {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoAstroModeMorning', 'REAL' );
return ::AttrVal( $name, 'ASC_autoAstroModeMorning', 'REAL' );
}
sub getAutoAstroModeMorningHorizon {
@ -136,7 +125,7 @@ sub getAutoAstroModeMorningHorizon {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoAstroModeMorningHorizon', 0 );
return ::AttrVal( $name, 'ASC_autoAstroModeMorningHorizon', 0 );
}
sub getAutoShuttersControlMorning {
@ -144,7 +133,7 @@ sub getAutoShuttersControlMorning {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoShuttersControlMorning', 'on' );
return ::AttrVal( $name, 'ASC_autoShuttersControlMorning', 'on' );
}
sub getAutoShuttersControlEvening {
@ -152,7 +141,7 @@ sub getAutoShuttersControlEvening {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoShuttersControlEvening', 'on' );
return ::AttrVal( $name, 'ASC_autoShuttersControlEvening', 'on' );
}
sub getAutoShuttersControlComfort {
@ -160,7 +149,7 @@ sub getAutoShuttersControlComfort {
my $name = $self->{name};
return AttrVal( $name, 'ASC_autoShuttersControlComfort', 'off' );
return ::AttrVal( $name, 'ASC_autoShuttersControlComfort', 'off' );
}
sub getFreezeTemp {
@ -168,7 +157,7 @@ sub getFreezeTemp {
my $name = $self->{name};
return AttrVal( $name, 'ASC_freezeTemp', 3 );
return ::AttrVal( $name, 'ASC_freezeTemp', 3 );
}
sub getSlatDriveCmdInverse {
@ -176,7 +165,7 @@ sub getSlatDriveCmdInverse {
my $name = $self->{name};
return AttrVal( $name, 'ASC_slatDriveCmdInverse', 0 );
return ::AttrVal( $name, 'ASC_slatDriveCmdInverse', 0 );
}
sub _getTempSensor {
@ -186,11 +175,11 @@ sub _getTempSensor {
return $self->{ASC_tempSensor}->{device}
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_tempSensor}->{LASTGETTIME} = int( gettimeofday() );
&& ( ::gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_tempSensor}->{LASTGETTIME} = int( ::gettimeofday() );
my ( $device, $reading ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_tempSensor',
'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
'ASC_tempSensor', 'none' );
## erwartetes Ergebnis
# DEVICE:READING
@ -208,7 +197,7 @@ sub getTempSensorReading {
return $self->{ASC_tempSensor}->{reading}
if ( exists( $self->{ASC_tempSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_tempSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor;
return $self->{ASC_tempSensor}->{reading};
}
@ -220,8 +209,9 @@ sub _getResidentsDev {
return $self->{ASC_residentsDev}->{device}
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) < 2 );
$self->{ASC_residentsDev}->{LASTGETTIME} = int( gettimeofday() );
&& ( ::gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) <
2 );
$self->{ASC_residentsDev}->{LASTGETTIME} = int( ::gettimeofday() );
my ( $device, $reading ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
'ASC_residentsDev', 'none' );
@ -240,7 +230,8 @@ sub getResidentsReading {
return $self->{ASC_residentsDev}->{reading}
if ( exists( $self->{ASC_residentsDev}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_residentsDev}->{LASTGETTIME} ) <
2 );
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev;
return $self->{ASC_residentsDev}->{reading};
}
@ -252,11 +243,11 @@ sub _getRainSensor {
return $self->{ASC_rainSensor}->{device}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_rainSensor}->{LASTGETTIME} = int( gettimeofday() );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_rainSensor}->{LASTGETTIME} = int( ::gettimeofday() );
my ( $device, $reading, $max, $hyst, $pos, $wait ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_rainSensor',
'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
'ASC_rainSensor', 'none' );
## erwartetes Ergebnis
# DEVICE:READING MAX:HYST
@ -266,10 +257,10 @@ sub _getRainSensor {
$self->{ASC_rainSensor}->{reading} =
( $reading ne 'none' ? $reading : 'rain' );
$self->{ASC_rainSensor}->{triggermax} = (
( $max ne 'none'
&& $max =~ m{\A(-?\d+(\.\d+)?)\z}xms )
( $max ne 'none' && $max =~ m{\A(-?\d+(\.\d+)?)\z}xms )
? $max
: 1000 );
: 1000
);
$self->{ASC_rainSensor}->{triggerhyst} = (
$hyst ne 'none'
@ -277,10 +268,11 @@ sub _getRainSensor {
: ( $self->{ASC_rainSensor}->{triggermax} * 0 )
);
$self->{ASC_rainSensor}->{shuttersClosedPos} =
( $pos ne 'none'
$self->{ASC_rainSensor}->{shuttersClosedPos} = (
$pos ne 'none'
? $pos
: $FHEM::Automation::ShuttersControl::shutters->getClosedPos );
: $FHEM::Automation::ShuttersControl::shutters->getClosedPos
);
$self->{ASC_rainSensor}->{waitingTime} =
( $wait ne 'none' ? $wait : 0 );
@ -294,7 +286,7 @@ sub getRainSensorReading {
return $self->{ASC_rainSensor}->{reading}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
return $self->{ASC_rainSensor}->{reading};
}
@ -306,7 +298,7 @@ sub getRainTriggerMax {
return $self->{ASC_rainSensor}->{triggermax}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
return $self->{ASC_rainSensor}->{triggermax};
}
@ -318,7 +310,7 @@ sub getRainTriggerMin {
return $self->{ASC_rainSensor}->{triggerhyst}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
return $self->{ASC_rainSensor}->{triggerhyst};
}
@ -330,7 +322,7 @@ sub getRainSensorShuttersClosedPos {
return $self->{ASC_rainSensor}->{shuttersClosedPos}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
return $self->{ASC_rainSensor}->{shuttersClosedPos};
}
@ -342,7 +334,7 @@ sub getRainWaitingTime {
return $self->{ASC_rainSensor}->{waitingTime}
if ( exists( $self->{ASC_rainSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_rainSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getRainSensor;
return $self->{ASC_rainSensor}->{waitingTime};
}
@ -354,11 +346,11 @@ sub _getWindSensor {
return $self->{ASC_windSensor}->{device}
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_windSensor}->{LASTGETTIME} = int( gettimeofday() );
&& ( ::gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
$self->{ASC_windSensor}->{LASTGETTIME} = int( ::gettimeofday() );
my ( $device, $reading ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name, 'ASC_windSensor',
'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $name,
'ASC_windSensor', 'none' );
return $device if ( $device eq 'none' );
$self->{ASC_windSensor}->{device} = $device;
@ -375,7 +367,7 @@ sub getWindSensorReading {
return $self->{ASC_windSensor}->{reading}
if ( exists( $self->{ASC_windSensor}->{LASTGETTIME} )
&& ( gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
&& ( ::gettimeofday() - $self->{ASC_windSensor}->{LASTGETTIME} ) < 2 );
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor;
return (
defined( $self->{ASC_windSensor}->{reading} )
@ -389,18 +381,23 @@ sub getBlockAscDrivesAfterManual {
my $name = $self->{name};
return AttrVal( $name, 'ASC_blockAscDrivesAfterManual', 0 );
return ::AttrVal( $name, 'ASC_blockAscDrivesAfterManual', 0 );
}
sub getAdvDate {
sub getAdvStartDate {
my $self = shift;
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;

View File

@ -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
#
# Special thanks goes to:
@ -48,12 +48,7 @@ use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
readingsSingleUpdate
ReadingsVal
defs)
);
GP_Import(qw(defs));
}
sub setDelayCmdReading {
@ -62,7 +57,7 @@ sub setDelayCmdReading {
my $name = $self->{name};
my $hash = $defs{$name};
readingsSingleUpdate(
::readingsSingleUpdate(
$hash,
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
. '_lastDelayPosValue',
@ -79,7 +74,7 @@ sub setStateReading {
my $name = $self->{name};
my $hash = $defs{$name};
readingsSingleUpdate(
::readingsSingleUpdate(
$hash, 'state',
(
defined($value)
@ -97,7 +92,7 @@ sub setPosReading {
my $name = $self->{name};
my $hash = $defs{$name};
readingsSingleUpdate(
::readingsSingleUpdate(
$hash,
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
. '_PosValue',
@ -113,7 +108,7 @@ sub setLastPosReading {
my $name = $self->{name};
my $hash = $defs{$name};
readingsSingleUpdate(
::readingsSingleUpdate(
$hash,
$FHEM::Automation::ShuttersControl::shutters->getShuttersDev
. '_lastPosValue',
@ -128,7 +123,7 @@ sub getPartyMode {
my $name = $self->{name};
return ReadingsVal( $name, 'partyMode', 'off' );
return ::ReadingsVal( $name, 'partyMode', 'off' );
}
sub getHardLockOut {
@ -136,7 +131,7 @@ sub getHardLockOut {
my $name = $self->{name};
return ReadingsVal( $name, 'hardLockOut', 'none' );
return ::ReadingsVal( $name, 'hardLockOut', 'none' );
}
sub getSunriseTimeWeHoliday {
@ -144,7 +139,7 @@ sub getSunriseTimeWeHoliday {
my $name = $self->{name};
return ReadingsVal( $name, 'sunriseTimeWeHoliday', 'none' );
return ::ReadingsVal( $name, 'sunriseTimeWeHoliday', 'none' );
}
sub getMonitoredDevs {
@ -152,14 +147,14 @@ sub getMonitoredDevs {
my $name = $self->{name};
$self->{monitoredDevs} = ReadingsVal( $name, '.monitoredDevs', 'none' );
$self->{monitoredDevs} = ::ReadingsVal( $name, '.monitoredDevs', 'none' );
return $self->{monitoredDevs};
}
sub getOutTemp {
my $self = shift;
return ReadingsVal(
return ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getTempSensor,
$FHEM::Automation::ShuttersControl::ascDev->getTempSensorReading,
-100 );
@ -169,7 +164,8 @@ sub getResidentsStatus {
my $self = shift;
my $val =
ReadingsVal( $FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
$FHEM::Automation::ShuttersControl::ascDev->getResidentsReading,
'none' );
@ -178,7 +174,7 @@ sub getResidentsStatus {
return $1 && $1 eq 'pet' ? 'absent' : $2;
}
elsif (
ReadingsVal(
::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
'homealoneType', '-' ) eq 'PET'
)
@ -196,7 +192,8 @@ sub getResidentsLastStatus {
my $self = shift;
my $val =
ReadingsVal( $FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
'lastState', 'none' );
if ( $val =~ m{^(?:(.+)_)?(.+)$}xms ) {
@ -204,7 +201,7 @@ sub getResidentsLastStatus {
return $1 && $1 eq 'pet' ? 'absent' : $2;
}
elsif (
ReadingsVal(
::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getResidentsDev,
'lastHomealoneType', '-' ) eq 'PET'
)
@ -223,7 +220,7 @@ sub getAutoShuttersControlShading {
my $name = $self->{name};
return ReadingsVal( $name, 'controlShading', 'none' );
return ::ReadingsVal( $name, 'controlShading', 'none' );
}
sub getSelfDefense {
@ -231,7 +228,7 @@ sub getSelfDefense {
my $name = $self->{name};
return ReadingsVal( $name, 'selfDefense', 'none' );
return ::ReadingsVal( $name, 'selfDefense', 'none' );
}
sub getAzimuth {
@ -239,13 +236,13 @@ sub getAzimuth {
my $azimuth;
$azimuth = ReadingsVal(
$azimuth = ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
'azimuth', -1 )
if (
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
->{TYPE} eq 'Twilight' );
$azimuth = ReadingsVal(
$azimuth = ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
'SunAz', -1 )
if (
@ -260,13 +257,13 @@ sub getElevation {
my $elevation;
$elevation = ReadingsVal(
$elevation = ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
'elevation', -1 )
if (
$defs{ $FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice }
->{TYPE} eq 'Twilight' );
$elevation = ReadingsVal(
$elevation = ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getTwilightDevice,
'SunAlt', -1 )
if (
@ -281,7 +278,7 @@ sub getASCenable {
my $name = $self->{name};
return ReadingsVal( $name, 'ascEnable', 'none' );
return ::ReadingsVal( $name, 'ascEnable', 'none' );
}
1;

View File

@ -1,8 +1,8 @@
###############################################################################
#
# Developed with Kate
# Developed with VSCodium and richterger perl plugin
#
# (c) 2018-2021 Copyright: Marko Oldenburg (fhemsupport@cooltux.net)
# (c) 2018-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
# All rights reserved
#
# Special thanks goes to:
@ -46,7 +46,9 @@ use POSIX qw(strftime);
use utf8;
require Exporter;
our @ISA = qw(Exporter);
use base qw(Exporter);
# our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
PositionValueWindowRec
AutoSearchTwilightDev
@ -89,21 +91,7 @@ our %EXPORT_TAGS = (
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
devspec2array
CommandAttr
AttrVal
Log3
computeAlignTime
gettimeofday
sunset
sunset_abs
sunrise
sunrise_abs
cmdFromAnalyze
)
);
GP_Import(qw(cmdFromAnalyze));
}
sub PositionValueWindowRec {
@ -156,12 +144,12 @@ sub AutoSearchTwilightDev {
my $name = $hash->{NAME};
if ( devspec2array('TYPE=(Astro|Twilight)') > 0 ) {
CommandAttr( undef,
if ( ::devspec2array('TYPE=(Astro|Twilight)') > 0 ) {
::CommandAttr( undef,
$name
. ' ASC_twilightDevice '
. ( devspec2array('TYPE=(Astro|Twilight)') )[0] )
if ( AttrVal( $name, 'ASC_twilightDevice', 'none' ) eq 'none' );
. ( ::devspec2array('TYPE=(Astro|Twilight)') )[0] )
if ( ::AttrVal( $name, 'ASC_twilightDevice', 'none' ) eq 'none' );
}
return;
@ -172,8 +160,10 @@ sub GetAttrValues {
my $attribut = shift;
my $default = shift;
my @values = split( ' ',
AttrVal( $dev, $attribut, ( defined($default) ? $default : 'none' ) ) );
my @values = split(
' ',
::AttrVal( $dev, $attribut, ( defined($default) ? $default : 'none' ) )
);
my ( $value1, $value2 ) = split( ':', $values[0] );
my ( $value3, $value4, $value5, $value6, $value7, $value8 );
@ -227,10 +217,10 @@ sub ExtractNotifyDevFromEvent {
my %notifyDevs;
while ( my $notifyDev = each %{ $hash->{monitoredDevs} } ) {
Log3( $hash->{NAME}, 4,
::Log3( $hash->{NAME}, 4,
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - NotifyDev: "
. $notifyDev );
Log3( $hash->{NAME}, 5,
::Log3( $hash->{NAME}, 5,
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDev: "
. $shuttersDev );
@ -238,10 +228,10 @@ sub ExtractNotifyDevFromEvent {
&& $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} eq
$shuttersAttr )
{
Log3( $hash->{NAME}, 4,
::Log3( $hash->{NAME}, 4,
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - ShuttersDevHash: "
. $hash->{monitoredDevs}{$notifyDev}{$shuttersDev} );
Log3( $hash->{NAME}, 5,
::Log3( $hash->{NAME}, 5,
"AutoShuttersControl ($hash->{NAME}) - ExtractNotifyDevFromEvent - return ShuttersDev: "
. $notifyDev );
$notifyDevs{$notifyDev} = $shuttersDev;
@ -279,24 +269,27 @@ sub _IsDay {
(
(
(
int( gettimeofday() / 86400 ) != int(
computeAlignTime( '24:00',
int( ::gettimeofday() / 86400 ) != int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly ) / 86400
->getTimeUpEarly
) / 86400
)
&& ( !IsWe()
|| ( IsWe()
&& (
!IsWe()
|| (
IsWe()
&& ( $FHEM::Automation::ShuttersControl::ascDev
->getSunriseTimeWeHoliday eq 'off'
|| $FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday eq '01:25'
)
->getTimeUpWeHoliday eq '01:25' )
)
)
)
|| (
int( gettimeofday() / 86400 ) != int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) != int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday
@ -309,23 +302,23 @@ sub _IsDay {
->getTimeUpWeHoliday ne '01:25'
)
)
&& int( gettimeofday() / 86400 ) == int(
computeAlignTime(
&& int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate
) / 86400
)
)
|| (
int( gettimeofday() / 86400 ) != int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) != int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeDownEarly
) / 86400
)
&& int( gettimeofday() / 86400 ) == int(
computeAlignTime(
&& int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeDownLate
@ -390,17 +383,24 @@ sub _IsDay {
. $FHEM::Automation::ShuttersControl::shutters->getSunrise );
}
$respIsDay = 1
if (
( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'roommate'
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'asleep'
or $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'gotosleep' )
(
$FHEM::Automation::ShuttersControl::shutters->getDown eq 'roommate'
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne
'asleep'
or $FHEM::Automation::ShuttersControl::shutters->getRoommates
ne 'gotosleep' )
)
or ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'roommate'
and ( $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'asleep'
or $FHEM::Automation::ShuttersControl::shutters->getRoommates ne 'gotosleep' )
or (
$FHEM::Automation::ShuttersControl::shutters->getUp eq 'roommate'
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;
@ -436,7 +436,7 @@ sub ShuttersSunrise {
my $oldFuncHash =
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
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 ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'astro' ) {
@ -449,11 +449,11 @@ sub ShuttersSunrise {
if ( !IsWe('tomorrow') ) {
if (
IsWe()
&& int( gettimeofday() / 86400 ) == int(
&& int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -465,9 +465,9 @@ sub ShuttersSunrise {
)
{
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -477,11 +477,11 @@ sub ShuttersSunrise {
);
}
elsif (
int( gettimeofday() / 86400 ) == int(
int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -495,9 +495,9 @@ sub ShuttersSunrise {
)
{
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -508,9 +508,9 @@ sub ShuttersSunrise {
}
else {
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -526,11 +526,11 @@ sub ShuttersSunrise {
if (
IsWe()
&& (
int( gettimeofday() / 86400 ) == int(
int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -539,11 +539,11 @@ sub ShuttersSunrise {
) + 1
) / 86400
)
|| int( gettimeofday() / 86400 ) != int(
|| int( ::gettimeofday() / 86400 ) != int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -556,9 +556,9 @@ sub ShuttersSunrise {
)
{
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -568,11 +568,11 @@ sub ShuttersSunrise {
);
}
elsif (
int( gettimeofday() / 86400 ) == int(
int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -586,9 +586,9 @@ sub ShuttersSunrise {
)
{
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -601,11 +601,11 @@ sub ShuttersSunrise {
}
else {
if (
int( gettimeofday() / 86400 ) == int(
int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -617,9 +617,9 @@ sub ShuttersSunrise {
)
{
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -630,9 +630,9 @@ sub ShuttersSunrise {
}
else {
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -646,9 +646,9 @@ sub ShuttersSunrise {
}
else {
$shuttersSunriseUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -669,11 +669,11 @@ sub ShuttersSunrise {
{
if ( !IsWe('tomorrow') ) {
if (
int( gettimeofday() / 86400 ) == int(
int( ::gettimeofday() / 86400 ) == int(
(
computeAlignTime(
::computeAlignTime(
'24:00',
sunrise_abs(
::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -690,7 +690,7 @@ sub ShuttersSunrise {
( $shuttersSunriseUnixtime + 86400 )
if ( $shuttersSunriseUnixtime <
( $oldFuncHash->{sunrisetime} + 180 )
&& $oldFuncHash->{sunrisetime} < gettimeofday() );
&& $oldFuncHash->{sunrisetime} < ::gettimeofday() );
}
}
}
@ -698,7 +698,7 @@ sub ShuttersSunrise {
$shuttersSunriseUnixtime = ( $shuttersSunriseUnixtime + 86400 )
if ( $shuttersSunriseUnixtime <
( $oldFuncHash->{sunrisetime} + 180 )
&& $oldFuncHash->{sunrisetime} < gettimeofday() );
&& $oldFuncHash->{sunrisetime} < ::gettimeofday() );
}
}
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq 'time' )
@ -711,8 +711,8 @@ sub ShuttersSunrise {
{
if ( !IsWe('tomorrow') ) {
if (
int( gettimeofday() / 86400 ) == int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday
@ -720,13 +720,13 @@ sub ShuttersSunrise {
)
)
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday );
}
elsif (
int( gettimeofday() / 86400 ) == int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly
@ -736,12 +736,12 @@ sub ShuttersSunrise {
->getSunrise
)
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly ) + 86400;
}
else {
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly );
}
@ -749,8 +749,8 @@ sub ShuttersSunrise {
else {
if (
IsWe()
&& int( gettimeofday() / 86400 ) == int(
computeAlignTime(
&& int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday
@ -758,13 +758,13 @@ sub ShuttersSunrise {
)
)
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday );
}
elsif (
int( gettimeofday() / 86400 ) == int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) == int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly
@ -772,13 +772,13 @@ sub ShuttersSunrise {
)
)
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly );
}
elsif (
int( gettimeofday() / 86400 ) != int(
computeAlignTime(
int( ::gettimeofday() / 86400 ) != int(
::computeAlignTime(
'24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday
@ -786,19 +786,19 @@ sub ShuttersSunrise {
)
)
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday );
}
else {
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpWeHoliday ) + 86400;
}
}
}
else {
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters
->getTimeUpEarly );
}
@ -806,15 +806,14 @@ sub ShuttersSunrise {
elsif ( $FHEM::Automation::ShuttersControl::shutters->getUp eq
'brightness' )
{
$shuttersSunriseUnixtime = computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate
);
$shuttersSunriseUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters->getTimeUpLate );
}
return $shuttersSunriseUnixtime;
}
elsif ( $tm eq 'real' ) {
return sunrise_abs(
return ::sunrise_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters->getTimeUpEarly,
@ -858,15 +857,15 @@ sub ShuttersSunset {
my $oldFuncHash =
$FHEM::Automation::ShuttersControl::shutters->getInTimerFuncHash;
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 ( $FHEM::Automation::ShuttersControl::shutters->getDown eq 'astro' )
{
$shuttersSunsetUnixtime = (
computeAlignTime(
::computeAlignTime(
'24:00',
sunset_abs(
::sunset_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters
@ -880,13 +879,13 @@ sub ShuttersSunset {
$shuttersSunsetUnixtime += 86400
if ( $shuttersSunsetUnixtime <
( $oldFuncHash->{sunsettime} + 180 )
&& $oldFuncHash->{sunsettime} < gettimeofday() );
&& $oldFuncHash->{sunsettime} < ::gettimeofday() );
}
}
elsif (
$FHEM::Automation::ShuttersControl::shutters->getDown eq 'time' )
{
$shuttersSunsetUnixtime = computeAlignTime( '24:00',
$shuttersSunsetUnixtime = ::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly
);
}
@ -894,13 +893,13 @@ sub ShuttersSunset {
'brightness' )
{
$shuttersSunsetUnixtime =
computeAlignTime( '24:00',
::computeAlignTime( '24:00',
$FHEM::Automation::ShuttersControl::shutters->getTimeDownLate );
}
return $shuttersSunsetUnixtime;
}
elsif ( $tm eq 'real' ) {
return sunset_abs(
return ::sunset_abs(
$autoAstroMode,
0,
$FHEM::Automation::ShuttersControl::shutters->getTimeDownEarly,
@ -923,7 +922,7 @@ sub IsAfterShuttersTimeBlocking {
if (
(
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
) <
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
@ -933,7 +932,7 @@ sub IsAfterShuttersTimeBlocking {
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
)
&& $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
- ( int( gettimeofday() ) ) <
- ( int( ::gettimeofday() ) ) <
$FHEM::Automation::ShuttersControl::shutters
->getBlockingTimeBeforDayOpen
)
@ -943,7 +942,7 @@ sub IsAfterShuttersTimeBlocking {
$FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
)
&& $FHEM::Automation::ShuttersControl::shutters->getSunsetUnixTime
- ( int( gettimeofday() ) ) <
- ( int( ::gettimeofday() ) ) <
$FHEM::Automation::ShuttersControl::shutters
->getBlockingTimeBeforNightClose
)
@ -982,7 +981,7 @@ sub IsAfterShuttersManualBlocking {
}
elsif (
(
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters->getLastManPosTimestamp
) <
$FHEM::Automation::ShuttersControl::shutters->getBlockingTimeAfterManual
@ -994,25 +993,6 @@ sub IsAfterShuttersManualBlocking {
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 {
return main::IsWe( shift, shift );
}
@ -1038,23 +1018,31 @@ sub PerlCodeCheck {
sub IsAdv {
use HTTP::Date;
my ( undef, undef, undef, $monthday, $month, $year, undef, undef, undef ) =
localtime( gettimeofday() );
localtime( ::gettimeofday() );
my $adv = 0;
$year += 1900;
if ( $month < 1 ) {
if ( $monthday < 7 ) {
$adv = 1;
if ( $month < 1
&& $FHEM::Automation::ShuttersControl::ascDev->getAdvEndDate eq
'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 {
my $time = str2time( $year . '-12-25' );
my $wday = ( localtime($time) )[6];
$wday = $wday ? $wday : 7;
$time -= ( $FHEM::Automation::ShuttersControl::ascDev
->getAdvDate eq 'DeadSunday'
? ($wday + 27) * 86400
: ($wday + 21) * 86400
$time -= (
$FHEM::Automation::ShuttersControl::ascDev->getAdvStartDate eq
'DeadSunday'
? ( $wday + 27 ) * 86400
: ( $wday + 21 ) * 86400
);
$adv = 1 if ( $time < time );
}
@ -1066,14 +1054,15 @@ sub IsInTime {
my $dfi = shift;
$dfi =~ s/{([^\x7d]*)}/$cmdFromAnalyze=$1; eval $1/ge; # Forum #69787
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime(gettimeofday());
my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec);
foreach my $ft (split(" ", $dfi)) {
my ($from, $to) = split("-", $ft);
if(defined($from) && defined($to)) {
$from = "$wday\@$from" if(index($from,"@") < 0);
$to = "$wday\@$to" if(index($to, "@") < 0);
return 1 if($from le $dhms && $dhms le $to);
my ( $sec, $min, $hour, $mday, $month, $year, $wday, $yday, $isdst ) =
localtime( ::gettimeofday() );
my $dhms = sprintf( "%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec );
foreach my $ft ( split( " ", $dfi ) ) {
my ( $from, $to ) = split( "-", $ft );
if ( defined($from) && defined($to) ) {
$from = "$wday\@$from" if ( index( $from, "@" ) < 0 );
$to = "$wday\@$to" if ( index( $to, "@" ) < 0 );
return 1 if ( $from le $dhms && $dhms le $to );
}
}

View File

@ -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
#
# Special thanks goes to:
@ -47,7 +47,9 @@ use utf8;
use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
require Exporter;
our @ISA = qw(Exporter);
use base qw(Exporter);
# our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
RainProcessing
);
@ -59,7 +61,6 @@ our %EXPORT_TAGS = (
],
);
sub RainProcessing {
my ( $hash, $val, $triggerMax, $triggerMin ) = @_;
@ -75,7 +76,8 @@ sub RainProcessing {
$FHEM::Automation::ShuttersControl::shutters->getRainProtection eq
'off' );
if ( $val > $triggerMax
if (
$val > $triggerMax
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
$rainClosedPos
&& $FHEM::Automation::ShuttersControl::shutters
@ -83,7 +85,7 @@ sub RainProcessing {
|| ( $FHEM::Automation::ShuttersControl::shutters
->getRainProtectionStatus eq 'unprotected'
&& $FHEM::Automation::ShuttersControl::shutters
->getRainUnprotectionDelayObj ne 'none')
->getRainUnprotectionDelayObj ne 'none' )
)
{
_RainProtected();
@ -95,24 +97,32 @@ sub RainProcessing {
&& $FHEM::Automation::ShuttersControl::shutters
->getRainProtectionStatus eq 'protected' )
{
my %funcHash = (
shuttersdevice => $shuttersDev,
);
my %funcHash = ( shuttersdevice => $shuttersDev, );
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj(\%funcHash);
::InternalTimer( ::gettimeofday() + $FHEM::Automation::ShuttersControl::ascDev->getRainWaitingTime
, \&_RainUnprotected
, \%funcHash );
$FHEM::Automation::ShuttersControl::shutters
->setRainUnprotectionDelayObj( \%funcHash );
::InternalTimer(
::gettimeofday() +
$FHEM::Automation::ShuttersControl::ascDev
->getRainWaitingTime,
\&_RainUnprotected, \%funcHash
);
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('unprotected');
}
else {
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('unprotected')
if ( $FHEM::Automation::ShuttersControl::shutters->getStatus !=
$rainClosedPos
&& ($val == 0 || $val < $triggerMin) );
&& ( $val == 0 || $val < $triggerMin ) )
{
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('unprotected');
}
elsif ( $val > $triggerMax ) {
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('protected');
}
}
}
@ -121,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
sub _RainProtected {
::RemoveInternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj)
if($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj ne 'none');
::RemoveInternalTimer( $FHEM::Automation::ShuttersControl::shutters
->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(
'rain protected');
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
$FHEM::Automation::ShuttersControl::ascDev
->getRainSensorShuttersClosedPos);
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('protected');
->getRainSensorShuttersClosedPos );
$FHEM::Automation::ShuttersControl::shutters->setRainProtectionStatus(
'protected');
return;
}
sub _RainUnprotected {
my $h = shift;
my $targetPos = $FHEM::Automation::ShuttersControl::shutters->getLastPos;
my $shuttersDev = $h->{shuttersdevice};
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev(
$shuttersDev);
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
'rain un-protected');
if ( $FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj ne 'none' ) {
::RemoveInternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj);
$FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none');
if ( $FHEM::Automation::ShuttersControl::shutters
->getRainUnprotectionDelayObj ne 'none' )
{
::RemoveInternalTimer( $FHEM::Automation::ShuttersControl::shutters
->getRainUnprotectionDelayObj );
$FHEM::Automation::ShuttersControl::shutters
->setRainUnprotectionDelayObj('none');
}
$FHEM::Automation::ShuttersControl::shutters->setDriveCmd(
(
$FHEM::Automation::ShuttersControl::shutters->getIsDay
? $FHEM::Automation::ShuttersControl::shutters->getLastPos
: (
$FHEM::Automation::ShuttersControl::shutters
->getPrivacyDownStatus == 2
? $FHEM::Automation::ShuttersControl::shutters
->getPrivacyDownPos
: $FHEM::Automation::ShuttersControl::shutters
->getClosedPos
)
)
);
if ( $FHEM::Automation::ShuttersControl::shutters->getIsDay
&& !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
&& $FHEM::Automation::ShuttersControl::shutters->getLastPos ==
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
{
$targetPos = $FHEM::Automation::ShuttersControl::shutters->getOpenPos;
}
else {
$targetPos = $FHEM::Automation::ShuttersControl::shutters->getLastPos;
}
$FHEM::Automation::ShuttersControl::shutters
->setRainProtectionStatus('unprotected');
if ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
&& $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;

View File

@ -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
#
# Special thanks goes to:
@ -44,37 +44,41 @@ use strict;
use warnings;
use utf8;
use GPUtils qw(GP_Import);
require Exporter;
use base qw(Exporter);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
# our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
getRoommateStatus
getRoommateLastStatus
);
our %EXPORT_TAGS = (
ALL => [
qw(
ReadingsVal)
);
}
getRoommateStatus
getRoommateLastStatus
)
],
);
sub _getRoommateStatus {
sub getRoommateStatus {
my $self = shift;
my $roommate = $self->{roommate};
return ReadingsVal( $roommate,
return ::ReadingsVal( $roommate,
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading,
'none' );
}
sub _getRoommateLastStatus {
sub getRoommateLastStatus {
my $self = shift;
my $roommate = $self->{roommate};
my $default = $self->{defaultarg};
$default = 'none' if ( !defined($default) );
return ReadingsVal( $roommate, 'lastState', $default );
return ::ReadingsVal( $roommate, 'lastState', $default );
}
1;

View File

@ -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
#
# Special thanks goes to:
@ -48,7 +48,9 @@ use utf8;
use FHEM::Automation::ShuttersControl::Helper qw (IsInTime);
require Exporter;
our @ISA = qw(Exporter);
use base qw(Exporter);
# our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
CheckASC_ConditionsForShadingFn
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 {
my $hash = shift;
my $value = shift;
@ -104,8 +88,8 @@ sub CheckASC_ConditionsForShadingFn {
attrEvent => 0,
);
InternalTimer(
gettimeofday() + $count,
::InternalTimer(
::gettimeofday() + $count,
'FHEM::Automation::ShuttersControl::Shading::_CheckShuttersConditionsForShadingFn',
\%funcHash
);
@ -128,7 +112,7 @@ sub _CheckShuttersConditionsForShadingFn {
my $value = $funcHash->{value};
$FHEM::Automation::ShuttersControl::shutters->setShuttersDev($shuttersDev);
my $shuttersDevHash = $defs{$shuttersDev};
my $shuttersDevHash = $::defs{$shuttersDev};
my $message = '';
my $errorMessage;
my $warnMessage;
@ -136,22 +120,26 @@ sub _CheckShuttersConditionsForShadingFn {
if ( $value eq 'off' ) {
$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 .= '';
ShadingProcessingDriveCommand( $hash, $shuttersDev );
}
else {
$infoMessage .= (
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne 'off'
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
'off'
&& $FHEM::Automation::ShuttersControl::ascDev
->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'
: ''
);
$warnMessage .= (
$FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
$FHEM::Automation::ShuttersControl::shutters->getShadingMode eq
'off'
&& $FHEM::Automation::ShuttersControl::ascDev
->getAutoShuttersControlShading eq 'on'
? ' global shading active but ASC_Shading_Mode attribut is not set or off'
@ -159,7 +147,8 @@ sub _CheckShuttersConditionsForShadingFn {
);
$errorMessage .= (
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne 'off'
$FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
'off'
&& $FHEM::Automation::ShuttersControl::ascDev
->getAutoShuttersControlShading ne 'on'
&& $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 '
. '<a href="'
. '/fhem?detail='
. ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
. ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
. $::FW_CSRF . '">'
. ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
. ::ReadingsVal( $shuttersDev, 'associatedWith', 'ASC device' )
. '</a>'
: ''
);
$errorMessage .= (
$FHEM::Automation::ShuttersControl::shutters->getBrightness == -1
&& $FHEM::Automation::ShuttersControl::shutters->getShadingMode ne
'off'
&& $FHEM::Automation::ShuttersControl::shutters->getShadingMode
ne 'off'
? ' no brightness sensor found, please set ASC_BrightnessSensor attribut'
: ''
);
@ -197,10 +186,12 @@ sub _CheckShuttersConditionsForShadingFn {
&& $infoMessage ne ''
&& $errorMessage eq '' );
readingsBeginUpdate($shuttersDevHash);
readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
::readingsBeginUpdate($shuttersDevHash);
::readingsBulkUpdateIfChanged( $shuttersDevHash, 'ASC_ShadingMessage',
'<html>' . $message . ' </html>' );
readingsEndUpdate( $shuttersDevHash, 1 );
::readingsEndUpdate( $shuttersDevHash, 1 );
return;
}
sub ShadingProcessing {
@ -216,10 +207,16 @@ sub ShadingProcessing {
my $brightness =
$FHEM::Automation::ShuttersControl::shutters->getBrightnessAverage;
$FHEM::Automation::ShuttersControl::shutters->setShadingBetweenTheTimeSuspend(
( IsInTime($FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTime)
$FHEM::Automation::ShuttersControl::shutters
->setShadingBetweenTheTimeSuspend(
(
IsInTime(
$FHEM::Automation::ShuttersControl::shutters
->getShadingBetweenTheTime
)
? 0
: 1 )
: 1
)
);
FHEM::Automation::ShuttersControl::ASC_Debug(
@ -250,7 +247,7 @@ sub ShadingProcessing {
. ', Ist es nach der Hälfte der Beschattungswartezeit: '
. (
(
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters
->getShadingStatusTimestamp
) < (
@ -260,7 +257,7 @@ sub ShadingProcessing {
)
);
Log3( $name, 4,
::Log3( $name, 4,
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
. $shuttersDev
. " Azimuth: "
@ -279,18 +276,22 @@ sub ShadingProcessing {
|| $brightness == -1
|| $outTemp == -100
|| (
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters
->getShadingStatusTimestamp ) < (
$FHEM::Automation::ShuttersControl::shutters
->getShadingWaitingPeriod / 2
)
|| $FHEM::Automation::ShuttersControl::shutters
->getExternalTriggerStatus
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode eq 'off'
|| $FHEM::Automation::ShuttersControl::ascDev
->getAutoShuttersControlShading eq 'off'
|| $FHEM::Automation::ShuttersControl::shutters
->getExternalTriggerStatus
);
Log3( $name, 4,
::Log3( $name, 4,
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
. $shuttersDev
. " Nach dem return" );
@ -300,7 +301,7 @@ sub ShadingProcessing {
my $getStatus = $FHEM::Automation::ShuttersControl::shutters->getStatus;
my $oldShadingStatus =
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus;
my $shuttersDevHash = $defs{$shuttersDev};
my $shuttersDevHash = $::defs{$shuttersDev};
my $getModeUp = $FHEM::Automation::ShuttersControl::shutters->getModeUp;
my $homemode = $FHEM::Automation::ShuttersControl::shutters->getHomemode;
@ -317,8 +318,8 @@ sub ShadingProcessing {
|| $azimuth < $azimuthLeft
|| $azimuth > $azimuthRight
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIsDay
&& $FHEM::Automation::ShuttersControl::shutters->getSunriseUnixTime
- ( int( gettimeofday() ) ) > 7200 )
&& $FHEM::Automation::ShuttersControl::shutters
->getSunriseUnixTime - ( int( ::gettimeofday() ) ) > 7200 )
)
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus ne
'out'
@ -331,7 +332,7 @@ sub ShadingProcessing {
. ' - 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 "
);
}
@ -358,7 +359,7 @@ sub ShadingProcessing {
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus
eq 'out reserved'
and (
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters
->getShadingStatusTimestamp )
) > $FHEM::Automation::ShuttersControl::shutters
@ -369,7 +370,7 @@ sub ShadingProcessing {
'out');
}
Log3( $name, 4,
::Log3( $name, 4,
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
. $shuttersDev
. " In der Out Abfrage, Shadingwert: "
@ -411,7 +412,7 @@ sub ShadingProcessing {
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
'in reserved'
and (
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters
->getShadingStatusTimestamp ) > (
$FHEM::Automation::ShuttersControl::shutters
@ -423,7 +424,7 @@ sub ShadingProcessing {
'in');
}
Log3( $name, 4,
::Log3( $name, 4,
"AutoShuttersControl ($name) - Shading Processing, Rollladen: "
. $shuttersDev
. " In der In Abfrage, Shadingwert: "
@ -469,21 +470,17 @@ sub ShadingProcessing {
$homemode )
&& (
$getModeUp eq 'always'
|| $getModeUp eq
$homemode
|| $getModeUp eq $homemode
|| $getModeUp eq 'off'
|| $getModeUp eq
'absent'
|| $getModeUp eq
'gone'
|| ( $getModeUp eq
'home'
|| $getModeUp eq 'absent'
|| $getModeUp eq 'gone'
|| ( $getModeUp eq 'home'
&& $homemode ne 'asleep' )
)
&& (
(
(
int( gettimeofday() ) -
int( ::gettimeofday() ) -
$FHEM::Automation::ShuttersControl::shutters
->getShadingStatusTimestamp
) < 2
@ -499,16 +496,16 @@ sub ShadingProcessing {
)
|| ( !$FHEM::Automation::ShuttersControl::shutters->getIfInShading
&& $FHEM::Automation::ShuttersControl::shutters->getStatus ==
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
)
|| ( !$FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTimeSuspend
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
|| ( !$FHEM::Automation::ShuttersControl::shutters
->getShadingBetweenTheTimeSuspend
&& $FHEM::Automation::ShuttersControl::shutters->getStatus !=
$FHEM::Automation::ShuttersControl::shutters->getShadingPos )
)
);
readingsBeginUpdate($shuttersDevHash);
readingsBulkUpdate(
::readingsBeginUpdate($shuttersDevHash);
::readingsBulkUpdate(
$shuttersDevHash,
'ASC_ShadingMessage',
'INFO: current shading status is \''
@ -531,7 +528,7 @@ sub ShadingProcessing {
) / 60
. 'm'
);
readingsEndUpdate( $shuttersDevHash, 1 );
::readingsEndUpdate( $shuttersDevHash, 1 );
return;
}
@ -551,18 +548,27 @@ sub ShadingProcessingDriveCommand {
$FHEM::Automation::ShuttersControl::shutters->setShadingStatus(
$FHEM::Automation::ShuttersControl::shutters->getShadingStatus );
if ( IsInTime($FHEM::Automation::ShuttersControl::shutters->getShadingBetweenTheTime)
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq 'in'
if (
IsInTime(
$FHEM::Automation::ShuttersControl::shutters
->getShadingBetweenTheTime
)
&& $FHEM::Automation::ShuttersControl::shutters->getShadingStatus eq
'in'
&& $getShadingPos != $getStatus
&& ( $getStatus != $FHEM::Automation::ShuttersControl::shutters->getClosedPos
|| ( $getStatus == $FHEM::Automation::ShuttersControl::shutters->getClosedPos
&& $marker
)
)
&& ( $getStatus != $FHEM::Automation::ShuttersControl::shutters->getSleepPos
|| ( $getStatus == $FHEM::Automation::ShuttersControl::shutters->getSleepPos
&& $marker
&& (
$getStatus !=
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
|| ( $getStatus ==
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
&& $marker )
)
&& (
$getStatus !=
$FHEM::Automation::ShuttersControl::shutters->getSleepPos
|| ( $getStatus ==
$FHEM::Automation::ShuttersControl::shutters->getSleepPos
&& $marker )
)
&& (
FHEM::Automation::ShuttersControl::CheckIfShuttersWindowRecOpen(
@ -626,8 +632,10 @@ sub ShadingProcessingDriveCommand {
: $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(
'ShadingProcessingDriveCommand: '
@ -639,7 +647,7 @@ sub ShadingProcessingDriveCommand {
. ' 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: "
. $FHEM::Automation::ShuttersControl::shutters->getShadingStatus );

View File

@ -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
#
# Special thanks goes to:
@ -45,18 +45,18 @@
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 warnings;
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 {
my $class = shift;
my $self = {
@ -161,9 +161,6 @@ sub setDriveCmd {
$FHEM::Automation::ShuttersControl::shutters->setDelayCmd($posValue);
$FHEM::Automation::ShuttersControl::ascDev->setDelayCmdReading;
$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::shutters->getShuttersDev
@ -177,7 +174,8 @@ sub setDriveCmd {
if ( $FHEM::Automation::ShuttersControl::shutters->getDelayCmd ne
'none' )
; # 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
->getExternalTriggerStatus );
@ -233,7 +231,7 @@ sub setDriveCmd {
::gettimeofday() +
$FHEM::Automation::ShuttersControl::shutters
->getSelfDefenseAbsentDelay,
\&FHEM::Automation::ShuttersControl::_SetCmdFn, \%h
\&FHEM::Automation::ShuttersControl::SetCmdFn, \%h
);
$FHEM::Automation::ShuttersControl::shutters->setSelfDefenseAbsent(
1, 0, \%h );
@ -247,7 +245,7 @@ sub setDriveCmd {
$FHEM::Automation::ShuttersControl::shutters
->getDelayStart
),
\&FHEM::Automation::ShuttersControl::_SetCmdFn,
\&FHEM::Automation::ShuttersControl::SetCmdFn,
\%h
);
@ -258,7 +256,7 @@ sub setDriveCmd {
elsif ($offSetStart < 1
|| $FHEM::Automation::ShuttersControl::shutters->getNoDelay )
{
FHEM::Automation::ShuttersControl::_SetCmdFn( \%h );
FHEM::Automation::ShuttersControl::SetCmdFn( \%h );
FHEM::Automation::ShuttersControl::ASC_Debug( 'FnSetDriveCmd: '
. $FHEM::Automation::ShuttersControl::shutters->getShuttersDev
. ' - NICHT versetztes fahren' );
@ -346,8 +344,7 @@ sub setLastDriveReading {
);
::InternalTimer( ::gettimeofday() + 0.1,
\&FHEM::Automation::ShuttersControl::_setShuttersLastDriveDelayed,
\%h );
\&FHEM::Automation::ShuttersControl::setShuttersLastDriveDelayed, \%h );
return;
}
@ -460,7 +457,8 @@ sub setRainUnprotectionDelayObj {
my $self = shift;
my $value = shift;
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL} = $value
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
= $value
if ( defined($value) );
return;
}
@ -545,7 +543,8 @@ sub getAttrUpdateChanges {
sub getIsDay {
my $self = shift;
return FHEM::Automation::ShuttersControl::Helper::_IsDay( $self->{shuttersDev} );
return FHEM::Automation::ShuttersControl::Helper::_IsDay(
$self->{shuttersDev} );
}
sub getAntiFreezeStatus {
@ -756,10 +755,12 @@ sub getRainUnprotectionDelayObj {
(
defined( $self->{ $self->{shuttersDev} }->{RainProtection} )
&& defined(
$self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
$self->{ $self->{shuttersDev} }->{RainProtection}
->{UNPROTECTIONDELAYOBJVAL}
)
)
? $self->{ $self->{shuttersDev} }->{RainProtection}->{UNPROTECTIONDELAYOBJVAL}
? $self->{ $self->{shuttersDev} }->{RainProtection}
->{UNPROTECTIONDELAYOBJVAL}
: 'none'
);
}
@ -821,7 +822,7 @@ sub getRoommatesStatus {
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
my $currentPrio =
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
->_getRoommateStatus };
->getRoommateStatus };
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
}
@ -854,7 +855,7 @@ sub getRoommatesLastStatus {
$FHEM::Automation::ShuttersControl::shutters->setRoommate($ro);
my $currentPrio =
$statePrio{ $FHEM::Automation::ShuttersControl::shutters
->_getRoommateLastStatus };
->getRoommateLastStatus };
$minPrio = $currentPrio if ( $minPrio > $currentPrio );
}
@ -899,7 +900,8 @@ sub setShadingStatus {
$self->{ $self->{shuttersDev} }{ShadingStatus}{VAL} = $value
if ( defined($value) );
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} = int( ::gettimeofday() )
$self->{ $self->{shuttersDev} }{ShadingStatus}{TIME} =
int( ::gettimeofday() )
if ( defined( $self->{ $self->{shuttersDev} }{ShadingStatus} ) );
return;
@ -1011,8 +1013,12 @@ sub getShadingBetweenTheTimeSuspend { # Werte für value = 0, 1
my $self = shift;
return (
defined( $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend} )
&& defined( $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL} )
defined(
$self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}
)
&& defined(
$self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL}
)
? $self->{ $self->{shuttersDev} }{ShadingBetweenTheTimeSuspend}{VAL}
: 0
);
@ -1084,9 +1090,7 @@ sub getShadingLastPos {
return (
defined( $self->{ $self->{shuttersDev} }{ShadingLastPos} )
&& defined(
$self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL}
)
&& defined( $self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL} )
? $self->{ $self->{shuttersDev} }{ShadingLastPos}{VAL}
: $FHEM::Automation::ShuttersControl::shutters->getShadingPos
);
@ -1094,7 +1098,4 @@ sub getShadingLastPos {
### Ende Beschattung
1;

View File

@ -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
#
# Special thanks goes to:
@ -46,24 +46,12 @@ use utf8;
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 {
my $shuttersDev = shift;
my $attr = shift;
my $attrVal = shift;
CommandAttr( undef, $shuttersDev . ' ' . $attr . ' ' . $attrVal );
::CommandAttr( undef, $shuttersDev . ' ' . $attr . ' ' . $attrVal );
return;
}
@ -77,28 +65,28 @@ sub _getPosition {
return $self->{ $self->{shuttersDev} }->{$attr}->{position}
if (
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my $position;
my $posAssignment;
if (
AttrVal( $self->{shuttersDev}, $attr,
::AttrVal( $self->{shuttersDev}, $attr,
$FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ] ) =~
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ] ) =~
m{\A\{.+\}\z}xms
)
{
my $response = PerlCodeCheck(
AttrVal(
::AttrVal(
$self->{shuttersDev},
$attr,
$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
: $FHEM::Automation::ShuttersControl::userAttrList{$userAttrList}
[ AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 2 ) ]
);
$posAssignment = (
@ -124,7 +112,7 @@ sub _getPosition {
$self->{shuttersDev},
$attr,
$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} =
PerlCodeCheck(
$self->{ $self->{shuttersDev} }->{$attr}->{position} );
PerlCodeCheck( $self->{ $self->{shuttersDev} }->{$attr}->{position} );
}
return (
@ -154,7 +141,7 @@ sub _getPosition {
m{^\d+(\.\d+)?$}xms
? $self->{ $self->{shuttersDev} }->{$attr}->{position}
: $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}
if (
exists( $self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} )
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{$attr}->{LASTGETTIME} ) < 2
);
$FHEM::Automation::ShuttersControl::shutters->$getFn;
@ -213,7 +200,7 @@ sub setShuttersPlace {
sub getShuttersPlace {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_ShuttersPlace', 'window' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_ShuttersPlace', 'window' );
}
sub setSlatPosCmd {
@ -236,15 +223,15 @@ sub getSlatPosCmd {
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}->{LASTGETTIME}
= int( gettimeofday() );
= int( ::gettimeofday() );
my ( $slatPosCmd, $slatDevice ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_SlatPosCmd_SlatDevice', 'none:none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_SlatPosCmd_SlatDevice', 'none:none' );
## Erwartetes Ergebnis
# upTime:upBrightnessVal
@ -268,7 +255,7 @@ sub getSlatDevice {
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}
->{LASTGETTIME} ) < 2
);
@ -299,15 +286,15 @@ sub getPrivacyUpTime {
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
->{LASTGETTIME} = int( gettimeofday() );
->{LASTGETTIME} = int( ::gettimeofday() );
my ( $upTime, $upBrightnessVal ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_PrivacyUpValue_beforeDayOpen', '-1:-1' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_PrivacyUpValue_beforeDayOpen', '-1:-1' );
## Erwartetes Ergebnis
# upTime:upBrightnessVal
@ -341,7 +328,7 @@ sub getPrivacyUpBrightnessVal {
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_PrivacyUpValue_beforeDayOpen}
->{LASTGETTIME} ) < 2
);
@ -378,14 +365,15 @@ sub getPrivacyDownTime {
$self->{ $self->{shuttersDev} }
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_PrivacyDownValue_beforeNightClose}
->{LASTGETTIME} = int( gettimeofday() );
->{LASTGETTIME} = int( ::gettimeofday() );
my ( $downTime, $downBrightnessVal ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev},
'ASC_PrivacyDownValue_beforeNightClose', '-1:-1' );
## Erwartetes Ergebnis
@ -420,7 +408,7 @@ sub getPrivacyDownBrightnessVal {
$self->{ $self->{shuttersDev} }
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_PrivacyDownValue_beforeNightClose}->{LASTGETTIME} ) < 2
);
@ -497,7 +485,7 @@ sub setSelfDefenseMode {
sub getSelfDefenseMode {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_Mode', 'gone' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_Mode', 'gone' );
}
sub setSelfDefenseAbsentDelay {
@ -513,7 +501,14 @@ sub setSelfDefenseAbsentDelay {
sub getSelfDefenseAbsentDelay {
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 {
@ -528,7 +523,7 @@ sub setWiggleValue {
sub getWiggleValue {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_WiggleValue', 5 );
return ::AttrVal( $self->{shuttersDev}, 'ASC_WiggleValue', 5 );
}
sub setAdv {
@ -544,7 +539,7 @@ sub getAdv {
my $self = shift;
return (
AttrVal( $self->{shuttersDev}, 'ASC_Adv', 'off' ) eq 'on'
::AttrVal( $self->{shuttersDev}, 'ASC_Adv', 'off' ) eq 'on'
? ( IsAdv == 1 ? 1 : 0 )
: 0
);
@ -587,7 +582,7 @@ sub setShadingMode {
sub getShadingMode {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_Mode', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Shading_Mode', 'off' );
}
sub _getTempSensor {
@ -598,15 +593,15 @@ sub _getTempSensor {
exists(
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
< 2
);
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my ( $device, $reading ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_TempSensor', 'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_TempSensor', 'none' );
### erwartetes Ergebnis
# DEVICE:READING
@ -625,7 +620,7 @@ sub getTempSensorReading {
exists(
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_TempSensor}->{LASTGETTIME} )
< 2
);
@ -658,15 +653,15 @@ sub _getIdleDetectionReading {
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}->{LASTGETTIME}
= int( gettimeofday() );
= int( ::gettimeofday() );
my ( $reading, $value ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_Shutter_IdleDetection', 'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_Shutter_IdleDetection', 'none' );
### erwartetes Ergebnis
# READING:VALUE
@ -688,7 +683,7 @@ sub getIdleDetectionValue {
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shutter_IdleDetection}
->{LASTGETTIME} ) < 2
);
@ -722,15 +717,15 @@ sub _getBrightnessSensor {
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my ( $device, $reading, $max, $min ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_BrightnessSensor', 'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_BrightnessSensor', 'none' );
### erwartetes Ergebnis
# DEVICE:READING MAX:MIN
@ -754,7 +749,7 @@ sub getBrightnessReading {
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME} ) < 2
);
@ -779,7 +774,7 @@ sub getShadingAzimuthLeft {
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
->{LASTGETTIME} ) < 2
);
@ -808,15 +803,15 @@ sub getShadingAzimuthRight {
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_Shading_InOutAzimuth}->{LASTGETTIME}
= int( gettimeofday() );
= int( ::gettimeofday() );
my ( $left, $right ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_Shading_InOutAzimuth', '95:265' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_Shading_InOutAzimuth', '95:265' );
### erwartetes Ergebnis
# MIN:MAX
@ -843,8 +838,8 @@ sub setShadingMinOutsideTemperature {
sub getShadingMinOutsideTemperature {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_Min_OutsideTemperature',
18 );
return ::AttrVal( $self->{shuttersDev},
'ASC_Shading_Min_OutsideTemperature', 18 );
}
sub setShadingMinMaxElevation {
@ -867,15 +862,15 @@ sub getShadingMinElevation {
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
->{LASTGETTIME} = int( gettimeofday() );
->{LASTGETTIME} = int( ::gettimeofday() );
my ( $min, $max ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_Shading_MinMax_Elevation', '25.0:100.0' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_Shading_MinMax_Elevation', '25.0:100.0' );
### erwartetes Ergebnis
# MIN:MAX
@ -899,7 +894,7 @@ sub getShadingMaxElevation {
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_Shading_MinMax_Elevation}
->{LASTGETTIME} ) < 2
);
@ -937,15 +932,15 @@ sub getShadingStateChangeSunny {
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_Shading_StateChange_SunnyCloudy}
->{LASTGETTIME} = int( gettimeofday() );
->{LASTGETTIME} = int( ::gettimeofday() );
my ( $sunny, $cloudy, $maxBrightnessAverageArrayObjects ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_Shading_StateChange_SunnyCloudy',
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_Shading_StateChange_SunnyCloudy',
'35000:20000' );
### erwartetes Ergebnis
@ -976,7 +971,7 @@ sub getShadingStateChangeCloudy {
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
);
@ -996,7 +991,7 @@ sub getMaxBrightnessAverageArrayObjects {
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }
->{ASC_Shading_StateChange_SunnyCloudy}->{LASTGETTIME} ) < 2
);
@ -1019,7 +1014,7 @@ sub setShadingWaitingPeriod {
sub getShadingWaitingPeriod {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Shading_WaitingPeriod', 1200 );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Shading_WaitingPeriod', 1200 );
}
### Ende Beschattung
sub setExternalTrigger {
@ -1040,16 +1035,16 @@ sub getExternalTriggerDevice {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my ( $device, $reading, $valueActive, $valueInactive, $posActive,
$posInactive, $valueActive2, $posActive2 )
= FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_ExternalTrigger', 'none' );
= FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_ExternalTrigger', 'none' );
### erwartetes Ergebnis
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE VALUEACTIVE2:POSACTIVE2
@ -1064,10 +1059,11 @@ sub getExternalTriggerDevice {
$valueInactive;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive} =
$posActive;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posinactive} =
( $posInactive ne 'none'
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posinactive} = (
$posInactive ne 'none'
? $posInactive
: $FHEM::Automation::ShuttersControl::shutters->getLastPos );
: $FHEM::Automation::ShuttersControl::shutters->getLastPos
);
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{valueactive2} =
$valueActive2;
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}->{posactive2} =
@ -1086,7 +1082,7 @@ sub getExternalTriggerReading {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1104,7 +1100,7 @@ sub getExternalTriggerValueActive {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1124,7 +1120,7 @@ sub getExternalTriggerValueActive2 {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1144,7 +1140,7 @@ sub getExternalTriggerValueInactive {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1163,7 +1159,7 @@ sub getExternalTriggerPosActive {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1181,7 +1177,7 @@ sub getExternalTriggerPosActive2 {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1199,7 +1195,7 @@ sub getExternalTriggerPosInactive {
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_ExternalTrigger}
->{LASTGETTIME} ) < 2
);
@ -1221,7 +1217,7 @@ sub setDelay {
sub getDelay {
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 );
}
@ -1237,7 +1233,7 @@ sub setDelayStart {
sub getDelayStart {
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 );
}
@ -1254,7 +1250,7 @@ sub setBlockingTimeAfterManual {
sub getBlockingTimeAfterManual {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_afterManual',
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_afterManual',
1200 );
}
@ -1271,7 +1267,7 @@ sub setBlockingTimeBeforNightClose {
sub getBlockingTimeBeforNightClose {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforNightClose',
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforNightClose',
3600 );
}
@ -1288,7 +1284,7 @@ sub setBlockingTimeBeforDayOpen {
sub getBlockingTimeBeforDayOpen {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforDayOpen',
return ::AttrVal( $self->{shuttersDev}, 'ASC_BlockingTime_beforDayOpen',
3600 );
}
@ -1304,9 +1300,9 @@ sub setPosCmd {
sub getPosCmd {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Pos_Reading',
return ::AttrVal( $self->{shuttersDev}, 'ASC_Pos_Reading',
$FHEM::Automation::ShuttersControl::userAttrList{'ASC_Pos_Reading'}
[ AttrVal( $self->{shuttersDev}, 'ASC', 1 ) ] );
[ ::AttrVal( $self->{shuttersDev}, 'ASC', 1 ) ] );
}
sub setOpenPos {
@ -1371,7 +1367,7 @@ sub setVentilatePosAfterDayClosed {
sub getVentilatePosAfterDayClosed {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_PosAfterDayClosed',
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_PosAfterDayClosed',
'open' );
}
@ -1436,7 +1432,7 @@ sub setVentilateOpen {
sub getVentilateOpen {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Ventilate_Window_Open', 'on' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Ventilate_Window_Open', 'on' );
}
sub setComfortOpenPos {
@ -1476,7 +1472,7 @@ sub setPartyMode {
sub getPartyMode {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Partymode', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Partymode', 'off' );
}
sub setRoommates {
@ -1491,7 +1487,7 @@ sub setRoommates {
sub getRoommates {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Device', 'none' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Device', 'none' );
}
sub setRoommatesReading {
@ -1506,7 +1502,7 @@ sub setRoommatesReading {
sub getRoommatesReading {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Reading', 'state' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Roommate_Reading', 'state' );
}
sub getWindPos {
@ -1519,7 +1515,7 @@ sub getWindPos {
exists(
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
) < 2
);
@ -1538,15 +1534,15 @@ sub getWindMax {
exists(
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
) < 2
);
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my ( $max, $hyst, $pos ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_WindParameters', '50:20' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_WindParameters', '50:20' );
## Erwartetes Ergebnis
# max:hyst pos
@ -1554,10 +1550,11 @@ sub getWindMax {
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax} = $max;
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggerhyst} =
( $hyst ne 'none' ? $max - $hyst : $max - 20 );
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{closedPos} =
( $pos ne 'none'
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{closedPos} = (
$pos ne 'none'
? $pos
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos );
: $FHEM::Automation::ShuttersControl::shutters->getOpenPos
);
return $self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{triggermax};
}
@ -1581,7 +1578,7 @@ sub getWindMin {
exists(
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_WindParameters}->{LASTGETTIME}
) < 2
);
@ -1602,7 +1599,7 @@ sub setWindProtection {
sub getWindProtection {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_WindProtection', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindProtection', 'off' );
}
sub setRainProtection {
@ -1617,7 +1614,7 @@ sub setRainProtection {
sub getRainProtection {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_RainProtection', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_RainProtection', 'off' );
}
sub setModeUp {
@ -1632,7 +1629,7 @@ sub setModeUp {
sub getModeUp {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Mode_Up', 'always' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Mode_Up', 'always' );
}
sub setModeDown {
@ -1647,7 +1644,7 @@ sub setModeDown {
sub getModeDown {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Mode_Down', 'always' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Mode_Down', 'always' );
}
sub setLockOut {
@ -1662,7 +1659,7 @@ sub setLockOut {
sub getLockOut {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_LockOut', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_LockOut', 'off' );
}
sub setLockOutCmd {
@ -1677,7 +1674,7 @@ sub setLockOutCmd {
sub getLockOutCmd {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_LockOut_Cmd', 'none' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_LockOut_Cmd', 'none' );
}
sub setAntiFreeze {
@ -1692,7 +1689,7 @@ sub setAntiFreeze {
sub getAntiFreeze {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Antifreeze', 'off' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Antifreeze', 'off' );
}
sub setAutoAstroModeMorning {
@ -1707,7 +1704,8 @@ sub setAutoAstroModeMorning {
sub getAutoAstroModeMorning {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorning', 'none' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorning',
'none' );
}
sub setAutoAstroModeEvening {
@ -1722,7 +1720,8 @@ sub setAutoAstroModeEvening {
sub getAutoAstroModeEvening {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEvening', 'none' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEvening',
'none' );
}
sub setAutoAstroModeMorningHorizon {
@ -1738,7 +1737,7 @@ sub setAutoAstroModeMorningHorizon {
sub getAutoAstroModeMorningHorizon {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorningHorizon',
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeMorningHorizon',
0 );
}
@ -1755,7 +1754,7 @@ sub setAutoAstroModeEveningHorizon {
sub getAutoAstroModeEveningHorizon {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEveningHorizon',
return ::AttrVal( $self->{shuttersDev}, 'ASC_AutoAstroModeEveningHorizon',
0 );
}
@ -1771,7 +1770,7 @@ sub setUp {
sub getUp {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Up', 'astro' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Up', 'astro' );
}
sub setDown {
@ -1786,14 +1785,15 @@ sub setDown {
sub getDown {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_Down', 'astro' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_Down', 'astro' );
}
sub setShadingBetweenTheTime {
my $self = shift;
my $attrVal = shift;
_setAttributs( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime', $attrVal );
_setAttributs( $self->{shuttersDev}, 'ASC_Shading_BetweenTheTime',
$attrVal );
return;
}
@ -1801,7 +1801,8 @@ sub setShadingBetweenTheTime {
sub getShadingBetweenTheTime {
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 {
@ -1816,7 +1817,7 @@ sub setTimeUpEarly {
sub getTimeUpEarly {
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) ) ) {
$val = PerlCodeCheck($val);
@ -1841,7 +1842,7 @@ sub setTimeUpLate {
sub getTimeUpLate {
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) ) ) {
$val = PerlCodeCheck($val);
@ -1866,7 +1867,7 @@ sub setTimeDownEarly {
sub getTimeDownEarly {
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) ) ) {
$val = PerlCodeCheck($val);
@ -1891,7 +1892,7 @@ sub setTimeDownLate {
sub getTimeDownLate {
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) ) ) {
$val = PerlCodeCheck($val);
@ -1917,7 +1918,7 @@ sub getTimeUpWeHoliday {
my $self = shift;
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) ) ) {
$val = PerlCodeCheck($val);
@ -1939,7 +1940,7 @@ sub getBrightnessMinVal {
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME} ) < 2
);
@ -1958,7 +1959,7 @@ sub getBrightnessMaxVal {
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_BrightnessSensor}
->{LASTGETTIME} ) < 2
);
@ -1980,7 +1981,7 @@ sub setDriveUpMaxDuration {
sub getDriveUpMaxDuration {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_DriveUpMaxDuration', 60 );
return ::AttrVal( $self->{shuttersDev}, 'ASC_DriveUpMaxDuration', 60 );
}
1;

View File

@ -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
#
# Special thanks goes to:
@ -44,21 +44,10 @@ use strict;
use warnings;
use utf8;
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
ReadingsVal
ReadingsNum)
);
}
sub getBrightness {
my $self = shift;
return ReadingsNum(
return ::ReadingsNum(
$FHEM::Automation::ShuttersControl::shutters->_getBrightnessSensor,
$FHEM::Automation::ShuttersControl::shutters->getBrightnessReading,
-1 );
@ -67,7 +56,7 @@ sub getBrightness {
sub getWindStatus {
my $self = shift;
return ReadingsVal(
return ::ReadingsVal(
$FHEM::Automation::ShuttersControl::ascDev->_getWindSensor,
$FHEM::Automation::ShuttersControl::ascDev->getWindSensorReading, -1 );
}
@ -75,7 +64,7 @@ sub getWindStatus {
sub getStatus {
my $self = shift;
return ReadingsNum( $self->{shuttersDev},
return ::ReadingsNum( $self->{shuttersDev},
$FHEM::Automation::ShuttersControl::shutters->getPosCmd, 0 );
}
@ -88,7 +77,7 @@ sub getDelayCmd {
sub getASCenable {
my $self = shift;
return ReadingsVal( $self->{shuttersDev}, 'ASC_Enable', 'on' );
return ::ReadingsVal( $self->{shuttersDev}, 'ASC_Enable', 'on' );
}
1;

View File

@ -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
#
# Special thanks goes to:
@ -47,7 +47,7 @@ use utf8;
use FHEM::Automation::ShuttersControl::Window::Attr;
use FHEM::Automation::ShuttersControl::Window::Readings;
our @ISA =
use base
qw(FHEM::Automation::ShuttersControl::Window::Attr FHEM::Automation::ShuttersControl::Window::Readings);
1;

View File

@ -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
#
# Special thanks goes to:
@ -44,17 +44,6 @@ use strict;
use warnings;
use utf8;
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
AttrVal
gettimeofday)
);
}
sub setSubTyp {
my $self = shift;
my $attrVal = shift;
@ -67,7 +56,8 @@ sub setSubTyp {
sub getSubTyp {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_subType', 'twostate' );
return ::AttrVal( $self->{shuttersDev}, 'ASC_WindowRec_subType',
'twostate' );
}
sub setWinDev {
@ -87,15 +77,15 @@ sub _getWinDev {
exists(
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
2
);
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} =
int( gettimeofday() );
int( ::gettimeofday() );
my ( $device, $reading ) =
FHEM::Automation::ShuttersControl::Helper::GetAttrValues( $self->{shuttersDev},
'ASC_WindowRec', 'none' );
FHEM::Automation::ShuttersControl::Helper::GetAttrValues(
$self->{shuttersDev}, 'ASC_WindowRec', 'none' );
### erwartetes Ergebnis
# DEVICE:READING VALUEACTIVE:VALUEINACTIVE POSACTIVE:POSINACTIVE
@ -116,7 +106,7 @@ sub getWinDevReading {
exists(
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME}
)
&& ( gettimeofday() -
&& ( ::gettimeofday() -
$self->{ $self->{shuttersDev} }->{ASC_WindowRec}->{LASTGETTIME} ) <
2
);

View File

@ -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
#
# Special thanks goes to:
@ -44,20 +44,10 @@ use strict;
use warnings;
use utf8;
use GPUtils qw(GP_Import);
## Import der FHEM Funktionen
BEGIN {
GP_Import(
qw(
ReadingsVal)
);
}
sub getWinStatus {
my $self = shift;
return ReadingsVal(
return ::ReadingsVal(
$FHEM::Automation::ShuttersControl::shutters->_getWinDev,
$FHEM::Automation::ShuttersControl::shutters->getWinDevReading,
'closed' );