Is there code that acts as the smart things hub?


(John Mancini) #1

Is there source code that I can access that can act as the hub for a smart app? For instance, when data is sent from the smart app to the hub, this hub library would have some sort of getData method that would allow me to retrieve said data? This is not the only access method I would need. I am looking for a library that fully or at least partially represents the hub a smart app is connected to. This would be greatly appreciated!

(Dan) #2

The SmartThings Hub is a closed source product. So, there is no way to emulate one yourself.

This doesn’t mean that there are no options though. What exactly are you trying to accomplish? I have a project (ST_Anything) that allows bi-directional communications between the ST Hub on your LAN and an Arduino/ESP8266/ESP32 type of micocontroller.

You can also directly communicate from the ST to other computers on your network that support RESTful API’s.

It really depends on what your needs are.

(John Mancini) #3

Thank you for replying. My end goal is to be able to use some zigbee compatible device that can act as a middle man of the IOT device and the smart thing hub, to filter out data transmitted between them. I want the IOT device to think my device is the hub, and the hub to think my device is the IOT device. I hope that makes sense.
In regards to your project, what does the Arduino function as? What sort of information can it receive from the ST Hub?

(Dan) #4

So, if I understand you correctly, you basically have a Zigbee device currently connected to the ST Hub. You want to add a custom device between the ST Hub and the Zigbee device. Is that correct? May I ask why you need to filter the communications between this the device and ST hub? I can think of a few ways to accomplish this, but they all involve inserting another home automation ‘hub’ between the ST Hub and the Zigbee device. For example, you could insert a Hubitat Hub, which has very good Zigbee support, and allows you to write your own drivers (very similar to SmartThings, but is 100% local processing.) There are apps you can load on ST and Hubitat that then allow data to be transferred between them.

ST_Anything allows you to create your own devices. For example, I have pre-wiring in my home for an alarm system. Instead of buying Zigbee/Z-Wave door and window sensors, I simply hooked up the existing wiring to an Arduino. This in turns results in SmartThings devices being created. I also use it to control a relay for each garage door, allowing me to open/close the doors when away from home (have you even forgotten to close your garage door, or had to turn around to prove to yourself that you did?). I also have a motion detector attached, as well as temperature and humidity sensors. The library is pretty extensive and implements many of the ST Device Capabilities.

Take a look at

You can also simply use the communications libraries to completely roll-your-own Arduino sketch, if desired. Let me know if you have any additional questions.