Changing an OR to an AND


#1

Hello,

I’m trying to switch the wording for the last IF “or Presence Sensor 2’s…” to an AND instead of the OR. In other words, I’d like it to be IF “Keypad 2’s…” OR “Keypad 2’s” AND “Presence Sensor 2’s…”

How would I change the last OR to an AND?

The other question I have is how to throttle the notifications? In other words, what this piston is supposed to do is look at an alarm status and my presence and then notify me via SMS. What I’m finding is that it continues to notify via SMS because the alarm status is updating every few seconds, which initiates another text. I just need to be notified once, but I don’t want the piston restricted so that if it happens again in an hour, it doesn’t notify me.

Appreciate the help!


#2

For the first question…

Move that first keypad 2 into the group that has the second keypad2 in it and use OR, then simply change the OR to an AND That is between the group of keypads and the presence sensor.

IF
(
Keypad 2 blah blah
Or
Keypad 2 blah blah
)
AND
Presence sensor blah blah
Then


#3

Thanks, I was able to drag on the left side and get it to reconfigure - took a bit of messing with.

The only issue I’m having now is that multiple notifications…The only way I stop it is by pausing the piston.


#4

“is” and “is not” are vague conditions… meaning they may be true for long periods of time.

I try to kick off a piston with precise triggers, which are only true for a brief moment


#5

I would agree with that, however, there are updates feeding from this system into webcore quite often, which seems to mean it re-triggers the piston. Do you think the precise triggers will stop this?


#6

It depends on your setup.
Normally the trigger “changes to X” is helpful, because it only fires at that precise moment.

Even if there are multiple events, that trigger only fires if it CHANGES to X. Any further triggers has to change away, and then back to fire a second time.


Alternatively, you can use variables or time restrictions to keep the SMS alerts to a minimum.

IE:

IF $hour24 is different that {prevHour24}
    Then Send SMS
END IF

This restricts the SMS to (at most) once per hour


#7

Ok, well let me check out if that more finite programming works and I will go from there. I know why it keeps triggering the SMS, because the conditions continue to be met over and over again…so it keeps doing it,


#8

I’ve looked at changing my piston to a trigger, rather than a condition, but I don’t see a way to incorporate the trigger. What I am seeking is a piston to monitor my alarm and if I am away and it’s not armed, I get alerted.

What I was trying to do is once the SMS is sent, the piston pauses itself and then restarts, which hopefully would put a stop to the SMS if the conditions are no longer met. I didn’t have luck with that so far.


#9

I think a basic structure could be something like this:

IF Alarm changes away from armed  <-- Trigger
Then
    IF Presence is not present    <-- Condition
    Then
        Send SMS alert
    END IF
END IF

(notice the second IF is indented)

This one will ONLY send you one SMS at the moment that the alarm changes away from armed… and only if you are not home at that time.


#10

I don’t think this will work for what I am trying to achieve because the wording has to be exact. It wouldn’t be changing away from armed because it wouldn’t be armed prior to my presence being away.

Example: Alarm is disarmed and remains that way as I leave. The way I am seeing it, I have to tell Webcore to look for that unarmed status (in my piston above, this is achieve by triggering when it is not armed).

Is there a way to have the piston stop itself (or pause itself) after the SMS and then restart? This would stop the SMS’s unless the conditions were met again.

Another interesting thing to point out as I’ve been testing this is once all the conditioners are met, the SMS’s continue, even when a subsequent condition is no longer met (which doesn’t make sense to me, but I am sure it is my programming).


#11

The code:
IF Alarm changes away from armed
will not trigger as you leave. Once you leave, I assume you have other programming in place to arm the alarm… at that point, the next time it changes away from armed, then the SMS would be sent.
(you don’t need a SMS as you pull out of the driveway)

Remember, with this structure, the ONLY time the piston is executed is the moment that the alarm changes away from armed.


#12

I manually do it, no automation is involved (for a bunch of reasons). I actually do want an SMS once my presence is away…My piston achieves this without any issues, except redundant SMS’s :slight_smile: Of course, I don’t want to restrict SMS’s, as this will make the original function of the piston limited in function. I also wouldn’t want notification when it is away from armed, because that would mean I’d only get an SMS when I disarmed it, which I wouldn’t need.


#13

I would pause your current piston(s), and try the easy piston shown here.

I think you will be happy with the results.

Putting log to Full will help you see the behind the scenes actions


#14

This portion should be in a separate piston:

IF presence changes to away  <-- Trigger
Then
    IF Alarm is armed        <-- Condition
    Then
        Send SMS "House is successfully armed"
    Else
        Send SMS "House is NOT armed"
    END IF
END IF

Just remember that ALL presence sensors will fluctuate… Meaning your GPS may temporarily jump while you are asleep, and send one SMS when it returns back home. You could (of course) add extra conditions to dictate what happens when you are asleep.


#15

This should never happen, because if you disarm the house, then (hopefully) your presence is home… Thereby NOT sending a SMS

The portion that we’ve not talked about yet is:
If your partner disarmed it when you were at work. This WOULD send you a SMS…


#16

That is true about the presence…I am trying to think about how to fashion your ideas…this piston is looking for exact text that is being fed from the alarm…if it’s not exact, I won’t get the results I am looking for. I wouldn’t need an SMS when it’s armed, but I see how you are incorporating the else to achieve the notification…


#17

Sorry if I choose the wrong word. Every alarm system is different. Use whatever word that represents “armed” for your house.


#18

That’s fine, but it’s actually a little more complex than that, as this piston is looking for more than one type of armed status…I’m not using SHM because I am getting incorrect readings on it, hence using a workaround using a different component of the alarm that Webcore can see.


#19

Right. You only want a SMS when the alarm changes AWAY FROM armed


#20

Lol…maybe it’s late… I think it’s hard for me to explain my particular need here, but it’s not going to switch away from armed as I drive away…