diff --git a/fhem/CHANGED b/fhem/CHANGED index a76c1d9e2..6579aa6f7 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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_AVR: support for dsp/straight command/reading for + DSP-Z based models (thanks to dev0) and RX-Vx67 series - feature: 10_SOMFY: new RTS commands 0x9 und 0xA (set wind_sun_9/wind_only_a) - bugfix: 93_DbRep: importFromFile format problem if UNIT-field wasn't set - feature: 98_fhemdebug, to aid "Error: >< no TYPE" debugging. diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm index f908edd13..0ca300635 100755 --- a/fhem/FHEM/71_YAMAHA_AVR.pm +++ b/fhem/FHEM/71_YAMAHA_AVR.pm @@ -569,7 +569,15 @@ YAMAHA_AVR_Set($@) if(defined($command) and length($command) > 0) { - YAMAHA_AVR_SendCommand($hash, "<$zone>$command", $what, $a[2]); + if(YAMAHA_AVR_isModel_DSP($hash)) + { + YAMAHA_AVR_SendCommand($hash, "<$zone>$command", $what, $a[2]); + } + else + { + my $straight_command = ((defined($hash->{MODEL}) && $hash->{MODEL} =~ /^RX-(?:A\d{1,2}00|V\d{1,2}67)$/) ? "Off" : ""); + YAMAHA_AVR_SendCommand($hash, "<$zone>$straight_command$command", $what, $a[2]); + } } else { @@ -595,11 +603,25 @@ YAMAHA_AVR_Set($@) { if($a[2] eq "on") { - YAMAHA_AVR_SendCommand($hash, "<$zone>On", $what, $a[2]); + if(YAMAHA_AVR_isModel_DSP($hash)) + { + YAMAHA_AVR_SendCommand($hash, "<$zone>On", $what, $a[2]); + } + else + { + YAMAHA_AVR_SendCommand($hash, "<$zone>On", $what, $a[2]); + } } elsif($a[2] eq "off") { - YAMAHA_AVR_SendCommand($hash, "<$zone>Off", $what, $a[2]); + if(YAMAHA_AVR_isModel_DSP($hash)) + { + YAMAHA_AVR_SendCommand($hash, "<$zone>Off", $what, $a[2]); + } + else + { + YAMAHA_AVR_SendCommand($hash, "<$zone>Off", $what, $a[2]); + } } else { @@ -1274,7 +1296,7 @@ YAMAHA_AVR_ParseResponse($$$) YAMAHA_AVR_SendCommand($hash,0,"statusRequest","retrieveDescXML", { url => "http://".$hash->{helper}{ADDRESS}.$hash->{helper}{XML} , callback => \&YAMAHA_AVR_ParseXML, - options => {at_first => 1, priority => 1} + options => {priority => 2} }); } elsif($arg eq "systemConfig") @@ -1509,6 +1531,10 @@ YAMAHA_AVR_ParseResponse($$$) { readingsBulkUpdate($hash, "straight", lc($1)); } + elsif($data =~ /.*?(.+?)<\/Straight>.*?<\/Surr>/) # DSP-Z based models + { + readingsBulkUpdate($hash, "straight", lc($1)); + } if($data =~ /.*?.*?(.+?)<\/Enhancer>.*?<\/Current>.*?<\/Surround>/) { @@ -1519,6 +1545,10 @@ YAMAHA_AVR_ParseResponse($$$) { readingsBulkUpdate($hash, "dsp", YAMAHA_AVR_Param2Fhem($1, 0)); } + elsif($data =~ /.*?(.+?)<\/Pgm>.*?<\/Surr>/) # DSP-Z based models + { + readingsBulkUpdate($hash, "dsp", YAMAHA_AVR_Param2Fhem($1, 0)); + } if($data =~ /.*?<_3D_Cinema_DSP>(.+?)<\/_3D_Cinema_DSP>.*?<\/Surround>/) { @@ -1944,6 +1974,68 @@ YAMAHA_AVR_ParseXML($$$) else { Log3 $name, 4, "YAMAHA_AVR ($name) - no DSP modes found in XML"; + # DSP-Z based series does not offer DSP modes in unit description + if(YAMAHA_AVR_isModel_DSP($hash)) + { + Log3 $name, 4, "YAMAHA_AVR ($name) - using static DSP mode list für DSP-Z based models"; + $hash->{helper}{DSP_MODES} = "Hall in Munich|". + "Hall in Vienna|". + "Hall in Amsterdam|". + "Church in Freiburg|". + "Chamber|". + "Village Vanguard|". + "Warehouse Loft|". + "Cellar Club|". + "The Roxy Theatre|". + "The Bottom Line|". + "Sports|". + "Action Game|". + "Roleplaying Game|". + "Music Video|". + "Recital/Opera|". + "Standard|". + "Spectacle|". + "Sci-Fi|". + "Adventure|". + "Drama|". + "Mono Movie|". + "2ch Stereo|". + "7ch Stereo|". + "Straight Enhancer|". + "7ch Enhancer|". + "Surround Decoder"; + + } # RX-Vx67's based series does not offer DSP modes in unit description + elsif($hash->{MODEL} =~ /^RX-(?:A\d{1,2}00|V\d{1,2}67)$/) + { + + Log3 $name, 4, "YAMAHA_AVR ($name) - using static DSP mode list for RX-Vx67-based models"; + $hash->{helper}{DSP_MODES} = "Hall in Munich|". + "Hall in Vienna|". + "Hall in Amsterdam|". + "Church in Freiburg|". + "Church in Royaumont|". + "Chamber|". + "Village Vanguard|". + "Warehouse Loft|". + "Cellar Club|". + "The Roxy Theatre|". + "The Bottom Line|". + "Sports|". + "Action Game|". + "Roleplaying Game|". + "Music Video|". + "Recital/Opera|". + "Standard|". + "Spectacle|". + "Sci-Fi|". + "Adventure|". + "Drama|". + "Mono Movie|". + "2ch Stereo|". + "7ch Stereo|". + "Surround Decoder"; + } } # uncomment line for zone detection testing