SHM and a temporary disarm during certain hours


#1

1) Give a description of the problem
I’m trying to re-do my SmartHome Monitor piston. I’m triggering alarms if I come home after 11:30pm.

2) What is the expected behavior?
I’m trying to build the following logic:
If it’s 11:30pm and the wife and I are both home, set SHM to armed/home
If it’s AFTER 11:30pm and we arrive home, then it should disarm for a time and change back to armed/home.

I guess I’m trying to figure out if the logic in this piston will work correctly. Specifically I’m getting confused on how the length of time will evaluate between “presence sensor changes” and “presence sensors are present”

Maybe there’s a better way to do it?

4) Post a Green Snapshot of the pistonimage


#2

You might find my post in this thread useful… I had the same predicament with lights, should be easy to make it work for you too:


#3

Thanks, checking out the thread now…


#4

@michicago, I think your piston is a little too complex for me, or I’m just making it more complex than it really is, or I had too much wine with dinner last night… Two things I’ll ask you:

  1. If I want to show the value of @Occupancy in ‘piston state’, how would you do that? (edit, figured that part out)
  2. Can you provide an example of how you use @Occupancy in other pistons?

I see the value in the way you’re doing it, I’m just trying to wrap my head around it as I typically don’t write expressions (although I really should start)

Thanks!


#5

Delete the piston tile statement, it’s additional functionality. You can delete the sensors variable at the top too… From an old revision! :slight_smile:

In other pistons, I use triggers like

“if @occupance rises from 0” to take action on one or both of us arriving at an empty house
Else
If @occupancy rises, do these things (like use minimal lighting since someone was already home so I don’t need to blind them.

If @occupancy = 0, or changes to 0, then run pistons for empty house.


#6

Thanks for the quick reply… I have your piston working, including the tile. I tested it by forcing my presence sensor away and it returns the proper integer value.

I’m going to try and rewrite my SHM piston using the @Occupancy value and see if I can solve this.


#7

Great, let me know how it goes!


#8

Here’s what I came up with, I think it should work. Most importantly is the 3rd “if” statement for times between 11:31pm & 06:59am. The whole point is to disarm when coming home after 11:31pm, and then re-arm itself.


#9

One quick question before I propose any changes… how many presence sensors are you monitoring? Is it only going to be zero or 1? Or could someone else be home and your arrival would change it from 1 to 2?


#10

Yes, still need to avoid alarms no matter if someone is home or not.


#11

I’ll take a crack at some edits and comments to see what you think.


#12

Thanks, I’ve tested the first 2 “if” statements by forcing presence mode to away/home, and they both work as expected… The real test will be the last “if” statement.
I’m certainly open to any comments and improvements, appreciate the help!


#13

Good! I was concerned about the second one until I re-read it (that’s why I edited my post). At first I thought it might only evaluate TRUE if @occupancy rises from 0 to 1 (above zero)… but not from 1 to 2. I still may have to come up with a way to test it to be sure… that could fall either way.

I’ll post something up in a few minutes… glad to help!


#14

Good point, I changed it to:
@Occupancy “rises to or above” 1


#15

I’ve included comments to explain the thought process behind any proposed changes. Basically, this gets it down to two main IF statements… you can delete the last two, I just left them as placeholders for comments.

Questions or comments, let me know! Or if this doesn’t make sense or looks like it might screw something up, let me know and I’ll take another look at it. :slight_smile:

Making some additional quick edits… posting an update soon!


#16

Ok, I think this one buttons it up pretty well:

As per before, just delete the last 2 IF statements to clean it up. They’re only there to hold comments on how/why they were edited.


#17

Looks good… I’m still trying to wrap my head around a couple things you did… I’ve probably been staring at this too long.

One thing I want to make sure of, is that when anyone is home, the Lights 100% piston fires at 0700, and when anyone is home, the Goodnight piston fires at 2330.


#18

I’ll look through and be certain it does that. Let me know what parts are throwing you off and I’ll try to explain those too.


#19

The first “IF” statement…

Occupancy changes to zero, then arm everything and set as “away” (that makes sense).
Else if
Occupancy changes away from 0 (meaning someone is there), why turn the cameras back on and have the system armed?

Or is that block only going to happen between 11:31pm - 6:59am since we have the other timeframe covered in the second “IF” ?


#20

Ah, good point. I took those actions from this ELSE statement that would be executed whenever your first IF statement in the block was false. I’ll rethink it and correct it: