Webcore Pistions Won't Automatically Run


(A. Harrow) #1

Hi Guys,

Fairly new at this, but I’ve had this piston running for about 1 month with no issues. Then last night I noticed my AC didn’t turn on when it was supposed to, however I got to fire by going into webcore and hitting the “Test” command.

After which I notice that it never stopped and kept running well below the temp stop setting.

So far i have tried doing a zwave repair, restarting the hub, editing, starting and stopping the piston, also created a new piston with the desired outcome using a WHILE statement. But in all cases the pistons only seem to run once.

The expected action is, when I’m home and the temperature is above X and the door is not open for more then Y mins then turn on. If any of these are not true then turn off.

These are the piston facts
Piston state: false
Last executed: 4/7/2018, 12:53:00 PM (this was triggered today via the Test)
Next scheduled: never
Subscriptions: 2 events, 1 control
Devices used: 3
Memory used: 34% (33733 bytes)

Also system variables has this: datetime$nextScheduledTime - Invalid Date

Any assistance would be greatly appreciated.

PS. I only installed the door sensor 3 days ago, but never had issues within the two days prior to last night.

Thanks in advance.


(Paul) #2

Doesn’t seem to me you’re checking the door contact for a period of time to trigger your AC to run, and you may want to put turnning off section into ELSE IF.

For webCoRE specific design questions you can go to webcore’s own forum, there would be more people to help you out:

https://community.webcore.co


#3

Have you confirmed that the Turn Off command works on it’s own without the other ifs? For example, if you created a Virtual switch and then put that as your only if, does the AC actually shut off? What type of thermostat are you using fro this? I doubt your thermostat will respond to a Turn Off command. Some use a setMode type command. It will all depend on your DTH. Also, how is your thermostat reporting back to ST the temp changes? If it is on a time basis, there will be a delay between your thermostat dropping below a temp and then the ac turning off.


(A. Harrow) #4

Thanks Paul,

I moved the Turning off section into ELSE IF, but i have a follow up question. How do i “check the door contact for a period of time to trigger the AC to run”?

This is what I noticed today:

After manually starting the piston with a test, it behaved normally until i left the house later today and it just kept running, ac never turned off although my presence was set to away.

I used the ST mobile app to just turn off the AC whilst out of the house.

When i got back home, my lighting pistons fired just fine, however it was not until I opened and closed the door the AC piston fired.

Remember this was working fine with zero issues until Friday, and I didn’t change a thing. The only new code is that of the door sensor which was done 2 days before the problem arose.

Thanks again.


(A. Harrow) #5

Turn off command works on its own, and the piston was behaving as expected for a month until Friday. I am using a Sensibo Pod btw.

I am wondering if to remove the door sensor and just monitor it for a couple days since that was the most recent change.


#6

Try changing the check on the temp in the first IF to ‘rises above’ to make it a proper trigger rather than a condition (even though webCoRE is treating it as a trigger per the lightning bolt to the left. And you need to change the contact sensor check to ‘was closed for at least x’ to meet your desire to have it happen after the door has been closed for a period of time.

Also, change the contact sensor test in the second IF to ‘was open for at least.’

This really isn’t necessary in the webCoRE world where multiple straight IFs work just fine.


(jkp) #7

Enable Trace and attach your logs.


#8

Agreed. I wonder if the door sensor has quit reporting as well.


(A. Harrow) #9

Thanks for all the suggestion guys, I have since modified the piston to incorporate those.

This is the log after the above code.

4/7/2018, 9:27:27 PM +662ms
+1ms ╔Received event [Sunningdale].test = 1523150847662 with a delay of 0ms
+147ms ║RunTime Analysis CS > 13ms > PS > 39ms > PE > 94ms > CE
+151ms ║Runtime (40454 bytes) successfully initialized in 39ms (v0.3.104.20180323) (148ms)
+152ms ║╔Execution stage started
+168ms ║║Condition #6 evaluated false (7ms)
+170ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+177ms ║║Condition #34 evaluated false (6ms)
+187ms ║║Condition #35 evaluated false (9ms)
+200ms ║║Comparison (enum) closed stays (string) open = false (5ms)
+203ms ║║Cancelling any timed trigger schedules for condition 36
+204ms ║║Cancelling statement #36’s schedules…
+205ms ║║Condition #36 evaluated false (17ms)
+206ms ║║Condition group #31 evaluated false (state did not change) (36ms)
+209ms ║╚Execution stage complete. (57ms)
+211ms ╚Event processed successfully (211ms)

Should I do another trace when the conditions are met (meaning when the piston actually can turn on the AC)?


(Ron Talley) #10

You can only have 1 trigger per “If”…

Triggers are like action verbs…Changes, drops, raises, etc…

Conditions are like states…is, was, changed, etc…

You can have as many conditions as you wish but only 1 trigger.<-----Super Important

Triggers sets things in motion…(makes the Piston evaluate) so if you have multiple triggers in 1 “if” then it would typically give you a false state.

Also, if you introduce a trigger in 1 “if” then you will need a trigger for all other "If"s unless your devices are represented in the triggered “If” statement …<----way too nerdy for the average Joe…But try to grasp.


(A. Harrow) #11

I was with you until the last sentence, but lets see if it have it correct.

Taking into consideration what you said this is my new code:

I still however noticed that my piston state is False.

Piston state: false
Last executed: 4/7/2018, 10:57:50 PM
Next scheduled: never
Subscriptions: 1 event, 1 control
Devices used: 2
Memory used: 44% (44432 bytes)

What am i missing here :persevere:

Update:
AC turns on when high temp is reached, however does not turn off when door is opened for more than 10 secs.

Whist AC was running with door open i did a test and it stopped. Trace test evaluated condition #36 (door open for least 10 secs) to be true and AC stopped.


#12

Remember, if your trigger occurs and a condition is not met, it will not refine once that condition changes… Because it’s not a trigger. If you write everything as a condition, WebCore will make them all triggers as well. I think that might be what you’re actually looking for. For example, if the door sensor is open when the temperature goes above your mark, when the sensor closes, you want the AC to turn on right? If the temp is the only trigger, it will not go on until the temp goes back down and then back above the line again.
I would stick with your first one but choose all conditions… Temp is above, etc.


(Ron Talley) #13

I sometimes use all conditions but most of the time I am using multiple “If” with 1 trigger per “If”…

You have 3 triggers so if I were writing this, I would have 3 “If” sections…

I’ll explain the 3 “Triggers”…Actions that “If” happens, Then “Do” something…Remember you can have 1000 conditions but only 1 trigger per “If” section. If you introduce a trigger in any “If” section then you will need a trigger for all other “If” sections.

Trigger 1
If temp “Rises” above
And
Any and All other conditions to be met
Then
Do

Trigger 2
If temp “Drops” below
And
Any and All other conditions to be met
Then
Do

Trigger 3
If door “Opens”
And
Any and All other conditions to be met
Then
Do
Here I would put a “Wait” period before the turn Off action

I hardly ever recommend “Else” sections to noobs because it gets confusing quickly.

Last thing here:
You can have as many “If” sections as you like. You can even have “If” sections after “Then” sections. However, you “should” specify how each section is evaluated (Execution Method). Synchronous (in sequence from top down) or Asynchronous (will be evaluated at time of trigger).

I would set this up as async for each section. You do this by pressing the gear icon when you click on the “with”, scroll down to Execution Method" and change all 3 sections to Asynchronous.


(A. Harrow) #14

Ok guys, this is for all the marbles. So far the only tests I haven’t done are: 1. when arriving home and temps are high, 2. closing door when temps are high and 3. turning off when leaving home.

Its super clunky but if it works then so be it, with a little more experience I can probably make it a bit more elegant.

Thank you all for all the help and advice.


#15

This is totally overkill. And you don’t need async either. But if it works, then go with it. But in general, you don’t need to have every trigger with the other two conditions. If you enter them all as conditions, WebCore will use them all as triggers and all as conditions.


(A. Harrow) #16

Later today, I am going to give your version a shot. I think that’s what I had at first but then it seems to have fallen apart when I introduced the door sensor, at least that’s what it seems like.

What I did above does seems like a bit much to be honest and it sure seems like there should be a more efficient way of getting it done.

My webcore / smartthings saga will continue.

Thanks Ryan.


(Ron Talley) #17

Looks great!

It totally not overkill and does exactly what you want.

I have plenty of Pistons that may have 8 different “If” scenarios.

Async is necessary if you have wait periods and also allows the each “If” section to work as it’s own Piston.

For instance, if you have:

If door is open
Then
Wait 2 minutes
Do blah

If door is closed
Then
Do blah

If you don’t have async on, then nothing below the 2 minute period will go because the Piston will have to wait 2 minutes befor the next step.

With async, it ignores the wait periods.

YMMV but your Piston looks great and should work as expected.


(Ron Talley) #18

If you look at his Piston, there are few conditions that overlap. He has addressed all of his scenarios with 1 Piston and is exactly how I would approach this.

Although not always necessary, I’ve found it best to choose async if I am using multiple “If” sections that are working independently and especially if they have timers or wait periods in them.

YMMV


#19

You can have more than one trigger if the operand is OR instead of AND.

For example:


(Ron Talley) #20

Correct. Just tried to make it as easy as possible for someone new to understand.

Of course, there are multiple ways and even more efficient ways to address this.