Latency

Just got my SmartThings system setup today.

I’m having issues with latency.

For example, with a SmartApp setup to turn on a light when a multi-sensor is opened, I’m seeing > 1s. latency before the light turns on. From having used Control4 and others before, I would have expected near-instant (<50ms) latency. Same problem applies when simply switching on a light directly.

Any ideas as to the cause? I read something about the SmartApps being cloud-based… but I’m assuming they are at least cached locally for performance?

You would assume wrong. The Hub is relatively stupid. (Not meaning to be insulting… just that it doesn’t have a lot of “brain power” or memory on board.) It really only acts as a bridge between the devices and the cloud service. It doesn’t cache apps.

I believe they’re working on this, though. I believe I heard it during one of their office hours. By having the hub not require the cloud to do basic operations (turn a light on if a local switch is activated), it’d A) presumably be faster and B) not make your lamps fail if your Internet goes down.

Things seem pretty rough-around-the-edges right now, particularly for Android users (such as myself). I can say, however, that despite some of the issues, I’m excited by it’s potential considering how young the company is (the Kickstart campaign ended just under a year ago today).

I second what @imbrian said, though I’ll go a bit further and say that I’m excited by what it is already doing as well as the potential for even more.

Granted, much of what I do with SmartThings right now is geeky-nerdy stuff… like being able to turn on my dinning room light by pressing a button on my pebble watch. Pretty cool, but ultimately impractical. Far faster to get my lazy rear out of my chair then to mess with my watch for 60 seconds to send a command thru IFTTT and wait about 30 seconds before all the different communications move thru cyberspace and turn on my lights.

But, there are also already a number of really nice things I’m doing with SmartThings that are practical and beneficial. For example:

  1. When I come home, my garage opens automatically. Then my side unlocks. Then when I open/close my side door, my garage door automatically closes.

  2. I’ve converted a ‘dead switch’ that did nothing into a ‘wireless three way’ that lets me turn on off my back outdoor light from a different spot.

  3. I’ve setup double tap on my back door switch to open my garage door. Now I don’t have to go from den->dinning room->kitchen to open my garage if I’m at my back door.

  4. I setup a motion detector outside my bedroom. At night if someone gets up to use the bathroom the lights turn on at 15%… bright enough to see, but not so bright that it’s blinding. Then they turn off automatically.

  5. I setup a program so my daughter can press a button by her bed to turn on her overhead lights at a dimmed level for a nightlight. Over time they fade to off so they aren’t running all night long.

  6. I have a charger for my phone by my bed that I leave plugged in all the time. But the plug is only on from 10:30 to 5:00am.

  7. I used to panic about my leaving my garage open all the time. Now I have a program that sends me a text if it’s open for more than x-number of minutes and I can easily close it with just a tap.

These are all things that ST can do right now with existing or modified SmartApp programs.

@ImBrian: Definitely excited for the possibilities as well, and adgree that they are doing tons of things right.

Hoping this is in the plan, as if you do a quick back-of-the-napkin calc on the lower limits for latency when using a web-based solution, it’s too slow for “instant” control, even with quick server responses and fast internet connections.

For a simple ‘turn on light when sensor activated’ command:

Sensor latency + Z-Wave latency (variable) + hub latency + ISP latency + ISP->AWS latency + Processing Time + AWS->ISP Latency + hub latency + Z-wave latency + switch latency.

Throwing some numeric bounds on each of those, you’re looking at a pretty slow response even in the best case. Of course if you lose connectivity or have a high latency connection it gets worse. Under ideal conditions maybe you can keep this sub 100ms, but that’s about the upper-bound of what a user will perceive/ put up with.

@chrisb, how’s this garage door setup working for you after some time? Still reliable? What are you using to let the hub know you’re home? Presence tag?

If so, what’s the delay like before your garage door actually opens when you drive up?

@csader: It’s been VERY reliable. I had a program about three months ago with the infamous SmartOutlet. This Zigbee outlet started give programs to lots and lot of people. It essentially was interfering with signals from other Zigbee products (Presence sensors, Multi-Sensors, Motion sensors). I worked with Support for a while and they eventually replaced the unit with a Z-wave outlet for me. Since then I haven’t had a single problem… well until yesterday that is. But that one I knew was coming. My battery in my sensor as been at 1% for like the last 3-4 weeks. It finally gave up the ghost yesterday and my door wouldn’t open. But as soon as I replace the battery everything was fine.

So, reliable? Absolutely.
Presence tags? Yes.
Delay? Well… that all depends… For me right now my garage often starts opening when I’m 3-4 houses away from mine. But, this is because, in a large part, I have a plugged in SmartThings motion sensor sitting in an upstairs window facing the direction I come home. I live on a dead-end road so I only come home from one direction. The plugged in motion sensor acts as a range extender and can often see me from really far away.

Before I put the motion sensor there I would sometimes have a delay of 5-10 seconds at my garage before it would start going up. But… part of that was because of the geometry of my house as well as interference from other objects… namely the neighbors who would often part a van in the “line of sight” from where my hub was located and the direction I would come down the street.

My house would kinda block clean access, and the van would make it worse. By the time I got in front of my house then my house REALLY blocked the signal. Had to go through 95% of my house to get to the hub from the street.

So… Delay? With proper positioning of the Hub and/or Range extender: Zero delay.

@Chrisb I’ll be setting up my garage door automation setup this weekend. My presence tags are quick, but can have up to a 5 second delay after pulling in. It make a lot more sense just to push the garage remote at that point. So, I have created a Tasker app that has a command to flip a virtual presence sensor on when I get near WiFi access points around the block. I have been testing it for a few days now and it seems to be very reliable.

I also had tons of issues with the old Zigbee outlet, and didn’t even know it. My presence sensors would sometimes take several minutes to show me as home, and would sometimes check out randomly. It wasn’t until the outlet died on its own that I realized how much grief it had been causing me. Oddly enough it never seemed to effect the multi sensors. perhaps those maintained a connection straight to the hub instead of going through the extender.

Interesting idea @coryds.

I was thinking of some super-complex directional travel recognition using a mix of AutoLocation on Android and a couple of virtual tiles…overengineering the problem, as usual.

I’ll have to give this a shot.

@csader Hehe, that’s where I started too. For whatever reason Googles geofence API works flawlessly for my work, but can be a bit slow to activate when entering my home fence, even though it works immediately for leaving it. I think google may have a better map of WiFi in that more populated area which is what their geofence API relies on pretty heavily. So I have made a task that uses a bunch of different methods so if one fails another will pick it up.

First is the geofence set to a huge area around my home using the Trigger app which activates my virtual presence tile

Second is about 30 WiFi access points on my street I have configured to trigger the virtual presence tile through Tasker

Third is when I connect to my own WiFi which is as soon as I turn into my driveway through Trigger

If all those fail then the presence tag will work. But, I have never had that happen yet. Usually the first geofence handles it, if not then the WiFi near rule is very reliable.

@coryds I don’t suppose you’ve ever had a false trigger? Where, for example, you lose Wifi for a second, then it comes back and all of a sudden your garage door is opening while you’re asleep? :slight_smile:

@csader That is the primary reason I started working on this vs using the built in mobile presence. That thing would pretty much toggle with the screen going on or off. I have never had a false toggle yet, but then again it’s only been perhaps a week. The hardest part was getting reliable entry rules working, the exit rule has always worked great, although oddly it exits far, far before I actually exit my geofence which is puzzling, but so far irrelevant.

I do have some ideas on how to prevent this if it were to become an issue though. Exit points aren’t as time sensitive as entry so a delay could be added to the rule to make blips less likely. You could also simply not have exit rules at all which would be the safest. You could configure it so the virtual presence tag only turns off when the physical one does, and only use the mobile phone to trigger it on.

@coryds your last idea (only turn virtual tag off when physical one does) seems like it would solve my biggest concern with this whole setup: If I leave the house (with my phone in my pocket) in my wife’s car instead, it would open my garage door when I come back within range.

Problem is, I don’t have a clue where to start to make the virtual tag look for physical tag status before turning off…

@csader It is pretty simple. I just used the built in app that turns a switch on and off when you arrive or leave. The virtual presence tag Urman created identifies as both a switch and a presence fob. Yes, it will try to turn it on again when you arrive, but it’s already on by that point so it’s not hurting anything.

Man, I really over-think these things. :slight_smile:

@csader I actually had to set that up, because I did start getting some false toggles. Mainly because my neighborhood has horrible Play Services WiFi mapping. It is working great now.

@coryds, hmmm…still no cigar for me. Here’s what I have setup, and it still doesn’t seem to want to open my garage when I pull up:

  1. Virtual Presence Tile with switch and presence capabilities

  2. Presence Tag -> Turn it On When I Arrive app to turn on/off the Virtual Presence tile when I arrive/leave

  3. AutoLocation & Tasker -> REST call to turn on Virtual Presence tile when I’m within the geofence (about 1/2 mile radius around my house)

  4. Tasker WiFi Near -> access points near my house trigger the Virtual Presence tile on

  5. Tasker WiFi Connected -> my home wifi triggers Virtual Presence on

  6. Wireless 3-Way App -> Turn on my garage door opener momentary switch when the Virtual Presence tile turns on

If I see one possible reason this isn’t working, maybe it’s #6? Thoughts?

@csader I would turn on notifications for your tasker tasks so you can see where in the process things are breaking down. ALso make sure you run the test command in tasker to make sure they actually work. I had better luck using Trigger for the play services geofencing part, but I am not familiar with AutoLocation, so maybe it fills in on some missing functionality.

Thanks @coryds, I’ll try that. Does my setup above differ significantly from yours?

I’m not currently using an app to open my garage door, as I’m not ready to start parking in it yet (spring cleaning) But, as long as the system knows you are inroute while you are at least far enough away form your home for an action like the garage door opener to matter is the tricky part.

The Tasker WiFi Near has been the most reliable for me, but it only scans every few seconds. What I did was walk about 60 seconds driving distance form my house, and added every single wifi AP all the way back to my house, which was rather substantial. You have to keep in mind though when you leave your house Tasker will trigger on those, so you want to have it timed so your presence tag doesn’t turn off mobile presence until you are past those (which is about 2 minutes)

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.