fix selfdefense

change selfdefense condition in SunRiseShuttersAfterTimerFn
This commit is contained in:
Marko Oldenburg 2022-12-15 09:56:26 +01:00
parent cd1c2c104a
commit cc5ef41e21
2 changed files with 31 additions and 27 deletions

View File

@ -1,5 +1,5 @@
UPD 2022-08-29_13:31:39 116288 FHEM/73_AutoShuttersControl.pm UPD 2022-12-15_09:41:38 116288 FHEM/73_AutoShuttersControl.pm
UPD 2022-08-30_18:07:51 76465 lib/FHEM/Automation/ShuttersControl.pm UPD 2022-12-15_09:55:10 76615 lib/FHEM/Automation/ShuttersControl.pm
UPD 2022-01-14_08:49:13 2691 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2022-01-14_08:49:13 2691 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2022-01-14_08:49:13 2677 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2022-01-14_08:49:13 2677 lib/FHEM/Automation/ShuttersControl/Roommate.pm
UPD 2022-03-05_09:12:41 32016 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2022-03-05_09:12:41 32016 lib/FHEM/Automation/ShuttersControl/Shutters.pm

View File

@ -80,7 +80,7 @@ use FHEM::Automation::ShuttersControl::Dev;
use FHEM::Automation::ShuttersControl::Shading use FHEM::Automation::ShuttersControl::Shading
qw (CheckASC_ConditionsForShadingFn); qw (CheckASC_ConditionsForShadingFn);
use FHEM::Automation::ShuttersControl::EventProcessingFunctions qw (:ALL); use FHEM::Automation::ShuttersControl::EventProcessingFunctions qw (:ALL);
use FHEM::Automation::ShuttersControl::Helper qw (:ALL); use FHEM::Automation::ShuttersControl::Helper qw (:ALL);
# try to use JSON::MaybeXS wrapper # try to use JSON::MaybeXS wrapper
# for chance of better performance + open code # for chance of better performance + open code
@ -167,7 +167,7 @@ BEGIN {
ascAPIget ascAPIget
ascAPIset ascAPIset
DevStateIcon DevStateIcon
) )
); );
} }
@ -187,24 +187,24 @@ our %userAttrList = (
'ASC_Open_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', 0, 100 ], 'ASC_Open_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', 0, 100 ],
'ASC_Closed_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', 100, 0 ], 'ASC_Closed_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', 100, 0 ],
'ASC_Sleep_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', -1, -1 ], 'ASC_Sleep_Pos:0,10,20,30,40,50,60,70,80,90,100' => [ '', -1, -1 ],
'ASC_Pos_Reading' => [ '', 'position', 'pct' ], 'ASC_Pos_Reading' => [ '', 'position', 'pct' ],
'ASC_Time_Up_Early' => '-', 'ASC_Time_Up_Early' => '-',
'ASC_Time_Up_Late' => '-', 'ASC_Time_Up_Late' => '-',
'ASC_Time_Up_WE_Holiday' => '-', 'ASC_Time_Up_WE_Holiday' => '-',
'ASC_Time_Down_Early' => '-', 'ASC_Time_Down_Early' => '-',
'ASC_Time_Down_Late' => '-', 'ASC_Time_Down_Late' => '-',
'ASC_PrivacyUpValue_beforeDayOpen' => '-', 'ASC_PrivacyUpValue_beforeDayOpen' => '-',
'ASC_PrivacyDownValue_beforeNightClose' => '-', 'ASC_PrivacyDownValue_beforeNightClose' => '-',
'ASC_PrivacyUp_Pos' => [ '', 50, 50 ], 'ASC_PrivacyUp_Pos' => [ '', 50, 50 ],
'ASC_PrivacyDown_Pos' => [ '', 50, 50 ], 'ASC_PrivacyDown_Pos' => [ '', 50, 50 ],
'ASC_TempSensor' => '-', 'ASC_TempSensor' => '-',
'ASC_Ventilate_Window_Open:on,off' => '-', 'ASC_Ventilate_Window_Open:on,off' => '-',
'ASC_LockOut:soft,hard,off' => '-', 'ASC_LockOut:soft,hard,off' => '-',
'ASC_LockOut_Cmd:inhibit,blocked,protection' => '-', 'ASC_LockOut_Cmd:inhibit,blocked,protection' => '-',
'ASC_BlockingTime_afterManual' => '-', 'ASC_BlockingTime_afterManual' => '-',
'ASC_BlockingTime_beforeNightClose' => '-', 'ASC_BlockingTime_beforeNightClose' => '-',
'ASC_BlockingTime_beforeDayOpen' => '-', 'ASC_BlockingTime_beforeDayOpen' => '-',
'ASC_BrightnessSensor' => '-', 'ASC_BrightnessSensor' => '-',
'ASC_Shading_Pos:10,20,30,40,50,60,70,80,90,100' => [ '', 80, 20 ], 'ASC_Shading_Pos:10,20,30,40,50,60,70,80,90,100' => [ '', 80, 20 ],
'ASC_Shading_Mode:absent,always,off,home' => '-', 'ASC_Shading_Mode:absent,always,off,home' => '-',
'ASC_Shading_InOutAzimuth' => '-', 'ASC_Shading_InOutAzimuth' => '-',
@ -1447,10 +1447,14 @@ sub SunRiseShuttersAfterTimerFn {
|| $shutters->getSelfDefenseMode eq 'off' || $shutters->getSelfDefenseMode eq 'off'
|| ( || (
$ascDev->getSelfDefense eq 'on' $ascDev->getSelfDefense eq 'on'
&& ( $shutters->getSelfDefenseMode eq 'gone' && (
|| $shutters->getSelfDefenseMode eq 'absent' ) (
&& $ascDev->getResidentsStatus ne 'gone' $shutters->getSelfDefenseMode eq 'gone'
&& $ascDev->getResidentsStatus ne 'absent' && $ascDev->getResidentsStatus ne 'gone'
)
|| ( $shutters->getSelfDefenseMode eq 'absent'
&& $ascDev->getResidentsStatus ne 'absent' )
)
) )
) )
&& ( && (
@ -1849,7 +1853,7 @@ sub SetCmdFn {
if ( $commandTemplate ne 'none' ) if ( $commandTemplate ne 'none' )
{ # Patch von Beta-User Forum https://forum.fhem.de/index.php/topic,123659.0.html { # Patch von Beta-User Forum https://forum.fhem.de/index.php/topic,123659.0.html
# Nutzervariablen setzen # Nutzervariablen setzen
my %specials = ( my %specials = (
'$name' => $shuttersDev, '$name' => $shuttersDev,
'$pos' => $posValue, '$pos' => $posValue,