General Concepts on LAN Device

I’ve been reading the documentation and threads on LAN devices and haven’t been able to figure out what they are. Can they be any program running on a computer that can listen on a port and handle http calls? Can I set up an Apache server and have calls from ST directed to a web site? Obviously the site wouldn’t respond with a web page. Alternatively, would stand a alone Ruby or Python program work? I don’t know Python, but what’s one more language. Ruby has a telnet class that I would like to use. Presumably Python does too.

As far as I know, a LAN Device Type is generally similar to a Web Service (Cloud-to-Cloud) Device Type. The protocol for the guts is HTTP.

A LAN Device Type is a bit more complex of the two due to the “discovery” protocols and process used, and the proper use of DNI (device network identifiers).

Philips Hue Bridge is a good example of a LAN Device Type.

There are many more examples of Web Services Device Types and they are generally easier to understand.

FYI: The Amazon Echo / Alexa, for example, is not a “LAN Device Type” … it is “Cloud-to-Cloud”. When you Connect your Echo to SmartThings, the Echo Cloud links to your a Location Object on your SmartThings Account and accesses the Devices you authorize. From that point forward, all commands (on/off/dim) to Echo go to the Amazon Echo Cloud to SmartThings Cloud back to your Hub, then to the Device. There is no direct LAN connection to any of your Devices. This is different from how Amazon Echo connects directly via LAN to your Philips Hue Bridge!

Your LAN or Web Service Device is a “server”… Lots of good HTTP server languages out there … Node.js is a popular lightweight trendy choice these days.

Spark Core / Particle is an interesting example of a web services device, because it is an Arduino compatible that includes free WiFi connectivity to the Particle Cloud.

Thanks @tgauchat. I’m not a fan of Javascript in any form. After writing a few client side modules, I moved on to Dart. Ruby has EventMachine, which appears to do the same thing as Node.js. Where can I find the source code for the Phillips Hue Bridge?


And I also presume you are referencing the SmartThings Developer Documentation as a starting point :wink:.