home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

Denon AVR: no Friendly Name found #51514

Closed pimw1 closed 3 years ago

pimw1 commented 3 years ago

The problem

I've just installed the Denon AVR integration. It works well with my Denon AVR 2312. However, when looking in the logs, i see the following error:

2021-06-05 01:42:04 ERROR (MainThread) [denonavr.foundation] No FriendlyName found, using standard name: Denon AVR.

What is version of Home Assistant Core has the issue?

core-2021.6.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Denon AVR Network Receivers

Link to integration documentation on our website

https://www.home-assistant.io/integrations/denonavr

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-06-05 01:42:04 ERROR (MainThread) [denonavr.foundation] No FriendlyName found, using standard name: Denon AVR
2021-06-05 01:42:14 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform denonavr is taking over 10 seconds.
2021-06-05 01:51:20 WARNING (MainThread) [denonavr.soundmode] Not able to match sound mode: 'DOLBY PL2 CINEMA', returning raw sound mode.

Additional information

I'm running Home Assistant on a Raspberry Pi 4.

probot-home-assistant[bot] commented 3 years ago

Hey there @scarface-4711, @starkillerog, mind taking a look at this issue as its been labeled with an integration (denonavr) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

starkillerOG commented 3 years ago

This just means you did not set a name of the receiver in the receiver settings itself (I think). It is nothing to worry about. We might want to reduce the log level from error to warning tho, I will make a PR for that.

starkillerOG commented 3 years ago

PR to reduce log level: https://github.com/scarface-4711/denonavr/pull/212

pimw1 commented 3 years ago

Thanks starkillerOG, what a super quick response, awesome! To clarify: what do you mean with "set a name of the receiver in the receiver settings itself"? Do you mean in the actual physical denon receiver itself, or in a device / entity within Home Assistant?

starkillerOG commented 3 years ago

In the actual physical denon receiver, you can go to the settings menu with the remote and change the name of the receiver. That name is used as the initial name in HomeAssistant, but you can then just overwrite it in the GUI, so not a big deal if it sticks to a default name.

pimw1 commented 3 years ago

Thanks for explaining. I checked in the receiver menu. The friendly name was set to DENON:AVR:[2312]. I was suspecting that there was an issue with some of the strange characters. Therefore, i changed the name to DENON_AVR_2312. Upon restarting Home Assistant, it is throwing the same error again. It seems that the friendly name is somehow not recognized by the integration?

starkillerOG commented 3 years ago

sometimes power cycling the receiver helps (unplugging power, wait 15 sec, plug it back in). It is a known issue of denon/marantz receivers that there data sometimes gets malfomed in the xml and a power cycle fixes it.

pimw1 commented 3 years ago

I've powercycled the receiver (power cord disconnect, waiting 20 seconds, reconnecting power cord, enabling receiver), and after that restarted home assistant. The message keeps popping up.

pimw1 commented 3 years ago

Nothing serious, but this seems to be a bug in retrieving the friendly name?

pimw1 commented 3 years ago

Hi, a small gentle bump ;) Is there any update on a fix for this?

starkillerOG commented 3 years ago

The PR to reduce the log level has been merged, but no new version of DenonAVR has been published yet. Because this is such a small issue, we probably need to wait untill some bigger change comes allong for a new version release.

@scarface-4711 are you planning on releasing a new version of DenonAVR soon?

starkillerOG commented 3 years ago

@pimw1 if we want to see why the friendly name is not properly retrieved, please open a webbrowser on a PC on the same network as you receiver and go to this adress: http://192.168.1.IP:80//goform/AppCommand.xml Fill in the IP of your receiver at IP in the adress

Please post the contents of the xml file you then get here.

pimw1 commented 3 years ago

It gives the following error: image

starkillerOG commented 3 years ago

In homeassistant if you go to integration and then to denonavr and then to the device, what model type is listed there?

pimw1 commented 3 years ago

It mentions "AVR-2312-avr".

starkillerOG commented 3 years ago

could you try http://192.168.178.7:80/goform/formMainZone_MainZoneXml.xml

pimw1 commented 3 years ago

Sure.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<item>
<Power>
<value>ON</value>
</Power>
<ZonePower>
<value>ON</value>
</ZonePower>
<InputFuncList>
<value>SOURCE</value>
<value>TUNER</value>
<value>CD</value>
<value>NET/USB</value>
<value>DVD</value>
<value>BD</value>
<value>TV</value>
<value>SAT/CBL</value>
<value>DVR</value>
<value>DOCK</value>
<value>GAME2</value>
<value>GAME</value>
<value>V.AUX</value>
</InputFuncList>
<RenameSource>
<value/>
<value>TUNER </value>
<value>CD </value>
<value>NET/USB </value>
<value>DVD </value>
<value>BD </value>
<value>TV </value>
<value>SAT/CBL </value>
<value>DVR </value>
<value>DOCK </value>
<value>GAME2 </value>
<value>GAME1 </value>
<value>V.AUX </value>
</RenameSource>
<RenameZone>
<value>MAIN ZONE </value>
</RenameZone>
<SourceDelete>
<value>DEL</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
<value>USE</value>
</SourceDelete>
<TopMenuLink>
<value>ON</value>
</TopMenuLink>
<ModelId>
<value>3</value>
</ModelId>
<SalesArea>
<value>1</value>
</SalesArea>
<InputFuncSelect>
<value>GAME</value>
</InputFuncSelect>
<NetFuncSelect>
<value>RHAPSODY</value>
</NetFuncSelect>
<InputFuncSelectMain>
<value>GAME</value>
</InputFuncSelectMain>
<selectSurround>
<value>STEREO </value>
</selectSurround>
<SurroundLists>
<value index="" table="" param=""/>
<value index="DOLBY DIGITAL" table="Standard(Dolby)" param=""/>
<value index="DTS SURROUND" table="Standard(DTS)" param=""/>
<value index="DIRECT" table="Direct" param=""/>
<value index="PURE DIRECT" table="Pure Direct" param=""/>
<value index="STEREO" table="Stereo" param=""/>
<value index="MCH STEREO" table="Multi CH Stereo" param=""/>
<value index="VIRTUAL" table="Virtual" param=""/>
<value index="ROCK ARENA" table="Rock Arena" param=""/>
<value index="JAZZ CLUB" table="Jazz Club" param=""/>
<value index="MONO MOVIE" table="Mono Movie" param=""/>
<value index="VIDEO GAME" table="Video Game" param=""/>
<value index="MATRIX" table="Matrix" param=""/>
</SurroundLists>
<VolumeDisplay>
<value>Relative</value>
</VolumeDisplay>
<MasterVolume>
<value>-15.0</value>
</MasterVolume>
<Mute>
<value>off</value>
</Mute>
<RemoteMaintenance>
<value>OFF</value>
</RemoteMaintenance>
<GameSourceDisplay>
<value>TRUE</value>
</GameSourceDisplay>
<LastfmDisplay>
<value>TRUE</value>
</LastfmDisplay>
<SubwooferDisplay>
<value>FALSE</value>
</SubwooferDisplay>
<Zone2VolDisp>
<value>TRUE</value>
</Zone2VolDisp>
</item>
pimw1 commented 3 years ago

And with pictures: image image

starkillerOG commented 3 years ago

Alright so indeed the friendly name is missing from the XML file, explaining the error. Lets see if we can find it.

If you go to the receiver web interface http://192.168.178.7 do you see the friendly name somewhere if you look around?

pimw1 commented 3 years ago

Yes, the option is available here:

image

This value is in line with my previous comment:

Thanks for explaining. I checked in the receiver menu. The friendly name was set to DENON:AVR:[2312]. I was suspecting that there was an issue with some of the strange characters. Therefore, i changed the name to DENON_AVR_2312. Upon restarting Home Assistant, it is throwing the same error again. It seems that the friendly name is somehow not recognized by the integration?

pimw1 commented 3 years ago

Just to be sure, i've set the "Friendly Name Edit" to DENONAVR2312, saved it, and reboot Home Assistant. The same error reappears.

starkillerOG commented 3 years ago

@pimw1 Alright, so that means we probably can get the friendly name from some xml file over the network, now we just need to find the correct file:

Could you check the following URLs and see if you can find the friendly name in one of those XMLs

http://192.168.178.7:8080/description.xml
http://192.168.178.7:80/goform/formMainZone_MainZoneXmlStatus.xml
http://192.168.178.7:80/goform/Deviceinfo.xml
http://192.168.178.7:80/goform/formNetAudio_StatusXml.xml
pimw1 commented 3 years ago

I found the name in the first url: it mentions "DENONAVR2312".

image

The other links did not contain the information: image

image

image

pimw1 commented 3 years ago

I've opened description.xml in notepad, and friendlyName is there:

<?xml version="1.0"?>
<root
  xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:ms=" urn:microsoft-com:wmc-1-0"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <device
      ms:X_MS_SupportsWMDRM="true">
        <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
        <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001
                </pnpx:X_compatibleId>
        <pnpx:X_deviceCategory>MediaDevices
                </pnpx:X_deviceCategory>
        <pnpx:X_hardwareId>VEN_0033&amp;DEV_000B&amp;REV_01
                </pnpx:X_hardwareId>
        <df:X_deviceCategory>Multimedia.DMR
                </df:X_deviceCategory>
        <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
        <friendlyName>DENONAVR2312</friendlyName>
        <manufacturer>DENON</manufacturer>
        <manufacturerURL>http://www.denon.com</manufacturerURL>
        <modelDescription>AV SURROUND RECEIVER</modelDescription>
        <modelName>AVR-2312</modelName>
        <modelNumber>2312</modelNumber>
        <modelURL>http://www.denon.com/</modelURL>
        <serialNumber>0005CD259507</serialNumber>
        <UDN>uuid:5f9ec1b3-ff59-19bb-8530-0005cd259507</UDN>
        <UPC>123810928305556upc</UPC>
        <iconList>
            <icon>
                <mimetype>image/jpeg</mimetype>
                <width>48</width>
                <height>48</height>
                <depth>24</depth>
                <url>/BCO_device_sm_icon.jpg</url>
            </icon>
            <icon>
                <mimetype>image/jpeg</mimetype>
                <width>120</width>
                <height>120</height>
                <depth>24</depth>
                <url>/BCO_device_lrg_icon.jpg</url>
            </icon>
            <icon>
                <mimetype>image/png</mimetype>
                <width>48</width>
                <height>48</height>
                <depth>24</depth>
                <url>/BCO_device_sm_icon.png</url>
            </icon>
            <icon>
                <mimetype>image/png</mimetype>
                <width>120</width>
                <height>120</height>
                <depth>24</depth>
                <url>/BCO_device_lrg_icon.png</url>
            </icon>
        </iconList>
        <serviceList>
            <service>
                <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
                <SCPDURL>/RenderingControl/desc.xml</SCPDURL>
                <controlURL>/RenderingControl/ctrl</controlURL>
                <eventSubURL>/RenderingControl/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
                <SCPDURL>/ConnectionManager/desc.xml</SCPDURL>
                <controlURL>/ConnectionManager/ctrl</controlURL>
                <eventSubURL>/ConnectionManager/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
                <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
                <SCPDURL>/AVTransport/desc.xml</SCPDURL>
                <controlURL>/AVTransport/ctrl</controlURL>
                <eventSubURL>/AVTransport/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-dm-holdings-com:service:X_HtmlPageHandler:1</serviceType>
                <serviceId>urn:schemas-dm-holdings-com:serviceId:X_HtmlPage</serviceId>
                <SCPDURL>/HtmlPageHandler/desc.xml</SCPDURL>
                <controlURL>/HtmlPageHandler/ctrl</controlURL>
                <eventSubURL>/HtmlPageHandler/evt</eventSubURL>
            </service>
            <service>
                <serviceType>urn:schemas-dm-holdings-com:service:X_WholeHomeAudio:1</serviceType>
                <serviceId>urn:schemas-dm-holdings-com:serviceId:X_WholeHomeAudio:1</serviceId>
                <SCPDURL>/WholeHomeAudio/desc.xml</SCPDURL>
                <controlURL>/WholeHomeAudio/ctrl</controlURL>
                <eventSubURL>/WholeHomeAudio/evt</eventSubURL>
            </service>
        </serviceList>
        <presentationURL>http://192.168.178.7</presentationURL>
    </device>
</root>
starkillerOG commented 3 years ago

@pimw1 this PR schould fix your warning: https://github.com/scarface-4711/denonavr/pull/222

pimw1 commented 3 years ago

thanks starkillerOG! Are you sure this will fix it? The PR is mentioning device_info xml, while our investigation shows it is available in description.xml .

starkillerOG commented 3 years ago

Yea it is called device_info but the URL is description.xml, I mixed the terms a bit sorry, anyway the relevant lines of code is this: https://github.com/scarface-4711/denonavr/blob/31bca2812908bef76db1ff047e89aa07c29ae222/denonavr/foundation.py#L299-L304 It calls the description.xml.

It schould work. (although first it needs to be merged, then a new version of denonavr needs to be published and then that version needs te be included in HomeAssistant and then in the next version of HomeAssistant it will be fixed).

pimw1 commented 3 years ago

Nice! Thank you very much for helping out. It sounds like a long path to walk until the release. I'll patiently wait ;)