diff --git a/fhem/CHANGED b/fhem/CHANGED
index 6c549ca57..6ad10e7dc 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: 71_YAMAHA_NP.pm: Make timer setting more convenient.
- changed: FB_CALLMONITOR: allow chars in phone numbers for reverse search
- changed: SYSMON: non-blocking
- changed: 71_YAMAHA_NP.pm: Provide entire http link to Player AlbumArt.
diff --git a/fhem/FHEM/71_YAMAHA_NP.pm b/fhem/FHEM/71_YAMAHA_NP.pm
index 6878195d3..4138f5c79 100644
--- a/fhem/FHEM/71_YAMAHA_NP.pm
+++ b/fhem/FHEM/71_YAMAHA_NP.pm
@@ -181,6 +181,7 @@ sub YAMAHA_NP_Set
"on:noArg ".
"off:noArg ".
"timerRepeat:once,every ".
+ "timerSet:noArg ".
"sleep:off,30min,60min,90min,120min ".
"volumeStraight:slider,".$volumeStraightMin.",1,".$volumeStraightMax." ".
"volume:slider,0,1,100 ".
@@ -207,6 +208,7 @@ sub YAMAHA_NP_Set
"on:noArg ".
"off:noArg ".
"timerRepeat:once,every ".
+ "timerSet:noArg ".
"sleep:off,30min,60min,90min,120min ".
"volumeStraight:slider,".$volumeStraightMin.",1,".$volumeStraightMax." ".
"volume:slider,0,1,100 ".
@@ -511,17 +513,7 @@ sub YAMAHA_NP_Set
{
if($a[2] eq "on")
{
- if(defined($hash->{helper}{timerHour}) and defined($hash->{helper}{timerMinute}) and defined($hash->{helper}{timerRepeat}) and defined($hash->{helper}{timerVolume}))
- {
- # Configure Timer according to provided parameters
- YAMAHA_NP_SendCommand($hash, "".sprintf("%02d", $hash->{helper}{timerHour}).":".sprintf("%02d", $hash->{helper}{timerMinute})."".$hash->{helper}{timerVolume}."".$hash->{helper}{timerRepeat}."", $what, $a[2]);
- # Switch on timer
- YAMAHA_NP_SendCommand($hash, "".ucfirst($a[2])."", $what, $a[2]);
- }
- else
- {
- return "Please, define timerHour, timerMinute, timerRepeat and timerVolume first."
- }
+ YAMAHA_NP_SendCommand($hash, "".ucfirst($a[2])."", $what, $a[2]);
}
elsif($a[2] eq "off")
{
@@ -577,6 +569,18 @@ sub YAMAHA_NP_Set
return "Please use straight device volume range :".$hash->{helper}{VOLUMESTRAIGHTMIN}."...".$hash->{helper}{VOLUMESTRAIGHTMAX}.".";
}
}
+ elsif($what eq "timerSet")
+ {
+ if(defined($hash->{helper}{timerHour}) and defined($hash->{helper}{timerMinute}) and defined($hash->{helper}{timerRepeat}) and defined($hash->{helper}{timerVolume}))
+ {
+ # Configure Timer according to provided parameters
+ YAMAHA_NP_SendCommand($hash, "".sprintf("%02d", $hash->{helper}{timerHour}).":".sprintf("%02d", $hash->{helper}{timerMinute})."".$hash->{helper}{timerVolume}."".$hash->{helper}{timerRepeat}."", $what, $a[2]);
+ }
+ else
+ {
+ return "Please, define timerHour, timerMinute, timerRepeat and timerVolume first.";
+ }
+ }
elsif($what eq "tunerPresetDAB")
{
if($a[2] >= 1 and $a[2] <= 30 and $hash->{MODEL} eq "CRX-N560D")
@@ -705,15 +709,12 @@ sub YAMAHA_NP_Undefine
return;
}
-
############################################################################################################
#
# Begin of helper functions
#
############################################################################################################
-
-
#############################
# sends a command to the receiver via HTTP
sub YAMAHA_NP_SendCommand
@@ -1469,8 +1470,9 @@ sub YAMAHA_NP_html2txt
timerHour [0...23] - sets hour of device's internal wake-up timer
timerMinute [0...59] - sets minutes of device's internal wake-up timer
timerRepeat [once|every] - sets repetition mode of device's internal wake-up timer
+ timerSet - configures the timer according to timerHour, timerMinute, timerRepeat, timerVolume. (ALL parameters must be set before. This command does not switch on the timer. → 'timer on'.)
timerVolume [<VOL_MIN>...<VOL_MAX>] - sets volume of device's internal wake-up timer
- timer [on|off] - sets device's internal wake-up timer. (Note: before timer activation timerHour, timerMinute, timerRepeat and timerVolume must be set.)
+ timer [on|off] - sets device's internal wake-up timer. (Note: The timer will be activated according to the last stored timer parameters in the device. In order to modify please use the 'timerSet' command.)
tuner [<parameter>] - sets tuner related commands.
- bandDAB - sets the tuner band to DAB (if available).
@@ -1696,8 +1698,9 @@ sub YAMAHA_NP_html2txt
- timerHour [0...23] - Setzt die Stunde des internen Wake-up Timers
- timerMinute [0...59] - Setzt die Minute des internen Wake-up Timers
- timerRepeat [once|every] - Setzt den Wiederholungsmodus des internen Wake-up Timers
+ - timerSet - konfiguriert den Timer nach den Vorgaben: timerHour, timerMinute, timerRepeat, timerVolume. (ALLE Paremeter müssen zuvor gesetzt werden. Dieser Befehl schaltet den Timer nicht ein → 'timer on'.)
- timerVolume [<VOL_MIN>...<VOL_MAX>] - Setzt die Lautstärke des internen Wake-up Timers
- - timer [on|off] - Schaltet ein/aus den internen Wake-up Timer. (Bemerkung: Bevor der Wake-Up Timer gesetzt werden kann, müssen timerHour, timerMinute, timerRepeat and timerVolume zuvor gesetzt werden.)
+ - timer [on|off] - Schaltet ein/aus den internen Wake-up Timer. (Bemerkung: Der Timer wird basierend auf den im Gerät gespeicherten Parametern aktiviert. Um diese zu ändern, bitte den 'timerSet' Befehl benutzen.)
- tuner [<parameter>] - Tuner-relevante Befehle.
- bandDAB - Setzt das Tuner-Band auf DAB (falls verfügbar).