Is it possible to write a device handler so that once device is connected to user wifi network, smartthings hub can discover the device without having the user to manually set ip address for the device? if yes is there a code example?
I doubt this can be done reliably in the DTH because it would be a bit of a security issue. A Device Instance is supposed to be tied to a specific Device Network ID that is not changed after it is added.
However, using a SmartApp that spawns Child Devices … maybe?
Read the Developer’s Manual sections on Child Devices, LAN Device Discovery, etc.,
It’s technically possible to scan by using a service manager (not a DH) but there are many limitations in terms of protocols. What protocol are you using and how are you planning to scan?
I’m simply thinking from user perspective. When user brought our device home and connect to their wifi (same wifi as samsung smartthings hub), user should be able to see our device show up in device listing without having to do any initial setup. I’m not sure what security concern there are since the device is already part of the secured wifi network. May be i’m over simplify things here…sorry for newbie question.
There are a few solutions on Wi-Fi presence such as this one:
That’s a reasonable conclusion, but you have to think “big picture” of SmartThings’s overall architecture for Device Inclusion.
i.e., SmartThings generally only adds a Thing to your Account-Location when you use the “Add Things” function in the App, or you manually do something in the IDE. Just like Amazon Alexa only adds devices when you issue the “Alexa, Discover!” command.
There are some exceptions … maybe? I’m not sure, for example, if SmartThings might automatically pick up a new Bulb added to an existing joined Hue Bridge… but I don’t think so. I think you need to trigger the Hue SmartApp to refresh the Bulb Child device list. But I’m not sure.
It’s possible and a few device handler and smart app already doing that.
Check the Sonoff thread.
I think you’ve missed a few steps in between. First the device must have a “device handler” which tells the hub how to communicate with the device because each device is different. It’s like someone hands you an object and says now operate it, you won’t know how to operate it without a user manual because it each product is designed differently.
Second the “wifi” device must have a way to be connected, not all devices do connect to third party products, many are closed systems.
Hence my original question, what product do you want to connect, if ST has support for it or if it needs to be custom integrated.
Then come the questions of whether it should happen without user intervention or through a SmartApp etc.