2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

71_YAMAHA_AVR: support for dsp/straight command/reading for DSP-Z based models (thanks to dev0) and RX-Vx67 series (Forum: #63646)

git-svn-id: https://svn.fhem.de/fhem/trunk@12919 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2016-12-31 10:15:59 +00:00
parent 9c7e8fbb95
commit 123ebbc30d
2 changed files with 98 additions and 4 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # 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) - 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 - bugfix: 93_DbRep: importFromFile format problem if UNIT-field wasn't set
- feature: 98_fhemdebug, to aid "Error: >< no TYPE" debugging. - feature: 98_fhemdebug, to aid "Error: >< no TYPE" debugging.

View File

@ -569,7 +569,15 @@ YAMAHA_AVR_Set($@)
if(defined($command) and length($command) > 0) if(defined($command) and length($command) > 0)
{ {
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current><Sound_Program>$command</Sound_Program></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]); if(YAMAHA_AVR_isModel_DSP($hash))
{
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surr><Pgm_Sel><Pgm>$command</Pgm></Pgm_Sel></Surr></$zone></YAMAHA_AV>", $what, $a[2]);
}
else
{
my $straight_command = ((defined($hash->{MODEL}) && $hash->{MODEL} =~ /^RX-(?:A\d{1,2}00|V\d{1,2}67)$/) ? "<Straight>Off</Straight>" : "");
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current>$straight_command<Sound_Program>$command</Sound_Program></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]);
}
} }
else else
{ {
@ -595,11 +603,25 @@ YAMAHA_AVR_Set($@)
{ {
if($a[2] eq "on") if($a[2] eq "on")
{ {
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current><Straight>On</Straight></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]); if(YAMAHA_AVR_isModel_DSP($hash))
{
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surr><Pgm_Sel><Straight>On</Straight></Pgm_Sel></Surr></$zone></YAMAHA_AV>", $what, $a[2]);
}
else
{
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current><Straight>On</Straight></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]);
}
} }
elsif($a[2] eq "off") elsif($a[2] eq "off")
{ {
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current><Straight>Off</Straight></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]); if(YAMAHA_AVR_isModel_DSP($hash))
{
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surr><Pgm_Sel><Straight>Off</Straight></Pgm_Sel></Surr></$zone></YAMAHA_AV>", $what, $a[2]);
}
else
{
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Surround><Program_Sel><Current><Straight>Off</Straight></Current></Program_Sel></Surround></$zone></YAMAHA_AV>", $what, $a[2]);
}
} }
else else
{ {
@ -1274,7 +1296,7 @@ YAMAHA_AVR_ParseResponse($$$)
YAMAHA_AVR_SendCommand($hash,0,"statusRequest","retrieveDescXML", { YAMAHA_AVR_SendCommand($hash,0,"statusRequest","retrieveDescXML", {
url => "http://".$hash->{helper}{ADDRESS}.$hash->{helper}{XML} , url => "http://".$hash->{helper}{ADDRESS}.$hash->{helper}{XML} ,
callback => \&YAMAHA_AVR_ParseXML, callback => \&YAMAHA_AVR_ParseXML,
options => {at_first => 1, priority => 1} options => {priority => 2}
}); });
} }
elsif($arg eq "systemConfig") elsif($arg eq "systemConfig")
@ -1509,6 +1531,10 @@ YAMAHA_AVR_ParseResponse($$$)
{ {
readingsBulkUpdate($hash, "straight", lc($1)); readingsBulkUpdate($hash, "straight", lc($1));
} }
elsif($data =~ /<Surr>.*?<Straight>(.+?)<\/Straight>.*?<\/Surr>/) # DSP-Z based models
{
readingsBulkUpdate($hash, "straight", lc($1));
}
if($data =~ /<Surround>.*?<Current>.*?<Enhancer>(.+?)<\/Enhancer>.*?<\/Current>.*?<\/Surround>/) if($data =~ /<Surround>.*?<Current>.*?<Enhancer>(.+?)<\/Enhancer>.*?<\/Current>.*?<\/Surround>/)
{ {
@ -1519,6 +1545,10 @@ YAMAHA_AVR_ParseResponse($$$)
{ {
readingsBulkUpdate($hash, "dsp", YAMAHA_AVR_Param2Fhem($1, 0)); readingsBulkUpdate($hash, "dsp", YAMAHA_AVR_Param2Fhem($1, 0));
} }
elsif($data =~ /<Surr>.*?<Pgm>(.+?)<\/Pgm>.*?<\/Surr>/) # DSP-Z based models
{
readingsBulkUpdate($hash, "dsp", YAMAHA_AVR_Param2Fhem($1, 0));
}
if($data =~ /<Surround>.*?<_3D_Cinema_DSP>(.+?)<\/_3D_Cinema_DSP>.*?<\/Surround>/) if($data =~ /<Surround>.*?<_3D_Cinema_DSP>(.+?)<\/_3D_Cinema_DSP>.*?<\/Surround>/)
{ {
@ -1944,6 +1974,68 @@ YAMAHA_AVR_ParseXML($$$)
else else
{ {
Log3 $name, 4, "YAMAHA_AVR ($name) - no DSP modes found in XML"; 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 # uncomment line for zone detection testing