Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/FHEM/Automation/ShuttersControl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ BEGIN {
## Die Attributsliste welche an die Rolläden verteilt wird. Zusammen mit Default Werten
##no critic
our %userAttrList = (
'ASC_Mode_Up:absent,always,off,home' => '-',
'ASC_Mode_Down:absent,always,off,home' => '-',
'ASC_Mode_Up:absent,always,off,home,gone' => '-',
'ASC_Mode_Down:absent,always,off,home,gone' => '-',
'ASC_Up:time,astro,brightness,roommate' => '-',
'ASC_Down:time,astro,brightness,roommate' => '-',
'ASC_AutoAstroModeMorning:REAL,CIVIL,NAUTIC,ASTRONOMIC,HORIZON' => '-',
Expand Down Expand Up @@ -207,7 +207,7 @@ our %userAttrList = (
'ASC_BlockingTime_beforeDayOpen' => '-',
'ASC_BrightnessSensor' => '-',
'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,gone' => '-',
'ASC_Shading_InOutAzimuth' => '-',
'ASC_Shading_StateChange_SunnyCloudy' => '-',
'ASC_Shading_MinMax_Elevation' => '-',
Expand Down Expand Up @@ -1925,9 +1925,15 @@ sub ASC_Debug {
my $debugMsg = shift;
my $debugTimestamp = strftime( "%Y.%m.%d %T", localtime(time) );

# print(
# encode_utf8(
# "\n" . 'ASC_DEBUG!!! ' . $debugTimestamp . ' - ' . $debugMsg . "\n"
# )
# );

print(
encode_utf8(
"\n" . 'ASC_DEBUG!!! ' . $debugTimestamp . ' - ' . $debugMsg . "\n"
'ASC_DEBUG!!! ' . $debugTimestamp . ' - ' . $debugMsg . "\n"
)
);

Expand Down
102 changes: 96 additions & 6 deletions lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,12 @@ sub EventProcessingWindowRec {
|| $homemode eq 'none' )
&& $FHEM::Automation::ShuttersControl::shutters->getModeUp ne
'absent'
&& $FHEM::Automation::ShuttersControl::shutters->getModeUp ne
'off'
# disabled by postfux to also drive from Ventialte Position when
# WindowContact closes, even if ModeDown is off.
# there is not such check when WindowContact ist opened
# so it always drives to Ventilate Position.
# && $FHEM::Automation::ShuttersControl::shutters->getModeUp ne
# 'off'
)
{
if (
Expand Down Expand Up @@ -477,8 +481,12 @@ sub EventProcessingWindowRec {
elsif (
$FHEM::Automation::ShuttersControl::shutters->getModeDown ne
'absent'
&& $FHEM::Automation::ShuttersControl::shutters->getModeDown ne
'off'
# disabled by postfux to also drive from Ventialte Position when
# WindowContact closes, even if ModeDown is off.
# there is not such check when WindowContact ist opened
# so it always drives to Ventilate Position.
# && $FHEM::Automation::ShuttersControl::shutters->getModeDown ne
# 'off'
&& (
(
!$FHEM::Automation::ShuttersControl::shutters->getIsDay
Expand Down Expand Up @@ -618,7 +626,7 @@ sub EventProcessingRoommate {
my $reading =
$FHEM::Automation::ShuttersControl::shutters->getRoommatesReading;

if ( $events =~ m{$reading:\s(absent|gotosleep|asleep|awoken|home)}xms ) {
if ( $events =~ m{$reading:\s(absent|gotosleep|asleep|awoken|home|gone)}xms ) {
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate: "
. $FHEM::Automation::ShuttersControl::shutters
Expand Down Expand Up @@ -721,6 +729,9 @@ sub EventProcessingRoommate {
&& $getRoommatesStatus eq 'home'
)
{
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate_3: $shuttersDev und Events $events"
);
if (
$getIsDay
&& $FHEM::Automation::ShuttersControl::shutters
Expand All @@ -737,6 +748,10 @@ sub EventProcessingRoommate {
)
&& !$FHEM::Automation::ShuttersControl::shutters
->getSelfDefenseState
&& (($FHEM::Automation::ShuttersControl::shutters
->getShadingMode eq 'home' ) )
# added by postfux only when ShadingMode is home
# and not when absent or gone.
)
{
ShadingProcessingDriveCommand( $hash, $shuttersDev, 1 );
Expand Down Expand Up @@ -971,8 +986,83 @@ sub EventProcessingRoommate {
"AutoShuttersControl ($name) - EventProcessingRoommate NICHTS: $shuttersDev"
);
}
}
elsif ( #postfux added rommate gone condition
$event eq 'gone'
&& ( !$getIsDay
|| $getDown eq 'roommate'
|| $FHEM::Automation::ShuttersControl::shutters->getShadingMode
eq 'gone'
|| $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
'gone'
|| $FHEM::Automation::ShuttersControl::shutters->getModeDown eq
'gone' )
)
{
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate gone: $shuttersDev"
);

if (
$getIsDay
&& $FHEM::Automation::ShuttersControl::shutters->getIfInShading
&& !$FHEM::Automation::ShuttersControl::shutters
->getQueryShuttersPos(
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
)
&& $FHEM::Automation::ShuttersControl::shutters->getShadingMode
eq 'gone'
)
{
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate Shading: $shuttersDev"
);

$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
'shading in');
FHEM::Automation::ShuttersControl::ShuttersCommandSet(
$hash,
$shuttersDev,
$FHEM::Automation::ShuttersControl::shutters->getShadingPos
);
}
elsif (( !$getIsDay || $getDown eq 'roommate' )
&& $getModeDown eq 'gone'
&& $getRoommatesStatus eq 'gone' )
{
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate Down: $shuttersDev"
);

$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
'roommate gone');
FHEM::Automation::ShuttersControl::ShuttersCommandSet(
$hash,
$shuttersDev,
$FHEM::Automation::ShuttersControl::shutters->getClosedPos
);
}
elsif ($getIsDay
&& $FHEM::Automation::ShuttersControl::shutters->getModeUp eq
'gone'
&& $getRoommatesStatus eq 'gone' )
{
::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate Up: $shuttersDev"
);

$FHEM::Automation::ShuttersControl::shutters->setLastDrive(
'roommate gone');
FHEM::Automation::ShuttersControl::ShuttersCommandSet( $hash,
$shuttersDev,
$FHEM::Automation::ShuttersControl::shutters->getOpenPos );
}

::Log3( $name, 4,
"AutoShuttersControl ($name) - EventProcessingRoommate NICHTS: $shuttersDev"
);
} #end postfux added rommate gone condition
}

return;
}

Expand Down