Arming security system only working when test is run


#1

1) Give a description of the problem
I have made a simple piston just to test what I want to do and it is to change to Night mode and arm home if the virtual switch is not pressed at 11:00pm and then to day mode and disarm at 5:30am. However this is not working but when I click the test piston then it changes over and does everything it should.

2) What is the expected behavior?
Arm at 11:30 if no switch is pressed and disarm at 5:30 if no switch is pressed

3) What is happening/not happening?
Only doing as expected when pressed Test piston

**4)

**5) Attach any logs

|+1ms|╔Received event [Home].test = 1535845657877 with a delay of 42ms|
|---|---|
|+138ms|║RunTime Analysis CS > 52ms > PS > 27ms > PE > 63ms > CE|
|+202ms|║Runtime (52143 bytes) successfully initialized in 27ms (v0.3.107.20180806) (196ms)|
|+203ms|║╔Execution stage started|
|+226ms|║║Condition #2 evaluated false (13ms)|
|+229ms|║║Condition group #1 evaluated false (state did not change) (16ms)|
|+244ms|║║Comparison (time) 28058148 is_between (time) 82800000 .. (time) 19800000 = false (9ms)|
|+246ms|║║Cancelling condition #15's schedules...|
|+247ms|║║Condition #15 evaluated false (18ms)|
|+248ms|║║Cancelling condition #14's schedules...|
|+249ms|║║Condition group #14 evaluated false (state changed) (20ms)|
|+253ms|║║Condition #9 evaluated false (3ms)|
|+254ms|║║Condition group #8 evaluated false (state did not change) (3ms)|
|+269ms|║║Comparison (time) 28058173 is_not_between (time) 82800000 .. (time) 19800000 = true (12ms)|
|+270ms|║║Time restriction check passed|
|+272ms|║║Cancelling condition #21's schedules...|
|+273ms|║║Condition #21 evaluated true (18ms)|
|+286ms|║║Comparison (string) :80ff8adc87cc6d0d790b1bb31708f282: is_not (string) :db51cd17b1529242205547665623a183: = true (3ms)|
|+288ms|║║Condition #22 evaluated true (14ms)|
|+290ms|║║Cancelling condition #20's schedules...|
|+291ms|║║Condition group #20 evaluated true (state changed) (36ms)|
|+292ms|║║Cancelling statement #23's schedules...|
|+302ms|║║Executed virtual command setAlarmSystemStatus (4ms)|
|+323ms|║║Executed virtual command setLocationMode (19ms)|
|+351ms|║║Calculating (string) The Alarm was disarmed on: + (string) Sun, Sep 2 2018 @ 7:47:37 AM AWST >> (string) The Alarm was disarmed on: Sun, Sep 2 2018 @ 7:47:37 AM AWST|
|+354ms|║║Calculating (string) The Alarm was disarmed on: Sun, Sep 2 2018 @ 7:47:37 AM AWST + (string) >> (string) The Alarm was disarmed on: Sun, Sep 2 2018 @ 7:47:37 AM AWST|
|+359ms|║║Executed virtual command setState (0ms)|
|+370ms|║╚Execution stage complete. (166ms)|
|+400ms|╚Event processed successfully (399ms)|

#2

Because you’re not using time to trigger the piston to run.

To solve this, just put a couple “when time happens daily” triggers in there.

Create an IF statement, select ‘virtual device’ (or something like that) from the blue drop-down box for choosing devices. Choose ‘time’. Then choose ‘happens daily’ from the next drop-down to make it a trigger.

If you run into problems, let me know and I’ll post something up more specific. Just didn’t have time to do screenshots and what not now.


#3

…and since there is more than one way to skin a cat…

I would be tempted to break up all 4 scenarios into 4 statements (inside the same piston):

Every day at 11:30PM
  Set Night mode blah blah blah
End every

Every day at 5:30AM
  Set Day mode blah blah blah
End every

If Switch 11 changes to on
  Set Night mode blah blah blah
End If

If Switch 11 changes to off
  Set Day mode blah blah blah
End If

This gives you total control, yet you have the safety net in case you forget to set it manually…


#4

Thanks for the help guys! I’m heading home now so will give this a crack and see how I go.


#5

Sweet got it working!!
Used little bit of suggestions from both of you, so thanks again for taking the time to help me!