Contact "stays closed" doesn't seem to work


#1

1) Give a description of the problem
I have 2 multi sensors on garage doors (tilt) and one with a magnet on the home to garage access door. I want to turn off the lights of the garage after 15min of all doors been closed

2) What is the expected behavior?
Lights turn off after 15min

3) What is happening/not happening?
Lights aren’t turning on after 15min…

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
11/6/2017, 10:42:31 PM +417ms +0ms ╔Received event [Home].time = 1510026152650 with a delay of -1234ms +370ms ║RunTime Analysis CS > 14ms > PS > 250ms > PE > 106ms > CE +383ms ║Runtime (38469 bytes) successfully initialized in 250ms (v0.2.0fd.20171105) (381ms) +384ms ║╔Execution stage started +397ms ║║Cancelling condition #7's schedules... +398ms ║║Condition #7 evaluated true (2ms) +411ms ║║Comparison (string) garage-closed stays (string) garage-closed = true (3ms) +419ms ║║Adding a timed trigger schedule for condition 8 +423ms ║║Cancelling condition #8's schedules... +424ms ║║Condition #8 evaluated false (25ms) +426ms ║║Condition group #1 evaluated false (state did not change) (31ms) +429ms ║╚Execution stage complete. (45ms) +431ms ║Setting up scheduled job for Mon, Nov 6 2017 @ 10:57:31 PM EST (in 899.99s) +447ms ╚Event processed successfully (448ms) 11/6/2017, 10:27:32 PM +418ms +1ms ╔Received event [Home].time = 1510025253062 with a delay of -645ms +180ms ║RunTime Analysis CS > 29ms > PS > 65ms > PE > 86ms > CE +193ms ║Runtime (38465 bytes) successfully initialized in 65ms (v0.2.0fd.20171105) (191ms) +196ms ║╔Execution stage started +207ms ║║Cancelling condition #6's schedules... +208ms ║║Condition #6 evaluated true (2ms) +223ms ║║Comparison (enum) closed stays (string) closed = true (3ms) +231ms ║║Adding a timed trigger schedule for condition 7 +236ms ║║Cancelling condition #7's schedules... +237ms ║║Condition #7 evaluated false (27ms) +239ms ║║Condition group #1 evaluated false (state did not change) (34ms) +244ms ║╚Execution stage complete. (49ms) +247ms ║Setting up scheduled job for Mon, Nov 6 2017 @ 10:42:32 PM EST (in 899.986s) +265ms ╚Event processed successfully (264ms) 11/6/2017, 10:13:50 PM +832ms +1ms ╔Received event [Porte Maison Garage].contact = closed with a delay of 476ms +298ms ║RunTime Analysis CS > 161ms > PS > 60ms > PE > 77ms > CE +313ms ║Runtime (38476 bytes) successfully initialized in 60ms (v0.2.0fd.20171105) (311ms) +314ms ║╔Execution stage started +330ms ║║Comparison (string) garage-closed stays (string) garage-closed = true (2ms) +332ms ║║Condition #6 evaluated false (13ms) +334ms ║║Condition group #1 evaluated false (state did not change) (14ms) +337ms ║╚Execution stage complete. (23ms) +338ms ║Setting up scheduled job for Mon, Nov 6 2017 @ 10:27:33 PM EST (in 821.893s) +354ms ╚Event processed successfully (353ms)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Try…

All of contact1, contact2, and contact3 stay closed for 15 minutes...


#3

an easier way would be

If all doors are closed AND light is on
then
Wait 15 minutes, turn lights off

That way if you open a door, it cancels the timer and once you close it, the timer restarts


#4

Trying this :

For some reason I though the “wait for 15min then …” wouldn’t be reset… and then I remember a property in Core (not webcore) that it would reset timers if the condition changed… is that what’s happening here?


#5

webcore default is cancel on condition state change, click the WITH and then the cog (wheel) icon to bring up the options.


#6

Exactly what I meant to say - condition state change.

Seems to be working fine now.

I’d like to add a motion sensor to the mix… would it work ok if I had it to the initial “if” ? I would add a “and no motion”. I know the logic works but since I thought my initial logic would work and it did not, I’m wondering if there’s some sort of gotcha to be aware of about state change, subscriptions and timers…


#7

It should work, just add it right after the switch condition, just remember the motion will reset the timer each time it goes active/inactive.


#8

Alright. Resetting the timer is the idea - I want the lights to be turned of if all doors are closed and there wasn’t any motion for a set amount of time.

Are the conditions of the “if” evaluated one after the other and in case of an “AND” it’ll skip the 2nd or 3rd if the 1st one is false? i.e. if I put the switch condition first… will it poll the doors and motion every single time regardless?

Perhaps this could be accomplished by “only when”…

Might not be worth it in here but my background in real time programming is seeping in :smiley: