diff --git a/fhem/FHEM/70_PIONEERAVR.pm b/fhem/FHEM/70_PIONEERAVR.pm index 61ce27a10..a676601b4 100644 --- a/fhem/FHEM/70_PIONEERAVR.pm +++ b/fhem/FHEM/70_PIONEERAVR.pm @@ -220,6 +220,27 @@ PIONEERAVR_Define($$) { 'inputDown' => 'FD', 'channelUp' => 'TPI', 'channelDown' => 'TPD', + '0Network' => '00NW', + '1Network' => '01NW', + '2Network' => '02NW', + '3Network' => '03NW', + '4Network' => '04NW', + '5Network' => '05NW', + '6Network' => '06NW', + '7Network' => '07NW', + '8Network' => '08NW', + '9Network' => '09NW', + 'prevNetwork' => '12NW', + 'nextNetwork' => '13NW', + 'revNetwork' => '14NW', + 'fwdNetwork' => '15NW', + 'upNetwork' => '26NW', + 'downNetwork' => '27NW', + 'rightNetwork' => '28NW', + 'leftNetwork' => '29NW', + 'enterNetwork' => '30NW', + 'returnNetwork' => '31NW', + 'menuNetwork' => '36NW', 'playNetwork' => '10NW', 'pauseNetwork' => '11NW', 'stopNetwork' => '20NW', @@ -230,14 +251,57 @@ PIONEERAVR_Define($$) { 'stopIpod' => '02IP', 'repeatIpod' => '07IP', 'shuffleIpod' => '08IP', + 'prevIpod' => '03IP', + 'nextIpod' => '04IP', + 'revIpod' => '05IP', + 'fwdIpod' => '06IP', + 'upIpod' => '13IP', + 'downIpod' => '14IP', + 'rightIpod' => '15IP', + 'leftIpod' => '16IP', + 'enterIpod' => '17IP', + 'returnIpod' => '18IP', + 'menuIpod' => '19IP', 'playAdapterPort' => '10BT', 'pauseAdapterPort' => '11BT', 'stopAdapterPort' => '12BT', 'repeatAdapterPort' => '17BT', 'shuffleAdapterPort' => '18BT', + 'prevAdapterPort' => '13BT', + 'nextAdapterPort' => '14BT', + 'revAdapterPort' => '15BT', + 'fwdAdapterPort' => '16BT', + 'upAdapterPort' => '21BT', + 'downAdapterPort' => '22BT', + 'rightAdapterPort' => '23BT', + 'leftAdapterPort' => '24BT', + 'enterAdapterPort' => '25BT', + 'returnAdapterPort' => '26BT', + 'menuAdapterPort' => '27BT', 'playMhl' => '23MHL', 'pauseMhl' => '25MHL', - 'stopMhl' => '24MHL' + 'stopMhl' => '24MHL', + '0Mhl' => '07MHL', + '1Mhl' => '08MHL', + '2Mhl' => '09MHL', + '3Mhl' => '10MHL', + '4Mhl' => '11MHL', + '5Mhl' => '12MHL', + '6Mhl' => '13MHL', + '7Mhl' => '14MHL', + '8Mhl' => '15MHL', + '9Mhl' => '16MHL', + 'prevMhl' => '31MHL', + 'nextMhl' => '30MHL', + 'revMhl' => '27MHL', + 'fwdMhl' => '28MHL', + 'upMhl' => '01MHL', + 'downMhl' => '02MHL', + 'rightMhl' => '04MHL', + 'leftMhl' => '03MHL', + 'enterMhl' => '17MHL', + 'returnMhl' => '06MHL', + 'menuMhl' => '05MHL' }, 'zone2' => { 'on' => 'APO', @@ -313,6 +377,20 @@ PIONEERAVR_Define($$) { } }; # ----------------Human Readable command mapping table----------------------- + $hash->{helper}{REMOTECONTROL} = { + "cursorUp" => "CUP", + "cursorDown" => "CDN", + "cursorRight" => "CRI", + "cursorLeft" => "CLE", + "cursorEnter" => "CEN", + "cursorReturn" => "CRT", + "statusDisplay" => "STS", + "audioParameter" => "APA", + "hdmiOutputParameter" => "HPA", + "videoParameter" => "VPA", + "homeMenu" => "HM" + }; + $hash->{helper}{SPEAKERSYSTEMS} = { "10"=>"9.1ch FH/FW", "00"=>"Normal(SB/FH)", @@ -685,9 +763,9 @@ PIONEERAVR_Set($@) my $cmd = $a[1]; my $arg = ($a[2] ? $a[2] : ""); my @args= @a; shift @args; shift @args; - my @setsPlayer= ("play","pause","stop","repeat","shuffle"); # available commands for certain inputs (@playerInputNr) + my @setsPlayer= ("play","pause","stop","repeat","shuffle","prev","next","rev","fwd","up","down","right","left","enter","return","menu"); # available commands for certain inputs (@playerInputNr) my @playerInputNr= ("13","17","18","26","27","33","38","41","44","45","48","53"); # Input number for usbDac, ipodUsb, xmRadio, homeMediaGallery, sirius, adapterPort, internetRadio, pandora, mediaServer, Favorites, mhl, spotify - my @setsTuner = ("channelUp","channelDown","channelStraight","channel"); # available commands for input tuner + my @setsTuner = ("channelUp","channelDown","channelStraight","channel"); # available commands for input tuner my @setsWithoutArg= ("off","toggle","volumeUp","volumeDown","muteOn","muteOff","muteToggle","inputUp","inputDown"); # set commands without arguments my $playerCmd= ""; my $inputNr= ""; @@ -718,7 +796,9 @@ PIONEERAVR_Set($@) . " volumeUp:noArg volumeDown:noArg mute:on,off,toggle tone:on,bypass bass:slider,-6,1,6" . " treble:slider,-6,1,6 statusRequest:noArg volume:slider,0,1,100" . " volumeStraight:slider,-80,1,12" - . " speakers:off,A,B,A+B raw"; + . " speakers:off,A,B,A+B raw" + . " remoteControl:" + . join(',', sort keys (%{$hash->{helper}{REMOTECONTROL}})); my $currentInput= ReadingsVal($name,"input",""); @@ -729,7 +809,8 @@ PIONEERAVR_Set($@) # some input have more set commands ... if ( $inputNr ~~ @playerInputNr ) { - $list .= " play:noArg stop:noArg pause:noArg repeat:noArg shuffle:noArg"; + $list .= " play:noArg stop:noArg pause:noArg repeat:noArg shuffle:noArg prev:noArg next:noArg rev:noArg fwd:noArg up:noArg down:noArg"; + $list .= " right:noArg left:noArg enter:noArg return:noArg menu:noArg"; } if ( $cmd eq "?" ) { return SetExtensions($hash, $list, $name, $cmd, @a); @@ -781,7 +862,7 @@ PIONEERAVR_Set($@) Log3 $name, 5, "PIONEERAVR $name: Set $cmd "; PIONEERAVR_statusUpdate($hash); return undef; - #### play, pause, stop, random, repeat + #### play, pause, stop, random, repeat,prev,next,rev,fwd,up,down,right,left,enter,return,menu #### Only available if the input is one of: #### ipod, internetRadio, mediaServer, favorites, adapterPort, mhl #### we need to send different commands to the Pioneer AV receiver @@ -796,7 +877,7 @@ PIONEERAVR_Set($@) } elsif (($inputNr eq "26") ||($inputNr eq "27") || ($inputNr eq "38") || ($inputNr eq "41") || ($inputNr eq "44") || ($inputNr eq "45") || ($inputNr eq "53")) { $playerCmd= $cmd."Network"; #### 'random' and 'repeat' are not available on input mhl - } elsif (($inputNr eq "48") && (( $cmd eq "play") || ( $cmd eq "pause") ||( $cmd eq "stop"))) { + } elsif (($inputNr eq "48") && ( $cmd ne "repeat") && ( $cmd ne "random")) { $playerCmd= $cmd."Mhl"; } else { my $err= "PIONEERAVR $name: The command $cmd for input nr. $inputNr is not possible!"; @@ -950,21 +1031,33 @@ PIONEERAVR_Set($@) return undef; ####Speakers (off|A|B|A+B) } elsif ( $cmd eq "speakers" ) { - Log3 $name, 5, "PIONEERAVR $name: set $cmd $arg"; - if ($arg eq "off") { - PIONEERAVR_Write($hash, "0SPK"); - } elsif ($arg eq "A") { - PIONEERAVR_Write($hash, "1SPK"); - } elsif ($arg eq "B") { - PIONEERAVR_Write($hash, "2SPK"); - } elsif ($arg eq "A+B") { - PIONEERAVR_Write($hash, "3SPK"); - } else { - my $err= "PIONEERAVR $name: Error: unknown argument $arg in set ... speakers. Must be one of off, A, B, A+B !"; - Log3 $name, 5, $err; - return $err; - } - return undef; + Log3 $name, 5, "PIONEERAVR $name: set $cmd $arg"; + if ($arg eq "off") { + PIONEERAVR_Write($hash, "0SPK"); + } elsif ($arg eq "A") { + PIONEERAVR_Write($hash, "1SPK"); + } elsif ($arg eq "B") { + PIONEERAVR_Write($hash, "2SPK"); + } elsif ($arg eq "A+B") { + PIONEERAVR_Write($hash, "3SPK"); + } else { + my $err= "PIONEERAVR $name: Error: unknown argument $arg in set ... speakers. Must be one of off, A, B, A+B !"; + Log3 $name, 5, $err; + return $err; + } + return undef; + ####remoteControl + } elsif ( $cmd eq "remoteControl" ) { + Log3 $name, 5, "PIONEERAVR $name: set $cmd $arg"; + if (exists $hash->{helper}{REMOTECONTROL}{$arg}) { + my $setCmd= $hash->{helper}{REMOTECONTROL}{$arg}; + my $v= PIONEERAVR_Write($hash, $setCmd); + } else { + my $err= "PIONEERAVR $name: Error: unknown argument $arg in set ... remoteControl!"; + Log3 $name, 5, $err; + return $err; + } + return undef; } else { return SetExtensions($hash, $list, $name, $cmd, @a); } @@ -1498,8 +1591,11 @@ RC_layout_PioneerAVR() { $row[1]="volumeUp:UP,mute toggle:MUTE,inputUp:CHUP"; $row[2]=":VOL,:blank,:PROG"; $row[3]="volumeDown:DOWN,:blank,inputDown:CHDOWN"; - $row[4]="attr rc_iconpath icons/remotecontrol"; - $row[5]="attr rc_iconprefix black_btn_"; + $row[4]="remoteControl audioParameter:AUDIO,remoteControl cursorUp:UP,remoteControl videoParameter:VIDEO"; + $row[5]="remoteControl cursorLeft:LEFT,remoteControl cursorEnter:ENTER,remoteControl cursorRight:RIGHT"; + $row[6]="remoteControl homeMenu:HOMEsym,remoteControl cursorDown:DOWN,remoteControl cursorReturn:RETURN"; + $row[7]="attr rc_iconpath icons/remotecontrol"; + $row[8]="attr rc_iconprefix black_btn_"; # unused available commands return @row; @@ -1548,13 +1644,13 @@ RC_layout_PioneerAVR() { Defines a Pioneer AV receiver device (communication interface and main zone control). The keywords telnet or serial are fixed. Default port on Pioneer AV receivers is 23 (according to the above mentioned Pioneer documetation)
- Note: devices to control zone2, zone3 and/or HD-zone are autocreated on reception of the first message for those zones.

+ Note: PIONEERAVRZONE devices to control zone2, zone3 and/or HD-zone are autocreated on reception of the first message for those zones.

Examples:
@@ -1568,17 +1664,18 @@ RC_layout_PioneerAVR() {
  • raw
    Sends the command <PioneerCommand> unchanged to the Pioneer AV receiver.
  • reopen
    Tries to reopen the data connection
  • statusRequest
    gets some information from the Pioneer AV receiver and updates the readings accordingly
  • -
  • off
    turn power off
  • -
  • on
    turn power on
  • -
  • toggle
    toggles power
  • -
  • volume <0 ... 100>
    main volume in % of the maximum volume
  • -
  • volumeUp
    increases the main volume by 0.5dB
  • -
  • volumeDown
    decreases the main volume by 0.5dB
  • -
  • volumeStraight<-80.5 ... 12>
    same values for volume as shown on the display of the Pioneer AV rreceiver
  • +
  • off
    put the main zone in standby
  • +
  • on
    turn main zone power on from standby. This only works if "Network standby" on the Pioneer AV Receiver is set to "on"
  • +
  • toggle
    toggles power of the main zone from/to standby
  • +
  • volume <0 ... 100>
    volume of the main zone in % of the maximum volume
  • +
  • volumeUp
    increases the volume of the main zone by 0.5dB
  • +
  • volumeDown
    decreases the volume of the main zone by 0.5dB
  • +
  • volumeStraight<-80.5 ... 12>
    Sets the volume of the main zone to the directly. + Use the same values as shown on the display of the Pioneer AV rreceiver
  • mute
  • tone
  • -
  • bass <-6 ... 6>
    tone control of bass from -6dB to + 6dB (works only if tone is on)
  • -
  • treble <-6 ... 6>
    tone control of treble from -6dB to + 6dB (works only if tone is on)
  • +
  • bass <-6 ... 6>
    tone control of bass from -6dB to + 6dB (works only if tone is on (not standby) and the ListeningMode supports it)
  • +
  • treble <-6 ... 6>
    tone control of treble from -6dB to + 6dB (works only if tone is on (not standby) and the ListeningMode supports it)
  • input
    the list of possible (i.e. not deactivated) inputs is read in during Fhem start and with get statusRequest
  • inputUp
    change input to next input
  • @@ -1603,6 +1700,33 @@ RC_layout_PioneerAVR() {
  • stop
    stops playback for the same inputs as play
  • repeat
    repeat for the following inputs: AdapterPort, Ipod, Favorites, InternetRadio, MediaServer
  • shuffle
    random play for the same inputs as repeat
  • +
  • prev
    for the same inputs as play
  • +
  • next
    for the same inputs as play
  • +
  • rev
    for the same inputs as play
  • +
  • fwd
    for the same inputs as play
  • +
  • up
    for the same inputs as play
  • +
  • down
    for the same inputs as play
  • +
  • right
    for the same inputs as play
  • +
  • left
    for the same inputs as play
  • +
  • enter
    for the same inputs as play
  • +
  • return
    for the same inputs as play
  • +
  • menu
    for the same inputs as play
  • +
  • remoteControl where is one of: +
      +
    • cursorDown
    • +
    • cursorRight
    • +
    • cursorLeft
    • +
    • cursorEnter
    • +
    • cursorReturn
    • +
    • homeMenu
    • +
    • statusDisplay
    • +
    • audioParameter
    • +
    • hdmiOutputParameter
    • +
    • videoParameter
    • +
    • homeMenu
    • +
    + simulates the keys on the remote control. cursorXX does not work to control inputs -> use set up ... instead +
  • set extensions are supported (except )


  • Example: @@ -1620,10 +1744,6 @@ RC_layout_PioneerAVR() { Get @@ -1709,17 +1829,17 @@ RC_layout_PioneerAVR() {
  • raw
    Sendet den Befehl <PioneerKommando> unverändert an den Pioneer AV receiver.
  • reopen
    Versucht die Datenverbindung wieder herzustellen
  • statusRequest
    Fragt Information vom Pioneer AV Receiver und aktualisiert die readings entsprechend
  • -
  • off
    Ausschalten der Main Zone
  • -
  • on
    Einschalten der Main Zone
  • -
  • toggle
    Ein/Ausschalten der Main Zone
  • -
  • volume <0 ... 100>
    Lautstärke der Main-Zone in % der Maximallautstärke
  • +
  • off
    Ausschalten der Main Zone in den Standby Modus
  • +
  • on
    Einschalten der Main Zone aus dem Standby Modus. Das funktioniert nur, wenn am Pioneer AV Receiver "Network Standby" "on" eingestellt ist.
  • +
  • toggle
    Ein/Ausschalten der Main Zone in/von Standby
  • +
  • volume <0 ... 100>
    Lautstärke der Main Zone in % der Maximallautstärke
  • volumeUp
    Lautstärke der Main Zone um 0.5dB erhöhen
  • volumeDown
    Lautstärke der Main Zone um 0.5dB verringern
  • -
  • volumeStraight<-80.5 ... 12>
    Einstellen der Lautstärke der Main Zone mit einem Wert, wie er am Display des Pioneer AV Receiver angezeigt wird
  • +
  • volumeStraight<-80.5 ... 12>
    Direktes Einstellen der Lautstärke der Main Zone mit einem Wert, wie er am Display des Pioneer AV Receiver angezeigt wird
  • mute der Main Zone
  • tone
  • -
  • bass <-6 ... 6>
    Bass von -6dB bis + 6dB (funktioniert nur wenn tone = on)
  • -
  • treble <-6 ... 6>
    Höhen (treble) von -6dB bis + 6dB (funktioniert nur wenn tone = on)
  • +
  • bass <-6 ... 6>
    Bass von -6dB bis + 6dB (funktioniert nur wenn tone = on und der ListeningMode es erlaubt)
  • +
  • treble <-6 ... 6>
    Höhen (treble) von -6dB bis + 6dB (funktioniert nur wenn tone = on und der ListeningMode es erlaubt)
  • input
    Die Liste der verfügbaren (also der nicht deaktivierten) Eingangsquellen wird beim Start von Fhem und auch mit get statusRequest eingelesen
  • inputUp
    nächste Eingangsquelle der Main Zone auswählen
  • @@ -1744,6 +1864,33 @@ RC_layout_PioneerAVR() {
  • stop
    Stoppt die Wiedergabe für die gleichen Eingangsquellen wie "play"
  • repeat
    Wiederholung für folgende Eingangsquellen: AdapterPort, Ipod, Favorites, InternetRadio, MediaServer
  • shuffle
    Zufällige Wiedergabe für die gleichen Eingangsquellen wie "repeat"
  • +
  • prev
    für die gleichen Eingangsquellen wie "play"
  • +
  • next
    für die gleichen Eingangsquellen wie "play"
  • +
  • rev
    für die gleichen Eingangsquellen wie "play"
  • +
  • fwd
    für die gleichen Eingangsquellen wie "play"
  • +
  • up
    für die gleichen Eingangsquellen wie "play"
  • +
  • down
    für die gleichen Eingangsquellen wie "play"
  • +
  • right
    für die gleichen Eingangsquellen wie "play"
  • +
  • left
    für die gleichen Eingangsquellen wie "play"
  • +
  • enter
    für die gleichen Eingangsquellen wie "play"
  • +
  • return
    für die gleichen Eingangsquellen wie "play"
  • +
  • menu
    für die gleichen Eingangsquellen wie "play"
  • +
  • remoteControl wobei eines von folgenden sein kann: +
      +
    • cursorDown
    • +
    • cursorRight
    • +
    • cursorLeft
    • +
    • cursorEnter
    • +
    • cursorReturn
    • +
    • homeMenu
    • +
    • statusDisplay
    • +
    • audioParameter
    • +
    • hdmiOutputParameter
    • +
    • videoParameter
    • +
    • homeMenu
    • + Simuliert die Tasten der Fernbedienung. Achtung: mit cursorXX können die Eingänge nicht beeinflusst werden -> set up ... kann zur Steuerung der Inputs verwendet werden. +
    +
  • set extensions (ausser ) werden unterstützt


  • Beispiel: @@ -1764,8 +1911,6 @@ RC_layout_PioneerAVR() {