Presence Sensor and modes


#1

1) Give a description of the problem
I have a simple piston which I intend on executing when I arrive home after dark. I have a piston which set the house state to be “Away at night” if I’m away from home after sunset. What I want to happen, is when one of the presence sensors switches to present, if the house is in a night mode (either “night”, or “away at night”) then the house state should switch to “night” (which is the trigger for my lights). Whats happening instead, is the house state doesn’t change because when the piston fires the presence sensor seems to evaluate as not present.

2) What is the expected behavior?
I figure that if the piston is triggered and its subscribed to events from either present sensor, it should be impossible for it to be triggered and not evaluate true for condition 7

3) What is happening/not happening?
The condition is evaluating to false, making me think I’m missing a key bit of information here!

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
This is from the webcore logs. Bolded line is the bit I don’t get. I figure the bit at 151ms is the house state check
|+2ms|╔Received event [PRESENCE SENSOR2].presence = present with a delay of 73ms|
|—|---|
|+139ms|║RunTime Analysis CS > 18ms > PS > 53ms > PE > 68ms > CE|
|+142ms|║Runtime (38643 bytes) successfully initialized in 53ms (v0.2.102.20180116) (139ms)|
|+142ms|║╔Execution stage started|
|+151ms|║║Comparison (string) :09702fd4fb506a6c2cf8f8acc2662121: is_any_of (string) :97bf9e8ea752bbd2ed50f4b645cb43ae:,:09702fd4fb506a6c2cf8f8acc2662121: = true (2ms)|
|+152ms|║║Cancelling condition #8’s schedules…|
|+153ms|║║Condition #8 evaluated true (6ms)|
|+154ms|║║Cancelling condition #1’s schedules…|
|+155ms|║║Condition group #1 evaluated true (state changed) (8ms)|
|+164ms|║║Comparison (enum) present changes_to (string) present = false (1ms)|
|+165ms|║║Condition #7 evaluated false (8ms)|
|+166ms|║║Condition group #2 evaluated false (state did not change) (9ms)|
|+169ms|║╚Execution stage complete. (27ms)|
|+170ms|╚Event processed successfully (170ms)|


#2

Hmm… Odd. I can’t exactly explain why you’re getting those results, but I can give you some suggestions.

Try it this way and see if that works any better. Put the Trigger first…instead nested the other way around.

Also, you’re not doing anything in this piston which should require setting Never Cancel anywhere, so I wouldn’t put that in there. Those deviations from the defaults are only needed when you’ve got some special requirements. So I try to avoid using them unless absolutely necessary.


#3

Good advice Mike, much appreciated. I’ll give that a shot and retest tomorrow. I think I had never cancel set when I thought perhaps the state was getting changed and maybe screwing with it, but that doesn’t seem to be the case.


#4

@Andy

You have chosen a username that already exists on the ST forum.

We made a collective decision early on that ST names would be reserved for those users, wether they choose to join the WC forum or not, hence our verification process.

I see that during WC registration you selected that you are not a ST forum user so I can safely assume that you are not the original @Andy

Please can you pick a new username that isn’t already taken on the ST forum, or create a ST forum profile and let me know what that name is.

I can then change your name on here to avoid the current conflict (and remove that orange banner from your header).

Once done I’ll also remove this post to keep your thread on point.

Thanks