From 096e4ab8157752b413966f3c07dd9b0536a4d535 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 17:51:37 +0200 Subject: [PATCH 1/9] Patch beliebigen Fahrbefehl zulassen #53 --- controls_AutoShuttersControl.txt | 6 +- lib/FHEM/Automation/ShuttersControl.pm | 75 +++++++++++-------- .../ShuttersControl/Shutters/Attr.pm | 6 ++ 3 files changed, 54 insertions(+), 33 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 14a5fc4..583b1e5 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,15 +1,15 @@ UPD 2021-10-24_07:33:53 111901 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-24_18:37:41 74468 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-25_17:49:27 75117 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-10-09_07:12:54 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-10-25_09:47:08 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-10-25_10:08:13 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-09_07:12:54 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-25_17:36:18 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm diff --git a/lib/FHEM/Automation/ShuttersControl.pm b/lib/FHEM/Automation/ShuttersControl.pm index 6306833..d308b50 100644 --- a/lib/FHEM/Automation/ShuttersControl.pm +++ b/lib/FHEM/Automation/ShuttersControl.pm @@ -184,9 +184,7 @@ BEGIN { delFromAttrList gettimeofday InternalTimer - RemoveInternalTimer - computeAlignTime - ReplaceEventMap) + RemoveInternalTimer) ); #-- Export to main context with different name @@ -265,6 +263,7 @@ our %userAttrList = ( 'ASC_RainProtection:on,off' => '-', 'ASC_ExternalTrigger' => '-', 'ASC_Adv:on,off' => '-', + 'ASC_CommandTemplate' => '-', 'ASC_SlatPosCmd_SlatDevice' => '-', ); @@ -1769,8 +1768,9 @@ sub _SetCmdFn { . '. Grund der Fahrt: ' . $shutters->getLastDrive ); - my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue; - my $slatPos = -1; + my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue; + my $commandTemplate = $shutters->getCommandTemplte; + my $slatPos = -1; if ( $shutters->getShadingPositionAssignment ne 'none' || $shutters->getOpenPositionAssignment ne 'none' @@ -1822,32 +1822,47 @@ sub _SetCmdFn { } } - CommandSet( undef, - $shuttersDev - . ':FILTER=' - . $shutters->getPosCmd . '!=' - . $posValue . ' ' - . $driveCommand ); + if ( $commandTemplate ne 'none' ) { # Patch von Beta-User Forum https://forum.fhem.de/index.php/topic,123659.0.html + # Nutzervariablen setzen + my %specials = ( + '$name' => $shuttersDev, + '$level' => $posValue, + '$slatLevel' => $slatPos + ); + + $commandTemplate = ::EvalSpecials($commandTemplate, %specials); + # CMD ausführen + ::AnalyzeCommandChain( $h, $commandTemplate ); + } + else { + CommandSet( undef, + $shuttersDev + . ':FILTER=' + . $shutters->getPosCmd . '!=' + . $posValue . ' ' + . $driveCommand ); - InternalTimer( - gettimeofday() + 3, - sub() { - CommandSet( - undef, - ( - $shutters->getSlatDevice ne 'none' - ? $shutters->getSlatDevice - : $shuttersDev - ) - . ' ' - . $shutters->getSlatPosCmd . ' ' - . $slatPos - ); - }, - $shuttersDev - ) - if ( $slatPos > -1 - && $shutters->getSlatPosCmd ne 'none' ); + InternalTimer( + gettimeofday() + 3, + sub() { + CommandSet( + undef, + ( + $shutters->getSlatDevice ne 'none' + ? $shutters->getSlatDevice + : $shuttersDev + ) + . ' ' + . $shutters->getSlatPosCmd . ' ' + . $slatPos + ); + }, + $shuttersDev + ) + if ( $slatPos > -1 + && $shutters->getSlatPosCmd ne 'none' ); + + } $shutters->setSelfDefenseAbsent( 0, 0 ) if (!$shutters->getSelfDefenseAbsent diff --git a/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm b/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm index 00aba3a..46c4b12 100644 --- a/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +++ b/lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm @@ -516,6 +516,12 @@ sub getSelfDefenseAbsentDelay { return AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_AbsentDelay', 300 ); } +sub getCommandTemplate { + my $self = shift; + + return AttrVal( $self->{shuttersDev}, 'ASC_CommandTemplate', 'none' ); +} + sub setWiggleValue { my $self = shift; my $attrVal = shift; -- 2.47.2 From e037a128792742f0077348901156a1eeb7641239 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 17:58:08 +0200 Subject: [PATCH 2/9] change version --- FHEM/73_AutoShuttersControl.pm | 2 +- controls_AutoShuttersControl.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index 8c513d0..e912430 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -1436,7 +1436,7 @@ __END__ ], "release_status": "stable", "license": "GPL_2", - "version": "v0.10.17", + "version": "v0.10.18", "author": [ "Marko Oldenburg " ], diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 583b1e5..bf04726 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,4 +1,4 @@ -UPD 2021-10-24_07:33:53 111901 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-25_17:57:44 111901 FHEM/73_AutoShuttersControl.pm UPD 2021-10-25_17:49:27 75117 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm -- 2.47.2 From 3d7f9fcf9257cf3373804f22d97a45226b6cd50b Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 18:24:17 +0200 Subject: [PATCH 3/9] add commandref enrty for ASC_CommandTemplate Attribut --- FHEM/73_AutoShuttersControl.pm | 21 +++++++++++++++++++++ controls_AutoShuttersControl.txt | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index e912430..052d179 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -639,6 +639,16 @@ __END__
  • ASC_SlatPosCmd_SlatDevice - 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: attr ROLLO ASC_SlatPosCmd_SlatDevice slatPct or attr ROLLO ASC_SlatPosCmd_SlatDevice dim:ROLLOSLATDEVICE. 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 ASC_Open_Pos, ASC_Closed_Pos, ASC_Ventilate_Pos, ASC_ComfortOpen_Pos, ASC_Shading_Pos and ASC_Sleep_Pos.
  • + +
  • ASC_CommandTemplate - FHEM or Perl command (Perl in braces as usual needs escaping semicolons etc.). The parameters $name (name of the shutter device), $level (target position for the respective drive command) and $slatLevel (target position for the (rurnable) lammellas in venetion blinds) will be replaced by the appropirate values. You may have to take care to avoid unneeded driving commands. + Examples: +
      +
    • attr ROLLO ASC_CommandTemplate set $name $level - Address the position command directly to the main switch of the device
    • +
    • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - combined positioning command, e.g. appropriate for HM-IP-venetian blind type actors
    • +
    • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - positioning command with Perl calculation and additional "execute" command, e.g. for an SPS type blind
    • +
    + Note: ASC_CommandTemplate is meant for some rare and special cases. In most cases there's no need to set this attribute! +
  • ASC_WindowRec_PosAfterDayClosed - open,lastManual / auf welche Position soll das Rollo nach dem schließen am Tag fahren. Open Position oder letzte gespeicherte manuelle Position (default: open)
  • @@ -1157,6 +1167,17 @@ __END__
  • ASC_WindowRec_subType - Typ des verwendeten Fensterkontaktes: twostate (optisch oder magnetisch) oder threestate (Drehgriffkontakt) (default: twostate)
  • ASC_SlatPosCmd_SlatDevice - Angaben zu einem Slat (Lamellen) CMD und - sofern diese Lamellen über ein anderes Device gesteuert werden - zum Slat Device. Beispiele: attr ROLLO ASC_SlatPosCmd_SlatDevice slatPct oder attr ROLLO ASC_SlatPosCmd_SlatDevice dim:ROLLOSLATDEVICE. 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ür die Lamellenstellung mit angegeben werden.
  • + +
  • ASC_CommandTemplate - FHEM-Kommando(s) oder Perl-Anweisung (in geschweiften Klammern unter Beachtung der üblichen Regeln für das escapen von Semicolons etc.). Die Variablen $name (der Name des Rollladen-Devices), $level (die Zielposition des Fahrbefehls) und $slatLevel (die Zielposition des Fahrbefehls für eventuelle Lamellen) werden durch die ermittelten Werte ersetzt, es muss selbst dafür gesorgt werden, dass eventuell unnötige Fahrbefehle aussortiert werden. + Beispiele: +
      +
    • attr ROLLO ASC_CommandTemplate set $name $level - Positionsbefehl direkt an Gerät + setzen
    • +
    • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - Positionsbefehl und Lamellen-Ansteuerung für HM-IP-Jalousieaktoren
    • +
    • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - Positionsbefehl für eine SPS in Perl umrechnen
    • +
    + Hinweis: ASC_CommandTemplate ist für seltene und spezielle Fälle gedacht. In der Regel ist es nicht erforderlich, dieses Attribut zu setzen! +
  • diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index bf04726..83075f5 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,4 +1,4 @@ -UPD 2021-10-25_17:57:44 111901 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-25_18:23:02 114585 FHEM/73_AutoShuttersControl.pm UPD 2021-10-25_17:49:27 75117 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm -- 2.47.2 From f2b7e8490f50662e96a382ba180ff9d4d43bf32b Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 18:43:30 +0200 Subject: [PATCH 4/9] fix Can't locate object method "getCommandTemplte" --- controls_AutoShuttersControl.txt | 2 +- lib/FHEM/Automation/ShuttersControl.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 83075f5..39b1d45 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,5 +1,5 @@ UPD 2021-10-25_18:23:02 114585 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-25_17:49:27 75117 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-25_18:43:16 75118 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm diff --git a/lib/FHEM/Automation/ShuttersControl.pm b/lib/FHEM/Automation/ShuttersControl.pm index d308b50..40efaa4 100644 --- a/lib/FHEM/Automation/ShuttersControl.pm +++ b/lib/FHEM/Automation/ShuttersControl.pm @@ -1769,7 +1769,7 @@ sub _SetCmdFn { . $shutters->getLastDrive ); my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue; - my $commandTemplate = $shutters->getCommandTemplte; + my $commandTemplate = $shutters->getCommandTemplate; my $slatPos = -1; if ( $shutters->getShadingPositionAssignment ne 'none' -- 2.47.2 From a9a47f9e7020a83791d309a947cee3fa26dea6e6 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 19:25:13 +0200 Subject: [PATCH 5/9] fix ASC_BlockingTime_beforNightClose wird bei Regen(-schutz) ignoriert --- controls_AutoShuttersControl.txt | 10 +++++----- .../ShuttersControl/Rainprotection.pm | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 14a5fc4..8b7c62f 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,16 +1,16 @@ -UPD 2021-10-24_07:33:53 111901 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-24_18:37:41 74468 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-25_19:20:36 111901 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-25_19:20:36 74468 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-10-09_07:12:54 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-10-25_09:47:08 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-10-25_10:08:13 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-09_07:12:54 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-25_19:20:36 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-10-24_07:33:53 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-10-25_19:24:27 6716 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm diff --git a/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm b/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm index 542901d..d6dab57 100644 --- a/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +++ b/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm @@ -133,11 +133,13 @@ sub _RainProtected { $FHEM::Automation::ShuttersControl::shutters->setLastDrive( 'rain protected'); - $FHEM::Automation::ShuttersControl::shutters->setDriveCmd( - $FHEM::Automation::ShuttersControl::ascDev - ->getRainSensorShuttersClosedPos); - $FHEM::Automation::ShuttersControl::shutters - ->setRainProtectionStatus('protected'); + + $FHEM::Automation::ShuttersControl::shutters->setDriveCmd( + $FHEM::Automation::ShuttersControl::ascDev + ->getRainSensorShuttersClosedPos); + + $FHEM::Automation::ShuttersControl::shutters + ->setRainProtectionStatus('protected'); } sub _RainUnprotected { @@ -168,10 +170,11 @@ sub _RainUnprotected { ->getClosedPos ) ) - ); + ) + if (IsAfterShuttersTimeBlocking($shuttersDev)); - $FHEM::Automation::ShuttersControl::shutters - ->setRainProtectionStatus('unprotected'); + $FHEM::Automation::ShuttersControl::shutters + ->setRainProtectionStatus('unprotected'); } -- 2.47.2 From 98edf0c5f6c23f1d4173292b3486ed05efe174f9 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 25 Oct 2021 19:54:51 +0200 Subject: [PATCH 6/9] change commandref --- FHEM/73_AutoShuttersControl.pm | 3 +++ controls_AutoShuttersControl.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index 052d179..7bcea5a 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -644,6 +644,7 @@ __END__ Examples:
    • attr ROLLO ASC_CommandTemplate set $name $level - Address the position command directly to the main switch of the device
    • +
    • attr ROLLO ASC_CommandTemplate set $name pct $level - Address the position command directly to the main switch of the device
    • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - combined positioning command, e.g. appropriate for HM-IP-venetian blind type actors
    • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - positioning command with Perl calculation and additional "execute" command, e.g. for an SPS type blind
    @@ -1173,6 +1174,8 @@ __END__
    • attr ROLLO ASC_CommandTemplate set $name $level - Positionsbefehl direkt an Gerät setzen
    • +
    • attr ROLLO ASC_CommandTemplate set $name pct $level - Positionsbefehl direkt an Gerät + setzen
    • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - Positionsbefehl und Lamellen-Ansteuerung für HM-IP-Jalousieaktoren
    • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - Positionsbefehl für eine SPS in Perl umrechnen
    diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 39b1d45..6e504d3 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,5 +1,5 @@ -UPD 2021-10-25_18:23:02 114585 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-25_18:43:16 75118 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-25_19:54:19 114872 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-25_19:29:35 75118 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm @@ -9,8 +9,8 @@ UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-25_17:36:18 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-25_19:29:35 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-10-24_07:33:53 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-10-25_19:29:35 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm -- 2.47.2 From 75f5b6bf01162cc03bfa93550b16f96524a32704 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 26 Oct 2021 14:05:06 +0200 Subject: [PATCH 7/9] add drive reason to CommandTemplte varibales --- controls_AutoShuttersControl.txt | 8 ++++---- lib/FHEM/Automation/ShuttersControl.pm | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 6e504d3..33f9654 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,5 +1,5 @@ -UPD 2021-10-25_19:54:19 114872 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-25_19:29:35 75118 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-26_14:03:13 114872 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-26_14:03:57 75174 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm @@ -9,8 +9,8 @@ UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-25_19:29:35 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-26_14:03:13 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-10-25_19:29:35 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-10-26_14:03:13 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm diff --git a/lib/FHEM/Automation/ShuttersControl.pm b/lib/FHEM/Automation/ShuttersControl.pm index 40efaa4..d78fc6f 100644 --- a/lib/FHEM/Automation/ShuttersControl.pm +++ b/lib/FHEM/Automation/ShuttersControl.pm @@ -1827,7 +1827,8 @@ sub _SetCmdFn { my %specials = ( '$name' => $shuttersDev, '$level' => $posValue, - '$slatLevel' => $slatPos + '$slatLevel' => $slatPos, + '$reason' => $shutters->getLastDrive ); $commandTemplate = ::EvalSpecials($commandTemplate, %specials); -- 2.47.2 From 9409c60400a517e770d38cd1476597c258aa93e9 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 26 Oct 2021 19:29:29 +0200 Subject: [PATCH 8/9] change ASC_BlockingTime_beforNightClose and ASC_BlockingTime_beforDayOpen Attributs --- FHEM/73_AutoShuttersControl.pm | 14 +++++++------- controls_AutoShuttersControl.txt | 8 ++++---- lib/FHEM/Automation/ShuttersControl.pm | 22 +++++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index 8c513d0..aa0173a 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -416,11 +416,11 @@ __END__ after the last manual operation in seconds. Defaults to 1200 (20 minutes). -
  • ASC_BlockingTime_beforDayOpen - Time in which no closing operation is made by +
  • ASC_BlockingTime_beforeDayOpen - Time in which no closing operation is made by ASC after opening at the morning in seconds. Defaults to 3600 (one hour).
  • - -
  • ASC_BlockingTime_beforNightClose - Time in which no closing operation is made by + +
  • ASC_BlockingTime_beforeNightClose - Time in which no closing operation is made by ASC before closing at the evening in seconds. Defaults to 3600 (one hour).
  • @@ -1028,10 +1028,10 @@ __END__
  • ASC_AutoAstroModeMorningHorizon - Höhe über Horizont,a wenn beim Attribut ASC_autoAstroModeMorning HORIZON ausgewählt (default: none)
  • ASC_BlockingTime_afterManual - wie viel Sekunden soll die Automatik nach einer manuellen Fahrt aussetzen. (default: 1200)
  • - -
  • ASC_BlockingTime_beforDayOpen - wie viel Sekunden vor dem morgendlichen öffnen soll keine schließen Fahrt mehr stattfinden. (default: 3600)
  • - -
  • ASC_BlockingTime_beforNightClose - wie viel Sekunden vor dem nächtlichen schließen soll keine öffnen Fahrt mehr stattfinden. (default: 3600)
  • + +
  • ASC_BlockingTime_beforeDayOpen - wie viel Sekunden vor dem morgendlichen öffnen soll keine schließen Fahrt mehr stattfinden. (default: 3600)
  • + +
  • ASC_BlockingTime_beforeNightClose - wie viel Sekunden vor dem nächtlichen schließen soll keine öffnen Fahrt mehr stattfinden. (default: 3600)
  • ASC_BrightnessSensor - DEVICE[:READING] WERT-MORGENS:WERT-ABENDS / 'Sensorname[:brightness [400:800]]' Angaben zum Helligkeitssensor mit (Readingname, optional) für die Beschattung und dem Fahren der Rollladen nach brightness und den optionalen Brightnesswerten für Sonnenauf- und Sonnenuntergang. (default: none)
  • diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 8b7c62f..1fde362 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,5 +1,5 @@ -UPD 2021-10-25_19:20:36 111901 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-25_19:20:36 74468 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-26_19:29:13 111908 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-26_19:27:16 74553 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm @@ -9,8 +9,8 @@ UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-25_19:20:36 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-26_18:45:03 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-10-25_19:24:27 6716 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-10-26_18:45:03 6716 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm diff --git a/lib/FHEM/Automation/ShuttersControl.pm b/lib/FHEM/Automation/ShuttersControl.pm index 6306833..5b055e2 100644 --- a/lib/FHEM/Automation/ShuttersControl.pm +++ b/lib/FHEM/Automation/ShuttersControl.pm @@ -229,8 +229,8 @@ our %userAttrList = ( 'ASC_LockOut:soft,hard,off' => '-', 'ASC_LockOut_Cmd:inhibit,blocked,protection' => '-', 'ASC_BlockingTime_afterManual' => '-', - 'ASC_BlockingTime_beforNightClose' => '-', - 'ASC_BlockingTime_beforDayOpen' => '-', + 'ASC_BlockingTime_beforeNightClose' => '-', + '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' => '-', @@ -1227,15 +1227,15 @@ sub RenewSunRiseSetShuttersTimer { 1, 0 ); } -# $attr{$shuttersDev}{ASC_Drive_Delay} = -# AttrVal( $shuttersDev, 'ASC_Drive_Offset', 'none' ) -# if ( AttrVal( $shuttersDev, 'ASC_Drive_Offset', 'none' ) ne 'none' ); -# delFromDevAttrList( $shuttersDev, 'ASC_Drive_Offset' ); -# -# $attr{$shuttersDev}{ASC_Drive_DelayStart} = -# AttrVal( $shuttersDev, 'ASC_Drive_OffsetStart', 'none' ) -# if ( AttrVal( $shuttersDev, 'ASC_Drive_OffsetStart', 'none' ) ne 'none' ); -# delFromDevAttrList( $shuttersDev, 'ASC_Drive_OffsetStart' ); + $attr{$shuttersDev}{ASC_BlockingTime_beforeNightClose} = + AttrVal( $shuttersDev, 'ASC_BlockingTime_beforNightClose', 'none' ) + if ( AttrVal( $shuttersDev, 'ASC_BlockingTime_beforNightClose', 'none' ) ne 'none' ); + delFromDevAttrList( $shuttersDev, 'ASC_BlockingTime_beforNightClose' ); + + $attr{$shuttersDev}{ASC_BlockingTime_beforeDayOpen} = + AttrVal( $shuttersDev, 'ASC_BlockingTime_beforDayOpen', 'none' ) + if ( AttrVal( $shuttersDev, 'ASC_BlockingTime_beforDayOpen', 'none' ) ne 'none' ); + delFromDevAttrList( $shuttersDev, 'ASC_BlockingTime_beforDayOpen' ); # # $attr{$shuttersDev}{ASC_Shading_StateChange_SunnyCloudy} = # AttrVal( $shuttersDev, 'ASC_Shading_StateChange_Sunny', 'none' ) . ':' -- 2.47.2 From 5ccceaba16a382f280c0efd0f5d725be50fb1cd8 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 26 Oct 2021 19:42:19 +0200 Subject: [PATCH 9/9] add example with owner perlfunction for ASC_CommandTemplate --- FHEM/73_AutoShuttersControl.pm | 2 ++ controls_AutoShuttersControl.txt | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index 7bcea5a..0405ec9 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -647,6 +647,7 @@ __END__
  • attr ROLLO ASC_CommandTemplate set $name pct $level - Address the position command directly to the main switch of the device
  • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - combined positioning command, e.g. appropriate for HM-IP-venetian blind type actors
  • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - positioning command with Perl calculation and additional "execute" command, e.g. for an SPS type blind
  • +
  • attr ROLLO ASC_CommandTemplate myPerlCode("$name", $level, $slatLevel) - positioning command from perlfunction
  • Note: ASC_CommandTemplate is meant for some rare and special cases. In most cases there's no need to set this attribute! @@ -1178,6 +1179,7 @@ __END__ setzen
  • attr ROLLO ASC_CommandTemplate set $name datapoint 4.LEVEL_2 $slatLevel 4.LEVEL $level - Positionsbefehl und Lamellen-Ansteuerung für HM-IP-Jalousieaktoren
  • attr ROLLO ASC_CommandTemplate { fhem("set $name ".($level+1024)).";set $name 0")} - Positionsbefehl für eine SPS in Perl umrechnen
  • +
  • attr ROLLO ASC_CommandTemplate myPerlCode("$name", $level, $slatLevel) - Positionsbefehl aus eigener Perlfunktion
  • Hinweis: ASC_CommandTemplate ist für seltene und spezielle Fälle gedacht. In der Regel ist es nicht erforderlich, dieses Attribut zu setzen! diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 33f9654..4ee6622 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,5 +1,5 @@ -UPD 2021-10-26_14:03:13 114872 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-26_14:03:57 75174 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-10-26_19:41:58 115153 FHEM/73_AutoShuttersControl.pm +UPD 2021-10-26_19:36:07 75174 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm @@ -9,8 +9,8 @@ UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm -UPD 2021-10-26_14:03:13 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm +UPD 2021-10-26_19:36:07 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-10-26_14:03:13 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-10-26_19:36:07 6693 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm -- 2.47.2