since launching 10 years ago, smartthings has been at the forefront of the smart home space, providing delightful experiences that have allowed users to connect their homes and control a multitude of devices from a huge number of hardware manufacturers, growing to include unique features with samsung tvs and appliances. one of the most popular methods to integrate devices into the smartthings platform has been to connect directly to hubs in the home, using radio protocols such as zigbee and z-wave. to date, smartthings has used the groovy programming language to facilitate these device communications. while the groovy framework has allowed developers a great amount of flexibility, the connected home is fast outgrowing this technology and therefore smartthings has had to evolve. beginning september 30, 2022, groovy device dths, smartapps built on groovy, and the developer ide will be removed from the smartthings platform and will no longer be supported. edge drivers using lua have replaced the legacy groovy dths for controlling devices. as has been the topic of many communications throughout this transition, edge reduces the need to send device commands or automations to the smartthings cloud for processing and they are now processed right on the hub, reducing latency and increasing reliability across the connected home. a list of available edge drivers can be found here. as the door closes on groovy-based smartapps, a new door opens for developers with the rules api. developers can build simple or complex automations based on any number of triggers to customize experiences using common action, command, and operand semantics. additional processes and features, such as integrating a manual command, can be developed using the scenes api. smartthings is leading the development and launch of the matter industry standard along with ecosystem partners and members of the connectivity standards alliance. this common protocol will revolutionize the connected home for end users and developers alike. the journey so far has been an exciting one, and the launch of edge drivers and rules apis are the first steps toward taking smartthings and our developer community to more places than we could have imagined months ago when we first announced these updates. stay tuned for more matter announcements as we approach its launch this fall!
session iot, security & privacy smartthings edge: the next level experience discover how samsung is transitioning the smartthings-published groovy dths to edge drivers while maintaining a seamless experience for our users. we’ll walk through the process of onboarding edge-based devices and how to set up an automation with an edge device that runs locally. speakers evan artis smartthings inc. alissa dornbos smartthings inc.
by patrick barrett, robert masen, and zach varberg how we got here last month, we announced the launch of smartthings edge! looking back, smartthings provided a few different ways to integrate devices onto the platform. for hub connected devices we have always used device type handlers (dths). these were written in groovy and would run in a sandboxed environment on the smartthings cloud. while groovy dths helped us launch smartthings, they presented special challenges for local execution on the hub. with the ongoing work to modernize the platform and move away from legacy systems, we wanted to provide a better way to handle devices. similar to dths, we looked to provide a way for developers (both internal staff and partners) to define the behavior of a hub connected device through some combination of data and code. given that one of our primary goals is to support the execution of these on hubs—which we see as the edge of the smartthings platform—we decided to call these “edge drivers.” we set out to engineer a solution that would be able to deliver the developer and user experience that we were looking for. as you may have guessed from the title, edge drivers are built around lua © as the programming language... so why lua? simple the hub is a resource-limited environment. with the need for users to potentially run many edge drivers at a time, we were looking for something lightweight. lua has a small set of core structures and functionality. this leads to a small footprint, which works well for executing on hubs. with the core language being pretty small, it is pretty easy for developers to learn. additionally, as an interpreted language, developers building edge drivers do not need to worry about compiling their code. embeddable it should not come as a surprise that the smartthings hub platform software is a complex system. it is responsible for managing many aspects of how devices connect and execute within the smartthings platform. most of this software is written in rust and c (stay tuned for more on this in the future!) and we needed something that would work well in this environment. when looking for solutions, we began by investigating “prior art” to answer the question: are there other complex systems out there that needed to solve a similar problem, and if so, what did they do? we have a set of core functionality that needs to execute in a performant manner (hubcore), but want to allow extensions that give developers the tools to build unique use cases (device drivers). we found that lua had been extensively used in the video game industry (along with other non-video game software) as a way to allow developers to extend existing functionality—which is exactly what we were looking for! this means that lua could work well with c and rust, allowing your hub to run extensions with a minimal impact to the existing hub software. safe historically, all locally executing dths were either written or reviewed by our engineering teams. allowing users to run code locally on their hub that we did not write, review, and test brings up complex questions about boundaries and guardrails. as a result, it was important to identify a solution that we could sandbox—that is, lock the untrusted code in a room where it cannot hurt anyone else. lua itself provides some opportunities to tweak and limit the runtime. in addition to this, we wrap all device drivers in a second, more secure sandbox layer, with a coherent api to further protect hubs in instances where we did not believe the built-in options were enough. learn more you can visit the smartthings community to learn more about integrating your zigbee, z-wave, and lan devices with smartthings edge. lua is free software distributed under the terms of the mit license. if you want to learn more about developing with lua, we recommend getting involved with the lua community.