Closed stephanfevrier closed 5 years ago
Hello Stephan,
Thank you for your report and for providing the additional information. From the logs there are two errors. The first is a generic when reading the XML. To solve this I want to ask you to get these files and put them somewhere online or mail them to me:
These files together provide the description for which services the device provides.
The second error is that your device is sending an update but the software is not properly reading this. Can you add this to your home assistant configuration:
logger:
default: info
logs:
homeassistant.components.media_player.dlna_dmr: debug
async_upnp_client: debug
async_upnp_client.discovery: info
async_upnp_client.dlna: debug
async_upnp_client.traffic: debug
This will silence home assistant mostly, but report a lot of data about UPnP/DLNA. If the logs become too long to copy/paste here, please put them somewhere online or mail them.
Hi Steven,
Attached you will find the requested files and logs. Let me know if you would need anything else and thanks in advance for your time and support.
Cheers,
Stephan
Thank you for your reply. Unfortunately, no files are attached to your reply. I think the files weren't added as you responded by mail.
Can you add them again?
I couldn't attach neither XML nor zipped files, so renamed them to txt.
home-assistant.log QPlaySCPD.txt rendertransportSCPD.txt PlayQueueSCPD.txt renderconnmgrSCPD.txt rendercontrolSCPD.txt description.txt
Thank you for the logs. It helped determining what is wrong.
There are two things wrong:
http://192.168.8.135:49152/upnp
) should be http://192.168.8.135:49152/description.xml
;async_upnp_client
to do more effort to try to parse this later this week.Please change the URL for you config entry and try again.
Fixed. If all goes well it should be landing in home assistant in a while.
Interesting. In this case I suggest that, apart from improved parsing, the configuration section of the official installation instructions on https://www.home-assistant.io/components/media_player.dlna_dmr/ should be improved and explain, that URL must point specifically to description.xml.
Nevertheless, my problem does not yet seem to be solved. I still get errors
2018-12-07 20:07:50 DEBUG (MainThread) [async_upnp_client.traffic] Got response:
412
Server: Linux/2.6.36+
Connection: close
Content-Length: 58
Content-Type: text/html
<html><body><h1>412 Precondition Failed</h1></body></html>
2018-12-07 20:07:50 ERROR (MainThread) [async_upnp_client] Did not receive 200, but 412
2018-12-07 20:07:50 DEBUG (MainThread) [async_upnp_client.dlna] Resubscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:FF31F012-4AD3-10B5-A262-4DECFF31F012)>
2018-12-07 20:07:50 DEBUG (MainThread) [async_upnp_client] Resubscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:FF31F012-4AD3-10B5-A262-4DECFF31F012)>
2018-12-07 20:07:50 DEBUG (MainThread) [async_upnp_client.traffic] Sending request:
SUBSCRIBE http://192.168.8.135:49152/upnp/event/rendertransport1
Host: 192.168.8.135:49152
SID: uuid:b0fd90e6-1dd1-11b2-9c9c-9403c60c7e52
TIMEOUT: Second-0:30:00
2018-12-07 20:07:50 DEBUG (MainThread) [async_upnp_client.traffic] Got response:
412
Server: Linux/2.6.36+
Connection: close
Content-Length: 58
Content-Type: text/html
<html><body><h1>412 Precondition Failed</h1></body></html>
2018-12-07 20:07:50 ERROR (MainThread) [async_upnp_client] Did not receive 200, but 412
2018-12-07 20:08:01 DEBUG (MainThread) [async_upnp_client.traffic] Sending request:
POST http://192.168.8.135:49152/upnp/control/rendertransport1
Host: 192.168.8.135:49152
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"
Content-Length: 399
Content-Type: text/xml
<?xml version="1.0"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
</u:GetTransportInfo>
</s:Body>
</s:Envelope>
and
2018-12-07 19:53:07 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/aiohttp.py", line 138, in _handle_request
status = await self.event_handler.handle_notify(headers, body)
File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/__init__.py", line 178, in handle_notify
service.notify_changed_state_variables(changes)
File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/__init__.py", line 467, in notify_changed_state_variables
self.on_event(self, changed_state_variables)
File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/dlna.py", line 170, in _on_event
dlna_handle_notify_last_change(state_variable)
File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/dlna.py", line 52, in dlna_handle_notify_last_change
el_event = ET.fromstring(state_var.value)
File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1344, in XML
parser.feed(text)
File "<string>", line None
xml.etree.ElementTree.ParseError: mismatched tag: line 26, column 2
2018-12-07 19:53:10 DEBUG (MainThread) [async_upnp_client.traffic] Sending request:
POST http://192.168.8.135:49152/upnp/control/rendertransport1
Host: 192.168.8.135:49152
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"
Content-Length: 399
Content-Type: text/xml
<?xml version="1.0"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
</u:GetTransportInfo>
</s:Body>
</s:Envelope>
2018-12-07 19:53:10 DEBUG (MainThread) [async_upnp_client.traffic] Got response:
200
Content-Length: 411
Content-Type: text/xml; charset="utf-8"
Server: Linux/2.6.36+
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<CurrentTransportState>STOPPED</CurrentTransportState>
<CurrentTransportStatus>OK</CurrentTransportStatus>
<CurrentSpeed>1</CurrentSpeed>
</u:GetTransportInfoResponse>
</s:Body> </s:Envelope>
Thank you for looking into this again.
Interesting. In this case I suggest that, apart from improved parsing, the configuration section of the official installation instructions on https://www.home-assistant.io/components/media_player.dlna_dmr/ should be improved and explain, that URL must point specifically to description.xml.
It would be great if you created a pull request for this. However, not all devices name it description.xml
. Still, if you can clarify this, that would be great!
Nevertheless, my problem does not yet seem to be solved. I still get errors.
It takes a while before the new version of the used UPnP-library (async_upnp_client
) is used in Home Assistant. I think (hope) this will be in 0.84.
About the 412. I'll look into that, but as far as I know async_upnp_client
follows the standard. It is also possible your device has too many subscriptions (due to multiple restarts of home assistant?) and returns a 412 instead.
Didn't make it into 0.84. Hopefully 0.85.
It would be great if you created a pull request for this. However, not all devices name it description.xml. Still, if you can clarify this, that would be great!
I have just created my first pull request #7916 to clarify the URL to the device description.
About the 412. I'll look into that, but as far as I know async_upnp_client follows the standard. It is also possible your device has too many subscriptions (due to multiple restarts of home assistant?) and returns a 412 instead.
Your were right. After rebooting the device, the 412 errors disappeared.
Thanx!
I have just created my first pull request #7916 to clarify the URL to the device description.
Great! Thank you for helping others.
Your were right. After rebooting the device, the 412 errors disappeared.
Great as well! I have changed async_upnp_client
a bit (will land in home assistant in the next release) to be even more faithful to the UPnP-standard. Changes were minimal and devices should already handle this properly (i.e., lowercase to upper case, although devices should already accept any form.)
Thank you for reporting and testing!
Hello Steven,
I've been trying to set up my Venz A5 speaker using your component. Everything seems to work, except the controls. I cannot play, pause or change volume through Home Assistant (0.82.1/Hassbian). I would be grateful for your advice.
My configuration.yaml reads
I get the error
upnp_info.py returns