Service Manager Design Pattern¶
Devices that connect through the internet as a whole (cloud) or LAN devices (on your local network) require a defined Service-Manager SmartApp, in addition to the usually expected Device Handler. The Service Manager makes the connection with the device, handling the input and output interactions, and the Device Handler parses messages.
When using a Cloud-connected device, the service manager is used to discover and initiate a connection between the device and your Hub, using OAuth connections to external third parties. Then the Device Handler uses this connection to communicate between the Hub and device.
When using a LAN-connected device, the service manager is used to discover and initiate a connection between the device and your Hub, using the protocols SSDP or mDNS/DNS-SD. Then the device-handler uses UPnP/SOAP Calls or REST Calls to communicate outgoing messages between the Hub and device.