Design a Piston to notify when everyone is upstairs?


#1

I need a piston to show when everyone is upstairs and no one is left downstairs?

Something like If sensor upstairs is active THEN sensors downstairs is not active for 15 min then action

Any help would be appreciated.


#2

heres a snippet of what it should look like:

define
   device upMotion = upstairs motion sensor 1 and upstairs motion sensor 2
   device downMotion = downstairs motion sensor 1 and downstairs motion sensor 2
end define

execute
   if ALL of downMotion did not change in the last 15 minutes
      and
      ANY of upMotion changed in the last 5 minutes
         with device
            do something
         end with
   end if
end execute

#3

Or you could do something like this. It’s very similar.
This is my nighttime arming piston. You could just modify it slightly to get it to send you the notification you require and do the actions you want too.


#4

Curious why you force subscribed to all of the conditions? What would happen if you just subscribed to time?


#5

I have a habit of always either force subscribing or selecting never subscribe. That way if I ever change a piston or add something new I don’t get a surprise if it stops working correctly because of mixing triggers and conditions and then auto subscriptions would only select the triggers.
Also it means you can still distinguish what is/is not subscribed to in editing mode. (Helpful on very complicated pistons)


#6

Me to.
Overkill but it makes me fell better!!! :smile:


#7

I see. Good to know.


#8

I have automations that turn off the downstairs lights and the tv and everything else.

If there’s no hollering, I know everyone is upstairs.

:slight_smile:


#9

and i do the exact opposite. in my more recent pistons as i clean them up, all conditions are never subscribe. i use on event to get the events that i care about. minimizes how often the piston gets triggered and keeps all my event subscriptions at the top of the piston only.


#10

Thanks Everyone for the help on a different subject can anyone explain On Events? Sorry if asking in the wrong place I have tried search but not a lot came up


#11

On events subscribe to specific attributes from a device. So let’s say you have a device that reports. Temp,humidity,motion & battery. You can subscribe to events only from that devices temp if you prefer. That way only temp change events will trigger the piston to fire.

Please correct me if I’m wrong anyone?

Here is an example.

This piston is a light Switch in my livingroom, it only performs actions based of the scene number from single,double or triple click changes.


#12

Thanks again just trying to design pistons as defiantly as possible


#13

So then instead of
"IF the front door contact is closed"

You’d have
"ON event from Front door contact,
If the contact has changed to closed"

Is that correct?


#14

yes. the pistons that benefit are usually ones that use multiple sensors and other conditions to do something but not all of them need to trigger the if check.


#15

In my pistons so far, Most need multiple sensors to trigger the if check. Only if multiple sensors change in a similar timeframe do the pistons execute.

The only ones that don’t fit that description are the ones triggered by external http.


#16

the same for me. as the pistons get more complex they do tend to become that way.

for me at least, not all of the multiple sensors are a trigger. as a simple example of this, i dont want to turn off the lights in a room when there has been motion in the last 15 minutes during certain times of the day. In this case i dont need motion to be a trigger, only the switch events should trigger the piston to run. setting that up as an on event with the switch events, i find it easier to construct the piston from there and stick to using triggers with only the named on events and conditions for everything else.