diff --git a/FHEM/71_YAMAHA_AVR.pm b/FHEM/71_YAMAHA_AVR.pm index 39be9663a..497375388 100755 --- a/FHEM/71_YAMAHA_AVR.pm +++ b/FHEM/71_YAMAHA_AVR.pm @@ -551,14 +551,36 @@ sub YAMAHA_AVR_getModel($$) { my ($hash, $address) = @_; my $name = $hash->{NAME}; - my $response = GetFileFromURL("http://".$address."/YamahaRemoteControl/desc.xml"); - return undef unless(defined($response)); - if($response =~ //) - { - $hash->{FIRMWARE} = $1; - $hash->{MODEL} = $2; + my $response; + my $desc_url; + + $response = YAMAHA_AVR_SendCommand($address, "GetParam"); + + + if(defined($response) and $response =~ /(.+?)<\/URL>/) + { + $desc_url = $1; } - + else + { + $desc_url = "/YamahaRemoteControl/desc.xml"; + } + + $response = YAMAHA_AVR_SendCommand($address, "GetParam"); + + if(defined($response) and $response =~ /(.+?)<\/Model_Name>.*(.+?)<\/System_ID>.*(.+?)<\/Version>/) + { + $hash->{MODEL} = $1; + $hash->{SYSTEM_ID} = $2; + $hash->{FIRMWARE} = $3; + } + else + { + return undef; + } + + $response = GetFileFromURL("http://".$address.$desc_url); + return undef unless(defined($response)); while($response =~ //gc) {