I’ve posted the code for my SmartThings multi-switch project to Github.
There you will find 3 files.
- smartthings_controller.ino – the Arduino code which communicated with the SmartThings cloud using the SmartThings Arduino library. I’m using an Uno.
- device_handler.groovy – the device handler code. This defines the device for use in the cloud and its UI in the SmartThings app. It is specific to the hardware, but not the use of the hardware.
- SmartApp.groovy – the SmartApp code. This defines how the device is used. In my app I tie specific hardware bits to specific device types (e.g. switch, switchLevel or musicPlayer).