ESP8266 (Nodemcu) integration with Smartthings

I’ve been trying to integrate ESP8266(to be specific, ESP8266-12E NodeMCU Kit) with Samsung Smartthings and still couldn’t have done it, unfortunately.
Most of what I find on the forums are so outdated (mostly in 2017) and won’t work right now because of many changes during these years.
Asking from ChatGPT or Gemini, both of them instruct me to use Restful API and use Commands. But none of the solutions worked. I used APIs along with my personal PAT to report a simple temperature reading from one of my devices and I used methods such as Commands, Update, Event abd etc. But none of the them worked and ended in encounter such as ’ Constrain Violation Error’ or ‘resource couldn’t be found’ or ‘not acceptable error’ or ‘not a valid value’.
Actually, I’m a bit frustrated and don’t know how to get a reading from these devices and send them to Smartthings Cloud.

I’d appreciate if anyone specially developers could help me to find a way to send these readings from devices directly by WiFi by writing the code in C/C++ in environments such as Arduino IDE.

ESP8266 boards are so capable and can easily integrate with other boards. They support http/https client and server and also support both IPV4/IPV6 while can handle JSON and MQTT and etc with encryption. With having 4MB of flash and 32KiB of ram and 80/160 Mhz CPU, are great choices for integration with Samsung Smartthings.

I use many of them in different projects and I use them to monitor my home totally. From monitoring the amount of electricity current of my house to checking hot water pipes temperature. Plus, monitoring the env such as Air Pressure, Cloud base distances, humidity, Water boiling temperature, controlling my home lights and changing colors and so on.
And I guess that would be awesome if I can integrate all of these with Smartthing.

I’m a noob developer but a senior network administrator. However, I love IoT. I’d appreciate if anyone could help me to get a kick out of the it.

I’ve no direct experience of this area and I don’t really follow what you have been up to with the API. In SmartThings these devices fall under the category of Direct Connected Devices (that’s a link to the documentation) and there are a number of active users of them on this forum.

1 Like

Do you have SmartThings or Aeotec Hub?
If so, do you have an MQTT Broker in your LAN?

Yes, I understand that it’s considered as Directed devices. But what I couldn’t figure out is that how a Directed connected device should send its data to the Samsung Smartthings Cloud? Is it by Restful API? Is it by MQTT? Or any other way?

No, I don’t have any hub (Smartthings hub) or MQTT broker.
Isn’t possible for ESP8266 to directly send data to Smartthings Cloud?

Ah I see. My understanding is they use MQTT. Literally the only reference to MQTT in the section of the developer documentation I linked to is in the first paragraph: “The SDK manages all MQTT topics and onboarding requirements”. So they aren’t shouting it out loud.

Do you know how or to where I should send the MQTT?
Or do you know any alternative ways to send device readings to the Smartthings Cloud?
If you could give me some clue, I can work on it.
But so far, I guess Restful API has a higher chance, but I don’t know how to send reading by it as all the ways I’ve tried failed.

No, I don’t have any hub (Smartthings hub)

What’s the reason for using the SmartThings cloud? Wouldn’t it make much more sense to use Home Assistant?

You would need a ST hub to talk to your self-made devices via REST anyway. Your devices would send messages to the hub where a LAN driver takes care of the rest.

If you are going down the direct connected device route I believe that is all taken care for you by the SDK libraries.

If you are taking a REST API approach then you would presumably need to create virtual devices on SmartThings that you could remotely update.

I’ve got a Raspberry pi 4. Can it act as a ST hub?

No.

You should really get a SmartThings hub and some compatible devices first to get an idea what SmartThings is and how the architecture looks like.

Then you can start developing your first driver (LAN, REST) to communicate with your DIY devices and if you still want to integrate them directly to the ST cloud for whatever reasons, you can do that later.

Well, I’m somehow disappointed. :roll_eyes:

Have you read the tutorials?

have you tried an esp32 ? flashed with tasmota it cam connect to smartthings using matter i’m using one for a motion temperature sensor ,
thanks
martin

1 Like

I use Tasmota on two different ESP8266 node mcus in my house with Smartthings. I don’t use the alarm system that was installed before I purchase the house, and instead, connected all the wired door and windows sensors to the node mcu, as well as a smoke alarm relay , as well as a relay to trigger the siren. The other node mcu controls a relay to my sprinkler system and a relay to control my landscape lights. Tasmota was fairly easy to set up, but it communicates locally to my ST hub and not directly to the ST cloud. With all that said, I wouldn’t consider my setup the equivalent of a professional alarm system, but it suits my goals.