98_RandomTimer commandref fixes

Begonnen von Nestor, 29 Juli 2019, 10:44:44

Vorheriges Thema - Nächstes Thema

Nestor

Attached patch fixes some errors and missing attributes in the commandref.

Also these readings should be translated to english (but could break dependencies for these readings in existing installations):

--- 98_RandomTimer.pm (saved version)
+++ (current document)
@@ -323,8 +323,8 @@
   RandomTimer_stopZeitErmitteln ($hash, $now);

   readingsBeginUpdate($hash);
-  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));

}

Beta-User

Thx for the cref patch.

Most of the cref stuff has been changed (not the [], indicating optional arguments), and also the reading names. The original code with the german reading names has just been disabled, so in case anyone needs it for transitional purpose it can easily be enabled additionally to the new ones.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Nestor

Thanks but <timeToSwitch> is a required parameter (see line 80)

Beta-User

Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Nestor

This patch adds a reading LastCommand, which stores the last executed device command.
It's currently only logged to system log (with verbose 4).

--- - 2019-08-02 13:20:56.690576395 +0200
+++ /srv/fhem/FHEM/98_RandomTimer.pm 2019-08-02 10:36:06.298376369 +0200
@@ -173,6 +173,7 @@
    }
    $command =~ s/@/$hash->{DEVICE}/g;
    $command = SemicolonEscape($command);
+   readingsSingleUpdate($hash, 'LastCommand', $command, 1);
    Log3 $hash, 4, "[".$hash->{NAME}. "]"." command: $command";

    my $ret  = AnalyzeCommandChain(undef, $command);

Beta-User

Thx for the proposal  :) .

Just commited it to svn.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files