@Adrian_C, glad you found SharpTools easy to use and liked it. And, yes Rule Engine is the automation tool like those you named, and we want it to be powerful, extensible but intuitive.
One of the differences for SharpTools.io is the multi-platform support, such as SmartThings, Pushbullet, Hubitat (coming very soon), and more to come, so you can control/automate devices/services from different platforms at one place that you cannot do in each native app.
Since getting my ST hub a few months ago, I been trying to work solely within the ST app & never used webCoRE/ifft, but I’ve run into several situations that made me have to create diff automations between SHM, Smart lighting, & main automaton settings just to create 1 thing! too complicated because there simply isn’t an option to include all the variables in 1 Spot.
So this video is very helpful for me to be able to jump right in & create anything I want in one swoop, rather than jumping into 3 diff automation setting menus inside of ST app. Thx for this!
Nice start, ‘if - then’ is easy, but could you also add an ‘else’? For example I want either of two motions to start a task, but how do I end if both are inactive?
@Dan_Fox You can specify actions in both THEN and ELSE paths. See the example below for your scenario. I added two motion senors as triggers, so either one will kick off the rule.
Then I use an IF_Condition to check the 1st motion sensor’s status, and take different actions. As you can see, I can also add a nested IF_Condition in the case of both them are in active status. Let me know if you need any help.
Triggers:
motion1 == active
motion1 != active
motion2 == active
motion2 != active
IF motion1 == active OR motion2 == active
THEN doMyCoolThing()
ELSE turnTheLightsOff()
So basically have triggers for anytime either of the the motion sensors change state (either to active or to not active).
Then the IF condition in the flow could be to make sure either sensor is active before doing your main action in the THEN. And if neither of the sensors were active, then both of them must be inactive, right? In that case, you could run your ‘end’ action there.
(Another approach would be to use multiple IF conditions in a row with different conditions if that’s more intuitive to you or better meets your needs)
–
One thing to keep in mind is that all triggers are effectively OR’ed together since they are always events.
IF conditions are used to check the state of one or more things. So even if something wasn’t part of the event that triggered the rule, the rule will figure out what current state the item(s) are in so it can evaluate the IF condition.
By default, IF conditions are AND’ed together (eg. when ALL of the conditions are met), but you can change the IF condition to OR (eg. when ANY of the conditions are met).
It looks like the flow in your screenshot will run resumeProgram on the thermostat and change the mode to Away when either of you leave.
Think of triggers as events which kick off the evaluation of the “Flow” in the rule. They are effectively OR’ed together as only one event can happen at a moment in time.
So if you goal is to run resumeProgram on the thermostat and change the mode to Away when both of you are gone, you’ll just need to add an IF condition that makes sure you are both away.
Triggers:
Daddy presence is 'not present'
Mommy presence is 'not present'
Flow:
IF
Mommy presence is 'not present'
AND Daddy presence is 'not present'
THEN
Thermostat to execute command 'resumeProgram'
Barrett to change Mode to 'Away'
PS. We have plans to change the language to make this a bit more apparent. (eg. “Daddy changes to not present”) And perhaps we should add a little -or- between each trigger so that’s more obvious that as well.
There are cases where you want a different item to trigger the evaluation of the rule than you have in your conditions… or you don’t want the condition to act as a trigger at all.
For example, every night at 9 PM, SharpTools.io checks to see if my front door is locked and my garage is closed. If not, it sends me an SMS. In that case, the trigger is time even though the condition is the security of the doors. If the condition was implied to be the trigger, then that rule would only run when the state of either of the doors change rather than at my specified time.
Trigger:
9 PM every night
Flow:
IF
Front door lock is 'unlocked'
THEN
Send SMS to Josh 'The front door is still unlocked'
IF
Garage Door is 'open'
THEN
Send SMS to Josh 'The garage door is still open'
Similarly, you might have a different device or location property (SHM / Mode) act as a trigger and a different item for the condition. For example, you might setup a rule where anytime the mode changes to ‘away’, the system checks if you are present in a condition and takes a different action based on that.
Trigger
Mode changes to Away'
Flow:
IF
Josh presence is 'present'
THEN
Delay 60 seconds
Set SHM to 'Armed'
ELSE
Set SHM to 'Armed'
I meant to ask or suggest… It would be nice if you could offer a way to share Rules. for example, I am going to steal This one.
Trigger:
9 PM every night
Flow:
IF
Front door lock is ‘unlocked’
THEN
Send SMS to Josh ‘The front door is still unlocked’
IF
Garage Door is ‘open’
THEN
Send SMS to Josh ‘The garage door is still open’
It would be nice to be able to import it an replace the specifics to mine. You can do this in webcore. Just a thought…
Thanks!
I am still high on being able to choose multiple items in a dropdown… It is a large reason I havent moved more over. I have the attention span of a gnat… lol
Tried coping your lock/garage one above.
says error creating timing schedule.
How do you get yours to say 9pm every night when mine says 2200 and repeat daily.
Hm. That is an unexpected result. Can you try opening up that rule again and resaving it? @James is looking into the server logs to see if anything seems out of the ordinary.
My apologies - I was just generalizing the rule structure. You’re right that the proper text would be something like Trigger rule at 21:00 and repeat daily. The upcoming development release displays the time in your locale and will default to repeat ‘daily’ now.
Here’s what my actual rule in production looks like (I also have a Pushbullet message that goes out just below the SMS action which isn’t pictured in the screenshot).
Tried again. This rule was one I had before that I changed. I am going to create a “new” rule to do this and see if I get the same error. I will attempt to save again for your benefit of seeing the logs.
EDIT. I cancelled out and went back in and it was saved accurately… Not sure what happened.
@Tommy, thanks for reporting the issue. We found the bug and got it fixed (will be included in the next release). This only happens when a rule has a device event, but then replaced with the timer event.