SmartThings Integration with Spark Core and Relay Board: A DIY Success Story

I’ve been on a mission to create a smarter workshop setup, and I’m thrilled to share my journey with you! My goal was to control multiple devices in my workshop using SmartThings, and after some trial and error, I’ve got a system that works like a charm. Let me walk you through how I made it happen and share some tips along the way.

The Challenge

I needed more control points in my workshop than the single outlet on my GE Z-Wave duplex outlets could provide. Enter the Spark Core and a 16-relay board! I set out to create a custom Device Type in SmartThings to manage this setup. The idea was to control each relay individually through the SmartThings app.

The Setup

I connected my Spark Core to the relay board and integrated it with SmartThings. I wrote a Device Type that communicates with the Spark Core via its API. Each relay was configured to respond to on/off commands, and I set up the UI with standard tiles for easy control.

The Hiccups

Initially, I noticed an issue where the switch status would get stuck in a “turning off” state after turning off a relay. This was a bit frustrating, but I figured out that the problem was due to the lack of polling or refreshing in my Device Type. I decided to add a polling mechanism to ensure the status updates reliably.

The Solution

I implemented a polling system that periodically checks the relay status and updates the SmartThings app accordingly. This resolved the limbo issue, and now the status updates smoothly. I also realized that using the response codes from the Spark Core could help confirm actions, adding an extra layer of reliability.

The Payoff

Now, I can control each of the 16 relays individually through the SmartThings app. It’s incredibly satisfying to see everything working seamlessly! Whether I’m turning on power tools or managing workshop lights, the setup is quick and intuitive.

Tips for Others

  1. Polling is Key: If you’re dealing with external devices, consider adding polling to ensure status accuracy.
  2. Leverage Response Codes: Use response codes from your devices to confirm actions and avoid status discrepancies.
  3. Test Thoroughly: Before finalizing, test each relay to ensure consistent performance.
  4. Documentation is Your Friend: Keep detailed notes of your setup and any tweaks you make for easy troubleshooting later.

If you’re looking to expand your SmartThings setup with custom devices, I highly recommend exploring the Spark Core and relay boards. It’s a fantastic way to add functionality tailored to your specific needs!

Happy tinkering! :rocket: