SHM - Arm/Disarm based on presence and set times

shm
camera

#1

Special thanks to @michicago for the help with this one.

Piston goals:
-Set SHM to armed/away and turn on Arlo cams when everyone leaves
-Set SHM to disarmed/home and turn off Arlo cams when one or more persons arrive
-Set SHM to armed/home everynight at 2330 hours and turn on Arlo cams (if one or more persons are home) and disarmed every morning at 0700 (if one or more persons are home)
-Temporarily disable SHM (and Arlo cams) if it’s between 2330-0700 and someone arrives home, then automatically re-enable after a set amount of time (10 minutes in this piston)

Designed with two pistons:

  1. Occupancy piston
  2. SHM piston

Occupancy Piston:

SHM Piston:


SHM Replacement examples
My Crazy SHM View
Change Mode to Night and Set SHM to Arm (Stay) when things quiet down
Help with Presence Piston
SHM - Auto In/Out using PSensors not triggering final If statement
#2

In piston 2v5mr, are you making use of the piston tiles? If not, you can delete that line from your personal piston. This is how it looks if you use them:


#3

yep, I do have them in my WC Dashboard, kinda like em’.

image


#4

Hi Michicago - Would you post your piston and h/w config for the Outdoor Light Gauges from your example? I would like to do something like that. Thanks.


#5

Of course! You can use this for any set/grouping of lights you want, up to 16 devices.

This piston is pretty self-sufficient now. All you need to do is fill in the first two variables, then save it. Clicking the “test” button when viewing your piston will force it to run and draw all the gauges. After that, they’ll automatically update on events from anything in the DeviceList variable.

This piston will also toggle the light on or off if you click on one of the gauges.

If you have any questions on it, let me know!


#6

Can you add your goodnight piston


#7

it’s real simple, just turns some lights off and sets others to 20%…


#8

@allrak

If I were to import your occupancy piston, would I need to create any additional global variables?


#9

The only global var you need is @Occupancy


#10

Thanks for this. I couldn’t figure out why the tiles would not create. Then I realized the presence sensors needed a status change before they would work as they should.


#11

I’m having trouble with the occupancy piston. I’m trying to make it use our phones instead of the one’s that you have in the example. I’m having trouble getting things to work… Can you tell me where to plug in iPhone 1 and iPhone 2? Here’s the deal:


#12

It’s exactly where you have the red highlighting. So it should look like:
([Justin’s iPhone : presence]

That “-wc” is something I use to differentiate that I’m using the webcore presence sensor, so the “-wc” will have no place in your script.
Same thing applies to ([Rachel’s iPhone : presence]


#13

I really appreciate the response. I’ve made the adjustments you described but now I receive the following error in my log:
Error executing virtual command [].setVariable: (2ms) groovy.lang.MissingPropertyException: No such property: result for class: script_app_cc092d6b70234e8c9e377a62bdaf04677830d4380e0db255ca7dca6d8c906145 Possible solutions: request


#14

Can you post a green snapshot/picture of the current piston?


#15


That is what I have as the occupancy part


#16

Did you define the @Occupancy global variable? In my piston, it’s defined on the top right of the screen. Here’s a screen capture:

I noticed a couple posts up in your screen shot that @Occupancy isn’t defined.


#17

Thank you so much for your help!! That was my problem, it now works correctly.

One more question. What would you suggest for a scenario where both of us with the iphone presence sensor are gone, but other people (grandparents watching my children) are in my house? I’m hoping to avoid the alarm going off while they are in my house.

My thought was to add a condition that if a certain front door lock code is used, the piston stops… But I’m thinking that will cause other problems now.


#18

Take a look at my SHM piston listed at the top. Look in the third “IF” block and you’ll see a reference to “Switch 8”. Switch8 is actually a virtual switch called “party mode” where if ON, then the piston won’t run.
My point is you could do the same thing. Maybe create an “override shm” virtual switch. When “ON”, it will prevent the SHM from arming, even when @Occupancy = 0.
hope that makes sense.

I see where you’re going with the door lock code, and I’m sure that could be possible as well.


#19

In the alarm piston, the last line of code says:
do x2 Set piston state to “Last event occurred on {$now}”;

My question is, what does that actually accomplish?


#20

It simply sets the display text on the main webcore dashboard page to something meaningful. As shown in the picture below: