You would most likely want to implement the service manager design pattern. See: http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/index.html
Cloud and LAN connected devices are devices that use either a 3rd party service, like the Ecobee thermostat, or communicate over the LAN (local area network) like the Sonos system. These devices require a unique implementation of their device handlers. Cloud and LAN connected devices use a service manager SmartApp along with a device handler for authentication, maintaining connections, and device communications. This guide will walk you through service manager and device handler creation for both of these scenarios.
There’s plenty of example implementations on the community forum, e.g.: SmartThings + Raspberry Pi & Homebridge = Siri HomeKit Controlled Smart Home
Most solutions I’ve seen typically use node.js on the Raspberry Pi side and send JSON back and fourth to an endpoint hosted by a SmartApp on the SmartThings side.