The parent Media Renderer Connect app is discovering DLNA devices correctly (as seen in trace
log messages), after I replace all instances of physicalgraph
with hubitat
, but they don't get added to the app's dynamically built options list to choose a DLNA device.
I'm out of my depths with this code, but far as I can tell, the problem is due to the HTTP GET for the XML on the DNLA device not creating an event for the app to parse.
When the discovery search is started, the app subscribes to location
, to trigger a locationHandler
routine:
subscribe(location, null, locationHandler, [filterEvents:false])
Using that subscription, events are generated from LAN discovery of DLNA Media Renderers:
sendHubCommand(new hubitat.device.HubAction("lan discovery urn:schemas-upnp-org:device:MediaRenderer:1", hubitat.device.Protocol.LAN))
All of the correct information for any appropriate Media Renderers discovered is parsed as part of the locationHandler()
routine triggered by subscribed events.
But then no event seems to be created by the HTTP GET command, which looks like this:
sendHubCommand(new hubitat.device.HubAction("""GET $ssdpPath HTTP/1.1\r\nHOST: $ip\r\n\r\n""", hubitat.device.Protocol.LAN, "${deviceNetworkId}"))
I've added logging to display various strings and the GET string looks fine and using an external tool calling it does call up the XML text. Here's an example GET string:
GET /description.xml HTTP/1.1 HOST: 192.168.0.157:49152
The deviceNetworkId
is also correct, cross-checked with log output in SmartThings.
But that second sendHubCommand() call does not result in any events.
I'm at a total loss as to how to troubleshoot this. Any help would be greatly appreciated.