diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm
index 4cc1c64bf..fb5720fcf 100644
--- a/fhem/FHEM/98_WeekdayTimer.pm
+++ b/fhem/FHEM/98_WeekdayTimer.pm
@@ -1214,7 +1214,7 @@ sub Switch_Device {
$attr{$name}{commandTemplate} =
'set $NAME ' . $setModifier . '$EVENT' if !defined $attr{$name}{commandTemplate};
- $command = AttrVal($hash->{NAME}, 'commandTemplate', 'commandTemplate not found');
+ $command = AttrVal($name, 'commandTemplate', 'commandTemplate not found');
$command = 'set $NAME $EVENT' if defined $hash->{WDT_EVENTMAP} && defined $hash->{WDT_EVENTMAP}{$newParam};
$command = $hash->{COMMAND} if defined $hash->{COMMAND} && $hash->{COMMAND} ne '';
@@ -1506,16 +1506,13 @@ __END__
Example for a weekprofile definition using sunday profile for all $we days, giving exclusive priority to the $we profile:
weekprofile:<weekprofile-device-name>:true
NOTE: only temperature profiles can be set via weekprofile, but they have the advantage of possible updates from weekprofile side (including the use of so-called topics) or via the command:
- set <device> weekprofile <weekprofile-device:topic:profile>
+ set <device> weekprofile <weekprofile-device:topic:profile>
-
command
- If no condition is set, all the rest is interpreted as a command. Perl-code is setting up
- by the well-known Block with {}.
- Note: if a command is defined only this command is executed. In case of executing
+ If no condition is set, all the rest is interpreted as a command. Perl-code is setting upby the well-known Block with {}.
+ Note: if a command is defined only this command is executed. In case of executing
a "set desired-temp" command, you must define the hole commandpart explicitly by yourself.
-
-
+ If no explicit command is provided, commandTemplate attribute will indicate the command; this may be a simple set $NAME $EVENT or some variation wrt. to the device beeing recognized as heating type (see WDT_eventMap for even more options!).
The following parameter are replaced:
@@ -1584,7 +1581,6 @@ __END__
enable # enables the WeekdayTimer, switching times will be recaltulated.
WDT_Params [one of: single, WDT_Group or all]
weekprofile <weekprofile-device:topic:profile>
-
You may especially use enable in case one of your global holiday2we devices has changed since 5 seconds past midnight.
Examples:
@@ -1592,8 +1588,8 @@ __END__
set wd disable
set wd enable
set wd WDT_Params WDT_Group
- set wd weekprofile myWeekprofiles:holiday:livingrooms
-
+ set wd weekprofile myWeekprofiles:holiday:livingrooms
+
-
The WDT_Params function can be used to reapply the current switching value to the device, all WDT devices with identical WDT_Group attribute or all WeekdayTimer devices; delay conditions will be obeyed, for non-heating type devices, switchInThePast has to be set.
@@ -1605,14 +1601,14 @@ __END__
-
The weekprofile set will only be successfull, if the <weekprofile-device> is part of the definition of the WeekdayTimer, the mentionned device exists and it provides data for the <topic:profile> combination. If you haven't activated the "topic" feature in the weekprofile device, use "default" as topic.
- - Once you set a weekprofile for any weekprofile device, you'll find the values set in the reading named "weekprofiles"; for each weekprofile device there's an entry with the set triplett.
- - As WeekdayTimer will recalculate the switching times for each day a few seconds after midnight, 10 minutes pas midnight will be used as a first switching time for weekpofile usage.
- - This set is the way the weekprofile module uses to update a WeekdayTimer device. So aforementioned WeekdayTimer command
+ - Once you set a weekprofile for any weekprofile device, you'll find the values set in the reading named "weekprofiles"; for each weekprofile device there's an entry with the set triplett.
+ - As WeekdayTimer will recalculate the switching times for each day a few seconds after midnight, 10 minutes pas midnight will be used as a first switching time for weekpofile usage.
+ - This set is the way the weekprofile module uses to update a WeekdayTimer device. So aforementioned WeekdayTimer command
set wd weekprofile myWeekprofiles:holiday:livingrooms
is aequivalent to weekprofile command
set myWeekprofiles send_to_device holiday:livingrooms wd
- - Although it's possible to use more than one weekprofile device in a WeekdayTimer, this is explicitly not recommended unless you are exactly knowing what you are doing.
+ - Although it's possible to use more than one weekprofile device in a WeekdayTimer, this is explicitly not recommended unless you are exactly knowing what you are doing.
- Note: The userattr weekprofile will automatically be added to the list and can't be removed. The attribute itself is intended to be set to the corresponding profile name (no topic name, just the second part behind the ":") in your weekprofile device allowing easy change using the topic feature.
@@ -1626,35 +1622,29 @@ __END__
delayedExecutionCond
defines a delay Function. When returning true, the switching of the device is delayed until the function returns a false value. The behavior is the same as if one of the WDT_delayedExecutionDevices returns "open".
-
-
+
Example:
-
- attr wd delayedExecutionCond isDelayed("$WEEKDAYTIMER","$TIME","$NAME","$EVENT")
-
- the parameter $WEEKDAYTIMER(timer name) $TIME $NAME(device name) $EVENT are replaced at runtime by the correct value.
-
Note: If the function returns "1" or "true", state of the WeekdayTimer will be "open window", other return values will be used as values for state.
+ attr wd delayedExecutionCond isDelayed("$WEEKDAYTIMER","$TIME","$NAME","$EVENT")
+ The parameters $WEEKDAYTIMER (timer name), $TIME, $NAME (device name) and $EVENT will be replaced at runtime by the correct value.
+
Note: If the function returns "1" or "true", state of the WeekdayTimer will be "open window", other return values will be used as values for state.
Example of a function:
-
- sub isDelayed($$$$) {
+ sub isDelayed($$$$) {
my($wdt, $tim, $nam, $event ) = @_;
-
my $theSunIsStillshining = ...
-
return ($tim eq "16:30" && $theSunIsStillshining) ;
- }
-
-
+ }
+
+
+ commandTemplate
+ If no explicit command is provided, you may change change the indicated defaults here (see also WDT_eventMap for even more options on how to modify command or $EVENT).
WDT_delayedExecutionDevices
May contain a space separated list of devices (atm. only window sensors are supported). When one of them states to be open (typical reading names and values are known) the aktual switch is delayed, until either the window is closed or the next switching time is reached (this one will also be delayed). This is especially intended to prevent heating commands while windows are opened.
-
+
WDT_Group
Used to generate groups of WeekdayTimer devices to be switched together in case one of them is set to WDT_Params with the WDT_Group modifier, e.g. set wd WDT_Params WDT_Group.
This originally was intended to allow Heating_Control devices to be migrated to WeekdayTimer by offering an alternative to the former Heating_Control_SetAllTemps() functionality.
-
-
WDT_sendDelay
This will add some seconds to each of the switching timers to avoid collissions in RF traffic, especially, when weekprofile option is used and e.g. a topic change may affect not only a single target device but many or a single profile is used for many devices.
@@ -1669,16 +1659,17 @@ __END__
attr wd WDT_eventMap 22.0:dtp20+01 12.0:dtp20+02 18.0:dtp20+03
Notes:
- - New command will be addressed directly to the device, especially commandTemplate content will be ignored. So e.g. if commandTemplate is set to
set $NAME desired-temp $EVENT, parameter 22.0 will lead to set $NAME dtp20 01.
+ - New command will be addressed directly to the device, especially commandTemplate content will be ignored. So e.g. if commandTemplate is set to
set $NAME desired-temp $EVENT, parameter 22.0 will lead to set $NAME dtp20 01.
- When using Perl command syntax for command, $EVENT will be replaced by the new command.
+
switchInThePast
defines that the depending device will be switched in the past in definition and startup phase when the device is not recognized as a heating.
Heatings are always switched in the past.
-
+
disable
loglevel
event-on-update-reading