LAN ssdp:all discovery?

Is there an example of how to formulate the proper call to generate a general ssdp query?
I know how to query for a class of devices, e.g.:
sendHubCommand(new physicalgraph.device.HubAction(“lan discovery urn:schemas-upnp-org:device:MediaServer:1”, physicalgraph.device.Protocol.LAN))
I would like to generate the general query to see “what is out there” on the LAN.

3 Likes

What happens if you use urn:schemas-upnp-org:device:Basic:1?

subscribe(location, “ssdpTerm.ssdp:all”, ssdpHandler, [filterEvents:false])

sendHubCommand(new physicalgraph.device.HubAction(“lan discovery ssdp:all”, physicalgraph.device.Protocol.LAN))

maybe

I used a different approach using http, it’s not really discovery. I did the “discovery” manually - this is more about communicating with the “device” without polling, there are 2 things involved in doing that

  1. You would need to send the IP of your hub to the device - if your device can respond to http then you can send it from ST by collecting the device IP and port in some sort of a registration get call. Or if the device is discoverable via ssdp do the discovery from ST. Point is that discovery must start from ST not the other way around. Makes sense since ST is the device controller.

  2. ST hub needs to know the MAC address of your device - if you are doing a SmartApp you can then subscribe to a location event. If it’s a device handler it needs to DH’s network id. Then you can send any http message to ST and handle it either in a event handler in a smartapp or the parse handler in a DH. I like the smartapp route better, it’s a bit flexible and also allow multiple apps to listen in, if you do a DH the lan message seems to only route to one DH.

Look for the Amazon Dash button app in the forums for an example of using the http based discover and recieving messages without polling.

I am working on a smartapp and DH that does something similar for X-10 devices but my work isn’t complete yet. It sends a registration message to a http responder and records the device MAC from the response header, the responder doesn’t have to send the MAC, ST hub will provide this in the event object. It processes any incoming message from that MAC and ignores any messages not targeted towards it. You can look at it here - https://github.com/enishoca/SmartThingsX