JSON data and Smartthings

Hello. Is it possible to send JSON data with POST method with Smartthings?

If so, is there any guides I can follow? (I’m a total rookie)

1 Like

Sure, but it I’m pretty tired right now and not up to long details.

Do you have a SmartThings hub, and if so, which model?

If it’s one that supports Edge Drivers, start with this to familiarize yourself with basic edge driver concepts and terminology:

FAQ: I have no idea what Edge is. Is that a new developer tool? (2022)

Then go to the community-created wiki and check out the quick browse lists for Edge Drivers. Start with the list for “Edge Services” and you’ll probably see something there you can use. :sunglasses:

https://thingsthataresmart.wiki/index.php?title=Quick_Browse_Lists_for_Edge_Drivers

If you don’t have a SmartThings/Aeotec hub or it’s a model that doesn’t support edge drivers it can still be done but it’s a very different process. :thinking:

1 Like

This is the reference documentation for the SmartThings API.

The SmartThings API, a RESTful API, provides a method for your integration to communicate with the SmartThings Platform. The API is the core of the platform. It is used to control devices, create Automations, manage Locations, retrieve user and device information; if you want to communicate with the SmartThings platform, you’ll be using the SmartThings API. All responses are sent as JSON.

API | SmartThings Developers

2 Likes

Yep. What @TapioX is referring to is the second method I mentioned: it works whether you have a hub or not because you are communicating with REST API endpoints the SmartThings cloud.

The first method is to use one of the custom edge drivers that some community members have created specifically to allow you to get SmartThings to send packets to external systems, including json. For example, there’s one for MQTT and one for webhooks.

So it depends in part whether you are asking if there’s a way to send JSON payloads FROM SmartThings to external systems/devices, such as integration with an external HVAC system’s API. Or if you are asking if you can send JSON payloads TO SmartThings (and get responses in the form of JSON). Both are possible, but use different approaches.

Method 1, to get ST to send JSON packets out to other systems/devices, uses Edge Drivers.

Method 2, to use JSON to talk to SmartThings about SmartThings, uses SmartApps or the CLI or the community-created ST API Browser+ To get to the SmartThings API in the SmartThings cloud.

Sorry for the lack of information. I have a Smartthings hub V3

I want my hub to control my HVAC system’s API. I want to control when during the day the HVAC is on/off.

1 Like

Maybe this is solution for your needs

[ST Edge] Web Requestor: a driver to issue local POST and GET HTTP requests - Devices & Integrations / Community Created Device Types - SmartThings Community

I haven’t used this driver so I didn’t know details.

1 Like

You might like to know you can create HTTP devices (for your case; HTTP on/off switch) with this local Edge driver and configure the HTTP request (Method, URL, Port, Headers, Body) for on & off commands to your HVAC HTTP endpoints. It supports JSON data.

1 Like

Thank you very much for the suggestion. It looks like I can only send to HVAC through the internet, not LAN. So this does not work, right?

I’ll try to contact the HVAC support, to see if this is true

If you have an always-on computer available on your LAN, you can get to internet APIs with @TAustin edgebridge app.
Edgebridge - Devices & Integrations / Community Created Device Types - SmartThings Community

1 Like