From af6101db23a56bbbffc163ee937f58a0605641b8 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Mon, 29 Jul 2019 10:03:17 +0000 Subject: [PATCH] 98_RandomTimer.pm: cref fixes and reading name changes (Forum #102621) git-svn-id: https://svn.fhem.de/fhem/trunk@19910 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_RandomTimer.pm | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/98_RandomTimer.pm b/fhem/FHEM/98_RandomTimer.pm index a9afea6ee..44b4a09ad 100644 --- a/fhem/FHEM/98_RandomTimer.pm +++ b/fhem/FHEM/98_RandomTimer.pm @@ -65,7 +65,7 @@ sub RandomTimer_Initialize($) { $hash->{UndefFn} = "RandomTimer_Undef"; $hash->{AttrFn} = "RandomTimer_Attr"; $hash->{AttrList} = "onCmd offCmd switchmode disable:0,1 disableCond ". - "runonce:0,1 keepDeviceAlive forceStoptimeSameDay ". + "runonce:0,1 keepDeviceAlive:0,1 forceStoptimeSameDay:0,1 ". $readingFnAttributes; } @@ -323,8 +323,10 @@ sub RandomTimer_schaltZeitenErmitteln ($$) { RandomTimer_stopZeitErmitteln ($hash, $now); readingsBeginUpdate($hash); - readingsBulkUpdate ($hash, "Startzeit", FmtDateTime($hash->{helper}{startTime})); - readingsBulkUpdate ($hash, "Stoppzeit", FmtDateTime($hash->{helper}{stopTime})); +# readingsBulkUpdate ($hash, "Startzeit", FmtDateTime($hash->{helper}{startTime})); +# readingsBulkUpdate ($hash, "Stoppzeit", FmtDateTime($hash->{helper}{stopTime})); + readingsBulkUpdate ($hash, "StartTime", FmtDateTime($hash->{helper}{startTime})); + readingsBulkUpdate ($hash, "StopTime", FmtDateTime($hash->{helper}{stopTime})); readingsEndUpdate ($hash, defined($hash->{LOCAL} ? 0 : 1)); } @@ -538,7 +540,7 @@ sub RandomTimer_GetHashIndirekt ($$) { Defines a device, that imitates the random switch functionality of a timer clock, like a FS20 ZSU. The idea to create it, came from the problem, that is was always a little bit tricky to install a timer clock before holiday: finding the manual, testing it the days before and three different timer clocks with three different manuals - a horror.
By using it in conjunction with a dummy and a disableCond, I'm able to switch the always defined timer on every weekend easily from all over the world.

- Descrition + Description @@ -604,6 +606,11 @@ sub RandomTimer_GetHashIndirekt ($$) {
+
  • + forceStoptimeSameDay
    + When timespec_start is later then timespec_stop, it forces the timespec_stop to end on the current day instead of the next day. See forum post for use case.
    +
  • +
  • keepDeviceAlive
    The default behavior of a RandomTimer is, that it shuts down the device after stoptime is reached. The keepDeviceAlive attribute changes the behavior. If set, the device status is not changed when the stoptime is reached.
    @@ -633,7 +640,7 @@ sub RandomTimer_GetHashIndirekt ($$) { attr Timer offCmd set @ off 12
  • - the decision to switch on or off depends on the state of the device and is evaluated by the funktion Value(). Value() must evaluate one of the values "on" or "off". The behavior of devices that do not evaluate one of those values can be corrected by defining a stateFormat:
    + The decision to switch on or off depends on the state of the device and is evaluated by the funktion Value(<device>). Value() must evaluate one of the values "on" or "off". The behavior of devices that do not evaluate one of those values can be corrected by defining a stateFormat:
    attr stateFormat EDIPlug_01 {(ReadingsVal("EDIPlug_01","state","nF") =~ m/(ON|on)/i) ? "on" : "off" }
    @@ -649,9 +656,15 @@ sub RandomTimer_GetHashIndirekt ($$) {
    +
  • + runonce
    + Deletes the RandomTimer device after timespec_stop is reached. +
    +
  • +
  • switchmode
    - Setting the switchmode you can influence the behavior of switching on/off. The parameter has the Format 999/999 and the default ist 800/200. The values are in "per mill". The first parameter sets the value of the probability that the device will be switched on when the device is off. The second parameter sets the value of the probability that the device will be switched off when the device is off.
    + Setting the switchmode you can influence the behavior of switching on/off. The parameter has the Format 999/999 and the default ist 800/200. The values are in "per mill". The first parameter sets the value of the probability that the device will be switched on when the device is off. The second parameter sets the value of the probability that the device will be switched off when the device is on.

    Examples