My modes aren't triggering for Night mode or Someone Asleep mode


#1

1) Give a description of the problem
My night mode is not triggered based on a virtual switch i have setup. For some reason webcore is declaring a flase even though the virtual switch has changed state to ON

2) What is the expected behavior?
When a virtual switch turns on indicating that either me or my girlfriend are asleep AND one of us is not in the house AND the location mode is currently not set to Away or Vacation mode THEN the night mode is suppose to trigger. In a usual scenario we each have our own button that says when we are going to bed. If one of us clicks that bottom before the other it means that one of us is going to be first maybe becuase i am watching TV downstairs what happens then is usually the mode switches to Someone Asleep mode and turns off the bedroom lights and sets the thermostat in that zone to a certain cooler temp while downstairs where i am usually at it is still normal temp. Now this whole sub flow is suppose to be for the purpose that if I am traveling or if i am not at home and she does the same thing which is turning on her virtual Asleep switch it should then skip the Someone Asleep Mode and go straight to Night mode where it will turn everything off AND turn on the alarm since she is alone at home.

3) What is happening/not happening?
What is not happening is that the piston is not detecting the virtual switch is turning on. I think i will have to separate the two statements into two different statements such as “Miguel’s Asleep switch changes to ON” OR “Amanda’s Asleep switch changes to ON” that seems to be the only one that works but not when they are together

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
8/15/2018, 9:14:30 PM +977ms
+2ms ╔Received event [Amanda Asleep].switch = on with a delay of 566ms
+164ms ║RunTime Analysis CS > 18ms > PS > 53ms > PE > 93ms > CE
+167ms ║Runtime (43099 bytes) successfully initialized in 53ms (v0.3.107.20180806) (165ms)
+168ms ║╔Execution stage started
+177ms ║║Comparison (string) :b4ba316d4538932c3c6310b325c706fa: is_not_any_of (string) :1923c8c08aa61e0f078115829072ecdb:,:fa43ce3d907291aaba5b16f5e04d00ea: = true (2ms)
+179ms ║║Condition #13 evaluated true (5ms)
+183ms ║║Comparison (string) null executes (string) :425cbfce23c780743c01ab5a5ee6e3c0: = false (2ms)
+184ms ║║Condition #15 evaluated false (4ms)
+194ms ║║Calculating (boolean) true && (boolean) false >> (boolean) false
+197ms ║║Comparison (boolean) false is (boolean) true = false (1ms)
+199ms ║║Condition #17 evaluated false (14ms)
+200ms ║║Condition group #20 evaluated false (state did not change) (14ms)
+212ms ║║Comparison (enum) present is (string) not present = false (2ms)
+214ms ║║Comparison (enum) not present is (string) not present = true (1ms)
+215ms ║║Condition #23 evaluated true (14ms)
+222ms ║║Comparison (enum) on changes_to (string) on = false (1ms)
+223ms ║║Condition #24 evaluated false (7ms)
+224ms ║║Condition group #22 evaluated false (state did not change) (24ms)
+225ms ║║Condition group #14 evaluated false (state did not change) (45ms)
+226ms ║║Condition group #1 evaluated false (state did not change) (53ms)
+228ms ║╚Execution stage complete. (60ms)
+229ms ╚Event processed successfully (229ms)


#2

Your log shows it did exactly what was in the code.

If Location mode is not away             CHECK
Did Routine executes Good Night?         NO
Are both sleep switches true?            NO
Is either Presence sensor not present?   CHECK
Did either Switch 1 or 4 changes to on?  NO

So with your current piston, one of the following triggers/conditions has to be different to get results:

* Routine executes Good Night

  -or-

* Both sleep switches must be true
  -AND-
* Either Switch 1 or 4 changes to on

  -or-

* Either Switch 1 or 4 changes to on (and someone is not home)

It looks like it would be worth checking into why none of these were executed.
(in other words, the flaw may be in a different piston)


Of course, you could also solve this by training your girlfriend to execute the Good Night! routine when she is going to bed.


#3

Hi @WCmore that is the thing i clearly turned on something so i don’t know why it didn’t end up working properly…

I checked the other logs and nothing. I didn’t find anything interfering with this piston.

I actually got this working by separating that “Either Switch 1 or 4 changes to on” into two statements OR’ed

“Switch 1 changes to ON”
OR
“Switch 4 changes to ON”

This worked. Sometimes it doesn’t work but usually when you turn the switch off and back on then it triggers the flow.


#4

This happens sometimes with virtual switches. Usually, it happens because the virtual switch (simulated switch) was left in the wrong position. So, for example, if the SimSwitch was on (for some reason) and you try to turn the switch on, then webCoRE will not see “Switch 1 changes to on”. (because it is already on) Toggling it off, and then on will get it back on track, and the logic should flow.

There are many ways to solve this. The methods I usually employ is to:

  • Make sure all my pistons are resetting SimSwitches at the right time
    (ie: when I wake up, turn off the Sleeping SimSwitch)
  • Program a daily piston that resets SimSwitches to the correct level
    (ie: everyday at noon, turn on Awake SimSwitch, and everyday at 5am, turn off Awake switch. This method is not meant to be “official” (my Awake switch is properly tied into my good morning & good night routine)… but it works great as a safety net, and will fix any hiccups it encounters along the way.)