Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. SmartThings plugin

SmartThings plugin

Scheduled Pinned Locked Moved Controllers
9 Posts 3 Posters 3.7k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mhkid
    wrote on last edited by mhkid
    #1

    I'm new to the site so this information may be somewhere here but I didn't see it.

    I have a SmartThings v2 hub/controller and have been pretty happy with it so far but have mostly just used it with devices I've bought. Just recently decided to use my prewired security contact sensors as part a home security project and I'm using an Arduino Mega 2560. When I realized how easy it was to build some of my own devices I ran across this site and I want to build more.

    I'm a software engineer so was wondering if there are some examples of controller plugins that others have wrote for other controller or if that are specs so that one could be built for SmartThings. Anyone have some good examples that I could look at?

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      Hi and welcome @eframe,

      There's a really simplistic controller implementation available on github that you can have a look at here:

      https://github.com/mysensors/MySensorsSampleController

      Also, most of the supported controllers is open source projects and their respective plugin is available as open source.

      Let us know if you need more pointers to get started.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mhkid
        wrote on last edited by
        #3

        Maybe I didn't ask the right question or don't understand the answer or possibly both 😊. I would like to figure out how to use MySenors with SmartThings. The link, if I understand what it is, is a link to a custom controller. Isn't that what SmartThings is, a controller? How do I get the gateway to talk to SmartThings? I was thinking some sort of plugin/integration would need to be written? So I might be confused and not asking the right thing.

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          Yes, you would have to write a SmartThings plugin which talks to a MySensors gateway either over a serial or ethernet connection. The protocol is simple and described here.

          The example "controller" I posted above is an example of how to talk to the gateway.

          I have no idea if SmartThings allows you to create/install plugins. But you need to place the code somewhere that keeps the connection to the gateway open and interprets the MySensors messages.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mhkid
            wrote on last edited by
            #5

            Please bare with me I'm learning here.

            So if I understand the controller example you gave me from a hardware perspective there is a RPi that is acting as the controller running Raspian/MongoDB/MySensors/NodeJS. The gateway (eithernet or serial) is a separate device, ie. an Arduino. Then you have whatever sensors themselves. Communication is: Controller to/from Gateway to/from Sensors. All communication between the controller and sensors goes through the gateway. Can the senors communicate with each other through the gateway and not go through the controller? Just trying to get my head straight on the communication path. If I'm using a controller like SmartThings where does MySensors get installed? On the gateway?

            SmartThings provides a set of REST api's for the integration. Does the gateway handle REST api calls? I'm assuming yes since the example is an ESP8266 wifi. Again, sorry if I'm asking questions that are documented already, just trying to absorb all the info.

            hekH 1 Reply Last reply
            0
            • M mhkid

              Please bare with me I'm learning here.

              So if I understand the controller example you gave me from a hardware perspective there is a RPi that is acting as the controller running Raspian/MongoDB/MySensors/NodeJS. The gateway (eithernet or serial) is a separate device, ie. an Arduino. Then you have whatever sensors themselves. Communication is: Controller to/from Gateway to/from Sensors. All communication between the controller and sensors goes through the gateway. Can the senors communicate with each other through the gateway and not go through the controller? Just trying to get my head straight on the communication path. If I'm using a controller like SmartThings where does MySensors get installed? On the gateway?

              SmartThings provides a set of REST api's for the integration. Does the gateway handle REST api calls? I'm assuming yes since the example is an ESP8266 wifi. Again, sorry if I'm asking questions that are documented already, just trying to absorb all the info.

              hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #6

              @eframe said in SmartThings plugin:

              Communication is: Controller to/from Gateway to/from Sensors.

              All communication between the controller and sensors goes through the gateway.

              Not nessesarily. But when a sensor is joining the wireless network it communicates with the gateway (per se the controller). To fetch a unique id and present itself.

              Can the senors communicate with each other through the gateway and not go through the controller?

              Yes, this is also possible. If a node addresses some other node, the gateway/controller won't see this communication. But normally a sensor sends its data to the gateway/controller to have the home automation controller log or react on it.

              Just trying to get my head straight on the communication path. If I'm using a controller like SmartThings where does MySensors get installed? On the gateway?

              The MySensors library is installed on the gateway and all the nodes. When creating the gateway you can choose to have it communicating via serial line or ethernet if your ardiono has a ethernet controller. See build pages for more examples of gateway types.

              SmartThings provides a set of REST api's for the integration. Does the gateway handle REST api calls?

              No not directly. You would probably have to create some integration software which transforms the incoming data to rest-calls. But how would you solve outgoing data (I.e. if you want to control a relay from the SmartThings controller)?. Does SmartThings allow outgoing rest-calls to a service of choice?

              The best thing would be if SmartThings had some real plugin architecture... Most controllers allow running Lua scripts or some other way of writing native plugins running on the controller itself. Really unfortunate if they lock down the box from an integration perspective. That's why I usually prefer to run open source software myself [rant warning ;) ].

              M 1 Reply Last reply
              0
              • hekH hek

                @eframe said in SmartThings plugin:

                Communication is: Controller to/from Gateway to/from Sensors.

                All communication between the controller and sensors goes through the gateway.

                Not nessesarily. But when a sensor is joining the wireless network it communicates with the gateway (per se the controller). To fetch a unique id and present itself.

                Can the senors communicate with each other through the gateway and not go through the controller?

                Yes, this is also possible. If a node addresses some other node, the gateway/controller won't see this communication. But normally a sensor sends its data to the gateway/controller to have the home automation controller log or react on it.

                Just trying to get my head straight on the communication path. If I'm using a controller like SmartThings where does MySensors get installed? On the gateway?

                The MySensors library is installed on the gateway and all the nodes. When creating the gateway you can choose to have it communicating via serial line or ethernet if your ardiono has a ethernet controller. See build pages for more examples of gateway types.

                SmartThings provides a set of REST api's for the integration. Does the gateway handle REST api calls?

                No not directly. You would probably have to create some integration software which transforms the incoming data to rest-calls. But how would you solve outgoing data (I.e. if you want to control a relay from the SmartThings controller)?. Does SmartThings allow outgoing rest-calls to a service of choice?

                The best thing would be if SmartThings had some real plugin architecture... Most controllers allow running Lua scripts or some other way of writing native plugins running on the controller itself. Really unfortunate if they lock down the box from an integration perspective. That's why I usually prefer to run open source software myself [rant warning ;) ].

                M Offline
                M Offline
                mhkid
                wrote on last edited by
                #7

                @hek, thanks that helps a lot. I have more questions the gateway but I'll go over to that part of the forum and research first. :-)

                Agreed about open platforms. I want to try and integrate with what I've got so I will have to try something with the REST api. Yes, it appears SmartThings can make an outgoing API call.

                1 Reply Last reply
                0
                • vasarbobV Offline
                  vasarbobV Offline
                  vasarbob
                  wrote on last edited by
                  #8

                  Hi there. Just wondering did you get anywhere with the smarthings controller ? Did you get anywhere with the smarthings rest calls ECT.

                  M 1 Reply Last reply
                  0
                  • vasarbobV vasarbob

                    Hi there. Just wondering did you get anywhere with the smarthings controller ? Did you get anywhere with the smarthings rest calls ECT.

                    M Offline
                    M Offline
                    mhkid
                    wrote on last edited by mhkid
                    #9

                    @vasarbob I have been able to make a rest call to the SmartThings API. I was using an esp8266 as the gateway but am in the middle of moving that to an Uno with Ethernet shield. The code is a little hacky right now and I am planning on refactoring and cleaning it up a bit. Would eventually like to write a transport layer but that's going to take some time.

                    I also had to write the device handler code on SmartThings. That too is a little hacky and I need to refactor that as well. I'd be happy to share and collaborate if you want.

                    I was trying to get a working prototype going and learn some things about MySensors as well as SmartThings and I think I understand it well enough now to be able to put it together.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    21

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular