diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm index fa511a675..cc9c76bc2 100755 --- a/fhem/FHEM/71_YAMAHA_AVR.pm +++ b/fhem/FHEM/71_YAMAHA_AVR.pm @@ -1884,7 +1884,12 @@ YAMAHA_AVR_ParseResponse($$$) readingsBulkUpdateIfChanged($hash, "currentArtist", ""); } - if($data =~ /.*?(.+?)<\/Station>.*?<\/Meta_Info>/) + + if($data =~ /DAB<\/Band>/ and $data =~ /.*?(.+?)<\/Service_Label>.*?<\/Meta_Info>/) # RX-481D provides always Meta-Info for DAB and Tuner + { + readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); + } + elsif($data =~ /.*?(.+?)<\/Station>.*?<\/Meta_Info>/) { readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); } @@ -1892,7 +1897,7 @@ YAMAHA_AVR_ParseResponse($$$) { readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); } - elsif($data =~ /.*?.*?(.+?)<\/Service_Label>.*?<\/Meta_Info>.*?<\/DAB>/) + elsif($data =~ /.*?(.+?)<\/Station>.*?<\/Meta_Info>/) { readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); } @@ -1918,8 +1923,12 @@ YAMAHA_AVR_ParseResponse($$$) { readingsBulkUpdateIfChanged($hash, "currentAlbum", ""); } - - if($data =~ /.*?(.+?)<\/Song>.*?<\/Meta_Info>/) + + if($data =~ /DAB<\/Band>/ and $data =~ /.*?(.+?)<\/DLS>.*?<\/Meta_Info>/) # RX-481D provides always Meta-Info for DAB and FM + { + readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1)); + } + elsif($data =~ /.*?(.+?)<\/Song>.*?<\/Meta_Info>/) { readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1)); } @@ -1943,11 +1952,15 @@ YAMAHA_AVR_ParseResponse($$$) elsif($data =~ /.*?(.+?)<\/Radio_Text_B>.*?<\/Meta_Info>/) { readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1)); + } + elsif($data =~ /.*?(.+?)<\/Radio_Text>.*?<\/Meta_Info>/) # RX-V481D + { + readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1)); } - elsif($data =~ /.*?(.+?)<\/DLS>.*?<\/DAB>/) - { - readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1)); - } + + + + else { readingsBulkUpdateIfChanged($hash, "currentTitle", ""); @@ -1964,12 +1977,14 @@ YAMAHA_AVR_ParseResponse($$$) readingsBulkUpdate($hash, "playStatus", "playing"); } - if($data =~ /.*?(?:)?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit>(?:<\/Current>)?.*<\/Tuning>/ or $data =~ /.*?.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Freq>.*<\/Signal_Info>.*<\/DAB>/ or(YAMAHA_AVR_isModel_DSP($hash) and $data =~ /.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Freq>.*?<\/Tuning>/)) + if(($data =~ /DAB<\/Band>/ and $data =~ /.*?.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Freq>.*?<\/Signal_Info>.*?<\/DAB>/) or # RX-481D provides always Meta-Info for DAB and FM + ($data =~ /.*?(?:)?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit>(?:<\/Current>)?.*?<\/Tuning>/) or + (YAMAHA_AVR_isModel_DSP($hash) and $data =~ /.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Freq>.*?<\/Tuning>/)) { readingsBulkUpdate($hash, "currentStationFrequency", sprintf("%.$2f", ($1 / (10 ** $2)))." $3"); readingsBulkUpdate($hash, "tunerFrequency", sprintf("%.$2f", ($1 / (10 ** $2)))); - - if($data =~ /<(?:Tuning|DAB)>.*?(.+?)<\/Band>.*?<\/(?:Tuning|DAB)>/) + + if($data =~ /(.+?)<\/Band>/) { readingsBulkUpdate($hash, "tunerFrequencyBand", uc($1)); }