Node-Red and Smartthings

Would like to publish out data from my ST to mqtt and integrated into Node-Red.

Is there a beginners guide or set of links that can help me?

Thanks
Rav

+1…

@jklondon, my current setup is a bit long winded but I use the stack: Smartthings > IFTTT > Maker > Firebase > Node-red. Either this or HTTP POST directly to the Pi and then mod Firebase from there for persistence…

It doesn’t use MQTT, however, it mimics it somewhat. Check out node-red-firebase-contrib. You can set it to listen out for changes to your Firebase endpoints and then act accordingly.

I’m playing with Mosquitto at the moment so may have more info about MQTT soon.

I won’t go into it further for fear of patronising you, however, am willing to give you a run through if you want.

@shooftie is this one way communication or can Node-red talk to smartthings?

Node-red can talk to Smartthings, yes, again using IFTTT. The Maker channel can accept web requests and therefore you might find it easier to set up complex rules this way; rather than battle with Modes and Routines.

IFTTT is not the only option. RESTful endpoint hosted by your SmartThings API/portal using “Cloud Interface” SmartApp from @MichaelS and used/invoked by Node Red. However, it’s just going to be a URL w/o any security but a nice long token that only fools try to bruit-force (which I’m sure ST filters after X failed attempts) given its length. Having said that, it can be sniffed out from traffic if you don’t encrypt traffic. The next step is to implement OAuth in Cloud Interface and use that within Node Red. Here’s the link to the SmartApp.

1 Like

SmartThings <> MQTT <> Node–Red
I do this and it works well
Need to be vigilant for ‘race’ conditions though.
I dont have a guide as such but it’s very straightforward.

@xAPPO what SmartApp, etc. are you using in SmartThings to leverage MQTT?

All the best!

I’m using this.

I have made some minor tweaks to suit my setup better and also to avoid some race conditions, it works pretty well for me.

K

Thank you!!! I saw that and its popularity just wanted to make sure not to go down a dark alley. Appreciate the response.

New to all of this but I got it working last night on my raspberry pi and Node-RED using mosquitto.
ST<>MQTT<>Node-RED using smartthings-mqtt-bridge via NPM install. I didn’t use Docker like it suggests as i am unfamiliar with it. It’s working great so far. Now my AeonG1 home energy monitor is reporting power readings to my Node-RED ui as well as various lights and switches from ST.
Thank you everyone for all that you do.

Hi Guys, can one of you with a successful setup please post a video of how you did it.

Thanks

I’ve got Node Red <-> SmartThings working without the MQTT-Bridge (which I could never get working). There is a discussion on how this is setup on reddit.

@arkieguy can you give me a few pointer on what to do as I have install the smart app for the Node Red and follow the instruction that your pointed to on reddit? When you install the node red webhook did you get OAuth and which one do I use I try both Client id and secret no luck? when into the smart app and use the url http://192.168.1.???/smartthings/webhook and use the https: maybe there is something that I’m missing?Thanks

Never mind I finally got it working.

I had a hell of a time getting it to work until I included the port number in the setup of the SmartThings app. The instructions don’t show that you have to enter the port number. As soon as I did, it started working.

does anyone have any flows that can share a pictures of to show an example? Thanks

You are in the Hubitat forums also correct? Most of my flows are HE intensive because I only have a few things on my ST hub. It seems that the ST integration works a little different. The HE one has different nodes for a Device vs a Command but the ST one seems to be one Node for both. My only examples that incl. a ST device are for controlling the cheap Home Depot EcoSmart Remotes & those flows probably won’t help much. I also use some Ecobee sensors that get temperature readings into NR. What specifically are you trying to do?

@smn Yes that is me at the Hubitat forum. Smartthings flow are very different and I learn best when I see an example. I try to use the Smartthings nodes for about two weeks now and had no luck and thought that I would ask if anyone have some examples that they would share just to learn as I do have some things left on Smartthings Hub at the moment. Thanks for the response.

Can you tell me what port number you used? Thanks you!

Should be your Node Red port. Mine is 1880 which I believe is default.