Is there a mechanism to locally send a command to a device

I would like to be able to send a command to a device (hub connected) from a local source that is not reliant on the cloud/internet. Something like a REST API that is local.

For example, I would like to switch on a light without using the phone app.

Is there a mechanism for this?

I don’t think there’s an official mechanism, but hopefully someone will correct me if I’m wrong.

It IS possible to use an Edge driver to communicate with a separate server device on the same LAN. Then have that server device send out messages. For example, TAustin has an mqtt project based on this structure.

Take a look at his LAN projects. They are on the Miscellaneous quick browse lists in the community-created wiki. Really clever stuff. :sunglasses:

But of course this method does require a server device.

1 Like

Yes I am looking at that. It isn’t quite what I am looking for as I think (please correct me if I am wrong) you have to have an edge driver for every device you want to send a command to and I am looking to be able to send a command to any hub connected device.

The closest I have got in my thinking is to have my local service trigger a rule (through a single edge driver) which could trigger a device…I would have to manage the rule definition. This seems clunky …but I haven’t completely given up.

1 Like

The integrations like the MQTT project don’t require an edge driver for every single hub connected device. There’s just one edge driver that takes you to the integration server. But You can ask in that project thread for more details.

1 Like

I did ask in the thread. I didn’t get any response.

Thanks for your suggestions

I think the MQTT thread acknowledges the problem of receiving an mqtt message and acting on a device.

It’s fine, if the device is a custom edge device then it just consumes the mqtt message and effects the command

I don’t think the integration server would help me as it still needs a way of effecting a hub-connected device. A SmartApp would definitely help, but then I don’t think that would run locally.

Is there any SmartThings resource who could respond.

I want that ‘Edge driver’ to effect a command on a hub-connected device rather than send out messages (local if it is a local device)

Sorry this architecture is so complicated and the documentation a bit dispersed, I find it difficult to be precise

1 Like

Yeah, I understand. We as customers have very little access to the hub. Smartthings basically just regards it as a box of radios plus the smartthings-supplied firmware. They don’t let us run stuff on it most of the time.

Hopefully someone will give you an answer eventually.

There are 2 MQTT current threads. One from a person asking a question, and one from a developer who created the integration project. I don’t see any posts from you in the actual integration thread, you might try there.

1 Like

Hey, sorry if it was me that didn’t respond!

Not sure if I’m following what you are wanting to do. If you want to send a command to a local device, but have no dependence on the cloud, then that excludes the use of the mobile app. But it doesn’t exclude running automations, since they can be 100% local. So are you OK with triggering your device from an automation, or do you want to also be able to do it manually? If manually, what would you use - some application running on a computer on your LAN?

1 Like

Hey don’t apologise…If not for your contributions I would have given upon SmartThings a long time ago. That MQTT thread is pretty long and messy.


Yes ‘Manually’ using a application running on the LAN.

Hey thanks…I missed that second thread…What an idiot!!! I think if I had posted there I would have probably gotten a response, the other thread is quite messy

This thread is much clearer, although I still don’t think it solves my requirement

1 Like

OK, got it. That would be fairly simple assuming the device has some kind of published API or supports something like MQTT.

Are you going to develop this application yourself?

The other thing is, if you controlled this device remotely, and it is also a SmartThings device, then you’d want to be sure that SmartThings is also getting synched with any state changes. That would happen automatically if the device is already integrated into SmartThings, but if you need to, your app could also use the SmartThings API to update SmartThings.

Hmmm… I don’t think I am explaining this properly sorry!

As an example, Say I have a zigbee light connected to my hub using a stock default driver. I want a way to tell smartthings to turn this on from a local application that I will write. The API you mention would be whatever smartthings supports (or an exposed interface from a smartapp, this would be easy I would think, but, it would not be local would it?)

Or…using MQTT…say I publish an MQTT message to turn said zigbee light on.

I think this MQTT pattern was mentioned in the long MQTT thread, where you noted that an edge driver cannot send a command to device controlled by a different driver.

Have I lost the plot here?

I’ll be honest, I think you have two choices here.

  1. just wait and see what Matter brings. Matter is “local first“ and there are going to be several apps which can control matter compatible devices locally, as Apple’s HomeKit already does. And as ikea Dirigera probably will. That may put market pressure on smartthings to move their app local, but no promises.

  2. or, if local app control is really important to you right now, move to a different platform that has it. There are several that do.

Trying to figure out how to get smartthings to do this with its current architecture design is probably way more work than it’s worth given the alternatives.

JMO, of course.

1 Like

Thanks…I am getting to the ‘move platform’ point, but given the effort involved and the fact that most things sort of ‘work’ I want to try and get an ‘official’ statement that what I am asking for is not supported by the Smartthings Architecture?

I also haven’t given up on the ‘rules’ approach as I think that is a mechanism that can execute globally and can impact multiple devices. Its just a horrible learning curve for me

Have we lost all contact with the Smartthings Dev team? Is there a way I can get a view from them?

Ohhhh, I see. Yea, unfortunately zigbee and zwave devices are going to need to be controlled by a driver on the hub.

Of course that driver is running locally and can control the device without a cloud connection. So what you need is a way to trigger the Edge driver to perform whatever command you want to send to the device.

Sorry it took me so long to understand :slight_smile:

This is certainly achievable and could be accomplished in more than one way. If MQTT is an option, then for sure you could simply send an MQTT message and I have a driver that creates and controls devices based on those messages. You could then create an automation routine that controls the zigbee/zwave device based on the virtual MQTT devices that my driver creates. Simple!

EDIT: Here is the readme for the MQTT driver you could use: MQTT-Discovery/ at main · toddaustin07/MQTT-Discovery · GitHub

1 Like

I would also promote the LAN motion sensor is a form of a solution too. While designed to serve as a single purpose device, my Blue Iris controlling a lan motion sensor is definitely a version of what was described.

Combined with the web requestor you have both directions.

It feels like the gap comes back to interacting with other devices outside of routines.

Lastly, I would echo @Davec comments. I, too, would have abandoned ST without Tod’s (and others) extensive work with edge drivers.

1 Like

MQTT is definitely an option. So, I would have to make your driver create a virtual device for every device I want to send an MQTT msg for? And then create an automation routine that matches that virtual device with the zigbee device?

Have I got this right?


Yes…I think this is the crux although I would add ‘locally’ as I think a SmartApp could achieve this

One of the reasons I am persevering with this is that I think a lot of the pieces are there, this local interaction seems to have not been explored.

And…as I said before, I think rules might help,but sigh I am totally ignorant at the moment regarding rules

I have yet to hear of a smart app that could talk directly to the hub but I’m not an expert in that space. I thought they could run locally but used the API to connect.

I think Tod has something for his personal use and can likely comment on that.

Yes, using my edgebridge app would be an alternative to using MQTT. Not only is there a motion device on the SmartThings end, but I also have a presence sensor version and a simple momentary button for triggers.