Quiet Things Down with added door sensors


#1

I thought creating a piston to replicate the “things quiet down” routine from ST adding door sensor would be easy but that’s until I try to actually create the thing and all sorts of questions start popping up.

Lets say I want to create a piston that will turn off certain lights if all motion sensors are inactive and there’s no change of state for the door sensors for an hour… is this a situation where id use groups?

Which trigger should I use? I saw the list of triggers and for my noob eyes there seems to be a couple that look kind of the same.

I read the pinned thread about conditions/triggers and I think I understand but then at the same time I don’t. From what I understand, I cant use two triggers so In my case I’d have to choose one of the two types of sensors as a trigger and the other as a condition? For example, use “an hour without movement” and when that becomes true then check if the motion sensors have been also an hour without changes?

Sorry for the long post but I really want to get more prficient with this system. At first I was kind of dissapointed with Smartthing swhen I got it about two months ago (coming from a Vera) but WebCore is surely turning things around. This should be an official feature of SmartThings IMO.


#2

I do a simple version of this where I use motion sensor age to determine if things are quite or active in the house. This one does not use any physical device triggers. Like this:

every 15 minutes
   set variable noMotion = (((age([Kitchen Motion Sensor : motion]) + age([Dining Motion Sensor : motion]) + age([Living Motion Sensor : motion]) + age([Hanging Motion Sensor : motion])) / 60000) / 4)
   set variable howBusy = (noMotion > 90 ? 0 : (noMotion > 60 ? 1 : (noMotion > 30 ? 2 : 3)))
end every

So 3 is real busy … 0 is quite. Then I take different actions based on value of howBusy.

BTW, for me this is downstairs only.