From ec1df45e05a0e6959fbe945a6474dd681079fbe3 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Tue, 8 Dec 2015 19:43:27 +0000 Subject: [PATCH] CUL_HM: play_tone improvement git-svn-id: https://svn.fhem.de/fhem/trunk@10133 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 16 +++++++++++++--- fhem/FHEM/HMConfig.pm | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index 9eb98c2ab..b7d4d02e8 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -4405,11 +4405,18 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ my @itemList = split(',',$a[2]); my $repeat = (defined $a[3] && $a[3] =~ m/^(\d+)$/)?$a[3]:1; my $itemCnt = int(@itemList); - return "no more then 12 entries please" if ($itemCnt>12); + my $volume = (defined $a[4] && $a[4] =~ m/^(\d+)$/)?$a[4]:10; + return "no more than 10 entries please" if ($itemCnt>10); return "repetition $repeat out of range [1..255]" if($repeat < 1 || $repeat > 255); # my $msgBytes = sprintf("%02X%02X",$itemCnt,$repeat); + + return "volume $volume out of range [0..10]" + if($volume < 0 || $volume > 10); + # + my $msgBytes = sprintf("%02X%02X",$volume*20,$repeat); + foreach my $mp3 (@itemList){ return "input: $mp3 is not an integer below 255" if (!defined $mp3 || $mp3 !~ /^[+-]?\d+$/ || $mp3 > 255); @@ -9035,11 +9042,12 @@ sub CUL_HM_tempListTmpl(@) { ################################################## 'L' long ilumination.
repeat defines how often the sequence shall be executed. Defaults to 1.
-
  • playTone <MP3No>[,<MP3No>..] [<repeat>..]
    +
  • playTone <MP3No>[,<MP3No>..] [<repeat>] [<volume>]
    Play a series of tones. List is to be entered separated by ','. White spaces must not be used in the list.
    replay can be entered to repeat the last sound played once more.
    repeat defines how often the sequence shall be played. Defaults to 1.
    + volume is defined between 0 and 10. 0 stops any sound currently playing. Defaults to 10 (100%).
    Example:
      # "hello" in display, symb bulb on, backlight, beep
      @@ -10333,15 +10341,17 @@ sub CUL_HM_tempListTmpl(@) { ################################################## 'L' lange Beleuchtungsdauer.
      repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      -
    • playTone <MP3No>[,<MP3No>..] [<repeat>..]
      +
    • playTone <MP3No>[,<MP3No>..] [<repeat>] [<volume>]
      Spielt eine Reihe von Tönen. Die Liste muss mit ',' getrennt werden. Leerzeichen dürfen in der Liste nicht benutzt werden.
      replay kann verwendet werden um den zuletzt gespielten Klang zu wiederholen.
      repeat definiert wie oft die Sequenz ausgeführt werden soll. Standard ist 1.
      + volume kann im Bereich 0..10 liegen. 0 stoppt jeden aktuell gespielten Sound. Standard ist 10 (100%.
      Beispiel:
        set cfm_Mp3 playTone 3 # MP3 Titel 3 einmal
        set cfm_Mp3 playTone 3 3 # MP3 Titel 3 dreimal
        + set cfm_Mp3 playTone 3 1 5 # MP3 Titel 3 mit halber Lautstärke
        set cfm_Mp3 playTone 3,6,8,3,4 # MP3 Titelfolge 3,6,8,3,4 einmal
        set cfm_Mp3 playTone 3,6,8,3,4 255# MP3 Titelfolge 3,6,8,3,4 255 mal
        set cfm_Mp3 playTone replay # Wiederhole letzte Sequenz
        diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index a34abb506..7a7d8f0a0 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -167,7 +167,7 @@ my $K_actDetID = '000000'; # id of actionDetector ,"005C" => {name=>"HM-OU-CF-PL" ,st=>'outputUnit' ,cyc=>'' ,rxt=>'' ,lst=>'3' ,chn=>"Led:1:1,Sound:2:2",} ,"005D" => {name=>"HM-Sen-MDIR-O" ,st=>'motionDetector' ,cyc=>'00:10' ,rxt=>'c:w:l' ,lst=>'1,4' ,chn=>"",} ,"005F" => {name=>"HM-SCI-3-FM" ,st=>'threeStateSensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"Sw:1:3",} - ,"0060" => {name=>"HM-PB-4DIS-WM" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"Btn:1:20",} + ,"0060" => {name=>"HM-PB-4DIS-WM" ,alias=>"HM-PB-4DIS-WM-2"} ,"0061" => {name=>"HM-LC-SW4-DR" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"Sw:1:4",} ,"0062" => {name=>"HM-LC-SW2-DR" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"Sw:1:2",} ,"0064" => {name=>"DORMA_atent" ,st=>'' ,cyc=>'' ,rxt=>'c' ,lst=>'1,3' ,chn=>"Btn:1:3",} # DORMA Remote 3 buttons @@ -195,7 +195,7 @@ my $K_actDetID = '000000'; # id of actionDetector ,"007B" => {name=>"ROTO_ZEL-STG-RM-FEP-230V",st=>'blindActuator' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"",} # radio-controlled blind actuator 1-channel (flush-mount) ,"007C" => {name=>"ROTO_ZEL-STG-RM-FZS" ,st=>'switch' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"",} # radio-controlled socket adapter switch actuator 1-channel ,"007D" => {name=>"ROTO_ZEL-STG-RM-WT-2" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c:w:l' ,lst=>'1,4' ,chn=>"",} # HM Push Button 2 - ,"007E" => {name=>"ROTO_ZEL-STG-RM-DWT-10" ,st=>'remote' ,cyc=>'00:10' ,rxt=>'c' ,lst=>'1,4' ,chn=>"",} # HM Remote Display 4 buttons Roto + ,"007E" => {name=>"ROTO_ZEL-STG-RM-DWT-10" ,alias=>"HM-PB-4DIS-WM-2"} ,"007F" => {name=>"ROTO_ZEL-STG-RM-FST-UP4" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"",} # HM Push Button Interface ,"0080" => {name=>"ROTO_ZEL-STG-RM-HS-4" ,st=>'remote' ,cyc=>'' ,rxt=>'c' ,lst=>'1,4' ,chn=>"",} # HM Remote 4 buttons ,"0081" => {name=>"ROTO_ZEL-STG-RM-FDK" ,st=>'threeStateSensor' ,cyc=>'28:00' ,rxt=>'c:w' ,lst=>'1,4' ,chn=>"",} # HM Rotary Handle Sensor