How to get low latency automations?

I’m new to smart home automation and have got a couple different devices from different vendors.

I have a very simple SmartThings automation rule which turns a device on/off whenever another device is turned on/off. The master device is a hard wired (mains) Kasa switch and the slave is a generic 12V LED lighting controller(Tuya). Both devices are connected to ST by linking their respective accounts to ST.

My problem is that there’s a substantial delay in turning on the 12V controller, something like 2s, might not seem like a lot but these different devices are in close physical proximity so it feels very weird to have them come in sequence and not simultaneously.

My question is, how can I get this latency down? Sub 100ms should be technically feasible because that is the delay to manually toggle both devices from the ST app. But when run via automation there’s a huge delay.

My research about ST has led me to believe that I now need a ST hub and to install “edge drivers” so I can run the automation locally, the problem is caused by having to wait for events from one cloud service, process them on ST cloud service, ask a 3rd cloud service to turn on the slave device, and finally return to my local network to actually trigger it.

However there isn’t a lot of information on how to force automations to run locally, for example answers like this one (What determines when a routine is run locally? - #2 by h0ckeysk8er) would imply that there’s no way to do it with my setup because I have devices on 2 different clouds. Is my only option to buy the ST hub and try it or is there some way to know of this automation can run locally beforehand?

I also tried using another Kasa device as the slave but the delay is the same. Seems that automations introduce a fundamental delay or is ST just being “dumb” about it and roundtripping the trigger through its own cloud even if all devices involved are from the same vendor)

St has no choice to round trip the devices if they are not ZWave Zigbee or Matter where they can be controlled locally.

Vendor provided clouds such as Tuya have had this issue since the dawn of smart devices and why Matter, ZWave, Zigbee (esp32 based devices in some cases) exist. They want to control the experience

If you want to reduce latency in ST start researching local capable devices using industry standard transports using the technology stacks noted (ZWave, Zigbee, Matter over Wifi and Matter over Thread) and use the techniques in Hockeystar’s article to avoid parts of routines that aren’t Capable of running locally

3 Likes

Your Kasa device might be supported by the TP-Link Kasa Edge Driver (also LIFX) which is one of the few LAN based Edge drivers that supports Wi-Fi devices (there are a few others like the ones for Bose, Sonos, and other media players). So while that could give you local support for the Kasa device(s), I don’t believe I’ve seen an Edge driver for Tuya Wi-Fi devices. Without all devices in an automation being able to run locally, the Routine will fall back to executing in the ST Cloud.

4 Likes

Thank you for the replies. It seems that my Kasa devices can be supported either via the edge driver or via Matter (while most of my Kasa switches are not Matter compatible, I have several which are, and I only need low latency on a few switches).

It seems that my issue is the Tuya device. I’m certainly open to replacing this device, but I don’t know where to start with determining compatibility. I haven’t been able to find a comprehensive list of known compatible with local control devices. I also don’t know from looking at the spec of a particular device if it will work, many say “x,y,z compatible” but this says nothing about local control.

For example if I look at this device is there any way to see from the product spec if it will have local control?
More generally could you recommend any vendors which have 12V controllers compatible with local control?

Zwave, Zigbee, matter over thread and WiFi over thread should all be eligible to run locally, although it also depends on the exact routine you are running, as there are some individual things in a routine that can push it back to cloud operation.

@h0ckeysk8er has been keeping a list of things that can push your routine into the cloud, so he may be able to say more. :thinking:

WiFi which is not using matter is trickier. This requires an open API or a server configuration where you use a different device, like a raspberry pi, or a laptop, as a server on your local LAN and then you communicate with that from an edge driver.

The official integration with Shelly devices is cloud to cloud. But there is a community-created integration which uses an edge Driver and is local. You can read more about it and ask about specific Shelly devices and configurations in the following thread:

Edge Shelly drivers for Gen1 and Gen2 Devices

As @nathancu already mentioned, the easiest answer is stick with devices that use zigbee, Z wave, or matter which communicate communicate directly to a smartthings/Aeotec hub (not to their own third-party hub). Those will definitely be eligible to be local, it just depends on the details of each routine you use.

Wi-Fi devices are trickier. It’s possible for some but not for others, you just have to research model by model.

one more less common situation: if you have more than one smartthings hub on your account, and you combine devices from multiple hubs in a single routine, that will run in the cloud rather than locally, even though you could write a different routine where each individual device could run locally. It’s just the way they currently manage multiple hub communication. It’s possible this will change in the future, but this is the way it is as of the date of this posting.

2 Likes

Thanks for your help guys. I’ve been researching trying to find a suitable controller. Part of my problem is that there are no “reputable” or “well known” vendors which seem to make such devices, so it’s hard to find people talking about their success or lack thereof using a specific device, many of them don’t even have model numbers or other identifying information, it’s all random re-branded copies of the same generic device (not to mention, such devices have no hope of being uL/cUL listed). I found a couple which claim to be zigbee compatible and am waiting on the orders. At the same time trying to source a ST hub (seems to also be a rarity).

I’m starting to feel that this is not a popular setup in the smart home world. I’ve also considered just using a smart plug and connecting a 12V power supply, unfortunately every 12V power supply has a substantial startup time (lowest I’ve found is ~500ms) so adds even more to the delay.

I’m now considering a “dumber” solution, but unfortunately it doesn’t seem like there are any off-the-shelf solutions for this type of thing (think RF or infrared based relay - lots of remote controlled ones but nothing suitable to be triggered by on/off state of a switch). And of course the dumbest of the them all, run wire between the locations, would cost me a couple $100 but might save me a lot of headache!

Again thank you for the suggestions, if I ever have any success I’ll report back.

The SmartThings-compatible hub which supports zwave as well as Zigbee is now made by Aeotec. There are occasional supply chain issues, but it is usually available on Amazon from Aeotec itself, or from Amazon itself. I would be cautious about other third-party sellers. Zwave uses different frequencies in different geographic regions in order to avoid conflicts with local first responder services, so make sure you get the right one for your region.

US Model at Amazon

https://www.amazon.com/Aeotec-SmartThings-Gateway-Compatible-Assistant/dp/B08TWDNQ5Q
.

UK/EU model at Amazon UK

https://www.amazon.co.uk/Aeotec-Smart-Home-Hub-version/dp/B08MXG6WTB?th=1
.

Samsung itself also offers the newest SmartThings hub model, called the “SmartThings station.“ It has Zigbee, thread, and Wi-Fi, but no Z wave. That one is widely available from many retailers that offer Samsung products, as well as Amazon or the Samsung site.

https://www.amazon.com/SAMSUNG-SmartThings-Station-Wireless-EP-P9500TBEGUS/dp/B0BRNST1JB/

Note that it is sold both with and without the power brick, and it works best with its own power brick as if you have a galaxy phone it can also serve as a ultrafast phone charger. With other brands/models that support wireless charging, it will still probably work, but much slower.

Both models support matter over thread and matter over Wi-Fi.

If we’re still talking about the use case from post one, and by “controller” you mean something to control LED lights,

I have a very simple SmartThings automation rule which turns a device on/off whenever another device is turned on/off. The master device is a hard wired (mains) Kasa switch and the slave is a generic 12V LED lighting controller(Tuya). Both devices are connected to ST by linking their respective accounts to ST.
.
My problem is that there’s a substantial delay in turning on the 12V controller, something like 2s, might not seem like a lot but these different devices are in close physical proximity so it feels very weird to have them come in sequence and not simultaneously.

Then Shelly offers some UL listed Wi-Fi options that should meet your description.

The standard integration is cloud to cloud, so two seconds would be considered an acceptable response time in the industry. But I do understand how annoying the “popcorn effect” can be when multiple lights in a room come on separately.

As we mentioned upthread, there is a community built Shelly integration which runs on the local LAN, but you will have to have A SmartThings compatible hub to run the edge driver for that. You can ask more questions, and get configuration requirements in the author thread for that edge driver:

Edge Shelly drivers for Gen1 and Gen2 Devices

As for other “reputable“ LED controllers, you’re probably just not familiar with the names since they are usually big Chinese companies. But there are quite a few of them, including Gledopto.

And of course, Tuya is one of the largest Home Automation companies in the world. (If a device works with the smart life app, it’s likely it was originally made by Tuya and is rebranded by another company.) you can get local integration with many of their Zigbee devices, but it does get tricky as they use a lot of proprietary code. And definitely not UL listed, this is a budget brand. So I don’t know if you want to go further down that particular path, but there’s a ton of forum discussion about those devices.

Have you had a chance to look at the community FAQ on LED strips?

ST-compatible RGBW LED Strip Controller Reviews (2023)

Yes, still talking about LED light strip controllers, sorry if I was vague.

That article you linked was very helpful! I’m going to probably try a couple different vendors listed there. I already have the LED strips, they are “dumb” but I’m very happy with their performance, so now looking for the smart LED controller.

Also I am in Canada, there’s no Canadian company which appear to stock the ST/Aeotec hub and shipping from US esp. around Christmas is slow and/or expensive (due to customs mainly). I’m trying to find one which ships from Canada but if I cannot I will order from US amazon

2 Likes

Aartech has it at the time of this posting, but they do tend to be a little more expensive than other sellers

Thanks for the suggestion, I’ve seen this site, honestly the price isn’t that much different than US amazon after duty/shipping/conversion rate. My only problem with Aartech is just return policy, I have already returned a hub from a different smart home app (google) which I purchased at a local store, I like amazon for this reason or local stores. But you have given me several good options for getting the hub, I really appreciate it. Maybe I need to just take the risk and spend $150 on something I may not end up using, I feel like it’s a good purchase if you have many use cases for it, but I have exactly one use case.

1 Like