Further Understand Question About Piston Configurations

smartapp
core

(Woodrow Collins) #1

So I loaded CoRE recently and so far its been wonderful but I have run into a couple of items I would be interested on getting a bit more clarification on. One particular one is the ability to add a wait option in the piston. Can some one explain to me how to properly use the wait piston functionality? What I mean by this is the scenario I have goes like this:

If user unlocks door
Then:
action 1: Turn on Lights
action 2: wait 5 seconds set SMH to disarm
action 3: stop siren
action 4: set thermostat
action 5: announce entry

I am expecting the behavior of the piston to perform action 1, then perform action 2, and then 3 and so on . So between action 1 and 2 there is a delay and then precedence of the actions. But this is not how things are working. Each action seems to be performed at the same time and the only thing being delayed is the SMH disarm action. How can you setup a piston to operate in the behavior I am expecting? Is it possible? With the current behavior the only way I can think to do something like I am looking for is to create pistons that perform actions and then call the other pistons using a single long action with multiple steps with in that action as I have not found a method for combining location and convenience items into a single action step.


#3

That is correct. The action blocks (USING blocks) run asynchronously in coRE.

What you can do is delay each action, relative to the first action block, but delayed longer then the previous action block. So, for example, you can have:

action1:
action2:
wait 5 secs, do whatever
action3:
wait 7 secs, do whatever
action4:
wait 9 secs, do whatever
action5:
wait 11 secs, do whatever

That’ll get the actions executing in the order you want, but of course, it can also extend the execution time(s), depending on the WAIT times.

I can’t recall what the minimum time you can use for WAIT … I used 2 secs. to separate the actions for the illustration, above. You can try 1 sec., but I think that’s probably too short, IIRC.


(Ron Talley) #4

With SHM, sensor are instant. I prefer this method:

  1. Create Virtual Sensor to mimic the “Trigger” sensor.
  2. Create webCoRE rule that says:

If
Trigger sensor changes to open
Then
Using Virtual Sensor
Wait 30 seconds (or however long you wan the delay to be)
Open

If Trigger sensor changes to close
Then
Using Virtual Sensor
Close

Now use the Virtual Sensor as the new Trigger Sensor for SHM

Piston now looks likes this:
If user unlocks door
Then:
action 1: Turn on Lights
action 2: set SMH to disarm
action 3: set thermostat
action 4: announce entry

This eliminates that need to stand outside for 5 seconds while you wait for SHM to disarm.

Pro Tip-Use presence sensors (mobile phones) to turn off alarm and do all of this stuff while you are driving up the street!


(Woodrow Collins) #5

But how would you add a wait in the action as well as control a device? All I see the option to do when you turn on “using location” doesnt allow you to do anything else related to convenience items such as set a thermostat setting.


#6

When you’re working on the device, select the device (USING device-from-the-categories-listed, NOT “using location”) :slight_smile: So, after selecting “Using your-thermostat”, for instance, you add a task — the WAIT (and a bunch of other fun stuff) is near the bottom third of the list, IIRC.

Also, since you’re just starting in on coRE, I’d make the jump to webCoRE — much easier to create/edit pistons on your computer screen via a brower. It’s more powerful and flexible, plus is easier to follow logic of your piston.


(Woodrow Collins) #7

Thanks for all the recommendations, I loaded webCoRE and will look into tinkering around with it. My hope is to not make to complicated of a setup and fully expect to improve on my piston configuration as my knowledge grows. After sitting down and thinking about things I was able to accomplish my goal by using some do pistons as well as a simulated sensor.

The end result looks something like this:

Simulated sensor is watched by SMH.
Do piston to open sim sens, wait 2 sec, close sim sens.
If external sensor opens then wait 15sec, run piston to open sim sensor to trigger SMH.
If user unlocks door, disarm SMH.

Essentially it creates a period of time before triggering the sensor to alert an intrusion for SMH. Allowing for family members to enter through the entry ways and disarm SMH before SMH is triggered in an away state. Though 15 seconds may not be enough time for some entry ways due to the distance across the house to the iris panel. So that might need adjusting.

Given everyone’s description of webCoRE it probably is simpler using it but till I have time to tinker with it this shall work. If the creator or CoRE/webCoRE has a donation page I think I will be making a donation. These tools are awesome!

Once again thanks for all the help.