Does anyone here have any experience with getting data from SmartThings api? I could use some help… Thanks!
I’m currently setting up my MM and was looking for a smartthings module, looks like there is MQTT module, but I’d like to hit the api directly. I saw there is a nodejs sdk (https://smartthings.developer.samsung.com/docs/tools/sdks.html). I’m new to node, so not sure I’ll be of much help, but what are you looking to do.
I’m trying to learn to communicate with pretty much anything that I have set up with SmartThings… currently my thermostat is controlled by it but I’d like to learn how to manipulate that. I’m thinking if I can get that one thing to work then I can pretty much control anything else I have using SmartThings.
I just read there and pretty much get lost…
Yeah, The framework of it can get confusing. From what I’ve gathered you make requests for devices based on their capabilities (i.e. presenceSensor, lock, switch, temperature sensor, etc). Or if you have the device, you can then list what its capable of and get variables of those properties.
Well if I could even get that far I’d be happy LOL
Is there an easier guide or example that you can think of that would help?
johnnyboy last edited by
Hey up Amigo…
I use ST, along with WebCoRE, Automateit, Broadlink RM Pro and Mini (Blackbean) and a host of Alexa devices… and TinyCam Pro as the transcoder for my CCTV to display on Action Tiles… which I have on a 10" Tablet - as a control panel for all my Automation kit that controls about 90% of my home.
Not sure if I can be of any help though, as Im sure you just want to use/utilise/grab the data onto/into MM? Much like what ActionTiles does with ST equipment eh?
I thought you had already set up your whole automation as Tiles on your PC… iirc?
That would be something else if you managed to get this onto MM… coupled with the TouchScreen overlay.
The only 2 household items I have on MM are Sonos, and Hive… Sonos still works good… purely a visual obviously, but Hive is not so good, so kinda gave up on that on MM.
At least with using ActionTiles (on a Touch screen), I have full control over everything, as well as using Alexa too of course, but having the Central control panel comes to it’s own for when guests are here and obviously do not know the voice commands - They simply use the Tablet.
As said, not sure I can help out on grabbing the ST data for MM, but if you want any info on the above kit I use, then I am only too willing to tell you what I can.
A johnnyboy sighting is like seeing Bigfoot.
johnnyboy last edited by
… Hey up Amigo… How’s tricks?
I’m always lurking here … from time to time, to keep up with what you guys are up to
Whenever our other Amigo posts a question like that, I can hear his brain cells clicking away, knowing something good is being worked on
Cool, nice to see you. Yeah, CBD is always working on something. I can’t keep up with him.
When working in the IDE, remember that there are locations, usually a TestHub and Home, I have an additional smartthings in my shop, so you need to select the correct location before creating new device handlers and smart apps.
I’d start with deviceHandlers. I typically find the code on github for the device I’m looking to implement a handler for, then on the API IDE I’ll create the new handler from code (see: https://www.thesmartesthouse.com/blogs/the-smartest-blog/how-to-install-a-custom-device-handler-in-smartthings). Once you’ve published the handler for yourself, you can either setup a new device or if you want to modify a device (such as changing a door sensor, that has wire contacts, to act as a smoke alarm) you update it’s Type field to be the new handler. In your mobile app. you should see it change from a door sensor to a smoke sensor.
There are handlers that work in conjunction with smart apps also. Typically I copy the code for the new smart app the same way, and publish them to work for myself.
So as far as writing my first MM module, I was looking at this node library (https://github.com/hijha/smartthings-node) to act as the client for getting device data from ST. It requires a key to be generated. That key you will generate from the token generation page here: https://account.smartthings.com/tokens
I was hoping to get this created this weekend and play with it, but life got in the way, so hopefully I’ll get something working this week.