In Tasker, I can run a task every 30 minutes between, for example, 1130 pm and 430 am. My task checks to see if my garage doors are open. If they are, close them. However, if my SmartThings Hub is in pause mode, don’t close the doors. I’m looking to repeat this rule in SharpTools. I think the only way is to add multiple time checks as the Trigger (e.g., 1130, 12, 1230, etc.) and in the Flow check the status of the Hub and if it’s not in my Pause mode, close an open garage door. I don’t want it to Trigger just because a door is open because someone might need it open for a few minutes (and yes there is the risk if that occurs close to a half hour that the door might close unless I’ve remembered to put the Hub in pause). Anyway, is the only way to add multiple time checks in the Trigger? Or is there something I’m missing where I can set a time period and then have it run every 30 minutes during that time period (a la Tasker)? Thanks.
The most common approach for this kind of rule is to use the State Stays comparison. Check out the following post for more details:
When you use the ‘stays’ comparison in a Trigger, the rule will only fire when the selected attribute changes to your target value and stays that way for X minutes.
Fantastic. Hadn’t thought about it that way, although I have used the stays condition in other rules. Thanks.
I create a rule for my garage doors. I tested it and thought it worked. I then copied it to use the logic to lock locks during the night that remain open for 10 minutes. I tested it last night and it didn’t work. I assume my logic is incorrect. I pasted the rule below. I think the issue is that the lock was already unlocked at 1030 when the rule started running (although shouldn’t it already have sensed at 830 that the lock was open and then started timing?). Or maybe I’ve picked the wrong option to lock the lock? Anyway, any suggestions on how to get this to work? I want it to work if a lock is unlocked already at 1030 or if one is opened between 1030 and 445 for ten minutes. Thanks.
By the way, as a follow-up, in my Tasker routine, I usually set up a loop to check to make sure that the lock actually locked because sometimes the commands sent by SharpTools don’t always make it to the lock or garage door. Maybe that’s what happened? I don’t know how to check for that, though. Or to make a loop in SharpTools. For one of my other rules like this, I put in a delay of so many seconds, rechecked the device, and if it wasn’t in the correct state, re-sent the command. Maybe I have to do that here? Thanks.
So, I did some further testing this morning. My lock rule works if I unlock the lock during the time period. It doesn’t work if the lock is already open before the time period I’m checking. Obviously, my main triggers are not correct (or maybe not complete). I’ll keep thinking about it as well, but maybe I need to move the “stays open” into the flow rather than trigger to catch locks that are open before the time period I’m checking as well as during the time period I’m checking? Thanks.
Have you checked the Rule Logs to see what they say?
No. Don’t think I knew there was one. I’ll check it shortly.
By the way, though, even if I check the logs, should my Rule work? Is the logic OK? If the triggers are locks are open for ten minutes, even outside of the time period I set in the flow, it should work, right? Thanks.
From a high-level, it looks right. One thing you might try as a troubleshooting step is to setup a Mode tile on your dashboard. We noticed a bug in beta that the event subscription for modes only gets setup when its use in either a Rule Trigger or on a Dashboard, so if you haven’t used it in either of those places, the mode value might be stale.
OK, I’ll look at that as well.
Just to clarify, are you saying that if I have a Mode tile on my dashboard that this should help with checking mode? Thanks.
Yes. Adding a mode tile will force the system to setup an event subscription for the mode.
By the way, I thought I disabled my lock rule, but I didn’t. I had changed the time to start at 545 am when I was testing. It’s been working all day since I added the Mode tile. Ha. I got home from work and the door locked on me. Well, at least it works! My wife said it’s been acting weird all day. I fixed the rule so it should only work at night. I guess I should be more careful with me “code”. Ha.
OK, rule seems to be working. Yay. However, I keep getting two Pushover notices instead of one. Why would that be? They are identical notices when the Kitchen door closes (for example).
If I remember correctly, you mentioned that you had copied rules from place to place, so you might try modifying the content of the rule you believe is triggering slightly just to make sure it’s not another rule.
The next step I would take is to review the Rule Logs to see if there are any clues there.
I looked at the log. Screen shot below. It appears that the rule is triggered twice when a door is only opened once. Why would that be? Thanks.
Hey, did you see my post where it looks like the rule is triggering twice for each time the door is opened for 10 minutes? Any ideas? Thanks.
By the way, I got wild today and watched a video on how to access the SmartThings REST API using Postman. I was able to view my devices and get the status of one. Now I just need to figure how how to query the API in either Tasker or SharpTools. I’m going way out of my comfort zone here.
Can you PM me the Rule ID so I can take a closer look?
Yeah. I had it in the image but then I thought maybe I shouldn’t make it public so I blurred it out.