Jump to content

How to trigger program for temperature breaches?


Recommended Posts

Posted

This may be an FAQ, if so I apologize.  I want a program that watches a node server value (temperature) and sends an alert if it goes too high.  So I created a condition:

If  'SensorPushNodeServer / Media Closet' Temperature >= 87°F

This triggers every time the temperature changes over 87, like 87.1 and 87.2...

I guess I can set a variable to 1 each time the status changes and have a second program watch that.  But is there a more elegant way?

Thanks.

-Alan

Posted (edited)

I guess also I can use one program with the "if status temperature" condition, and a second program watching the program state and mailing.  It's too bad I can't use the node reference node.#.name though.

EDIT: I guess I can't do this... seems like if the temperature changes the program state changes, and I get an alert.  Assumed the "then" state would filter out each little change... bad assumption I guess.

Edited by webminster
Posted

2 programs

1st program:

If   'SensorPushNodeServer / Media Closet' Temperature >= 87°F

then
  (blank)
else
   (blank)

------------------------

2nd program

If 1st program is true

then
    notify
else
   (blank)

  • Like 2
Posted (edited)

Mr. Bill addressed this as I would have.  No need for a Boolean state variable ever because it just mirrors the state of the program and functions identically as a trigger for any program that references it.  In your second post it looks like you stated you "couldn't do that".  But you are mistaken.

My guess is you need to put some hysteresis in there.  Trouble likely is that temp is bouncing around.  79.9, 87.0, 79.9 etc.  Each time it does that it will get you a new notification. 

Program 1
If
  temp is >=87
Then
  disable program 1
Else
  blank

Program 2
If
  temp is < 79.5
Then
  enable program 1

Program 3
If
  program 1 is true
Then
  do what you want
       
  

Probably should do a "run at startup" on 1 and 2 as well.

EDIT:  After looking at this a second, I realized you don't need program 3.  You can put your notification into program 1 then clause prior to the disable line.

Edited by apostolakisl
  • Like 2
Posted
  On 6/3/2022 at 1:50 PM, apostolakisl said:

Mr. Bill addressed this as I would have.  No need for a Boolean state variable ever because it just mirrors the state of the program and functions identically as a trigger for any program that references it.  In your second post it looks like you stated you "couldn't do that".  But you are mistaken.

My guess is you need to put some hysteresis in there.  Trouble likely is that temp is bouncing around.  79.9, 87.0, 79.9 etc.  Each time it does that it will get you a new notification.

 

Expand  

No, it wasn't hysteresis.  It wasn't bobbling back and forth over the limit.  It was monotonically increasing (87.0, 87.1, 87.2).

Posted
  On 6/3/2022 at 1:27 PM, MrBill said:

2 programs

1st program:

If   'SensorPushNodeServer / Media Closet' Temperature >= 87°F

then
  (blank)
else
   (blank)

------------------------

2nd program

If 1st program is true

then
    notify
else
   (blank)

Expand  

That's what I did for post 2, and I just redid it and tested.  I am getting a trigger and send from that program 2 every time the temperature changes (and still is greater than the limit).  E.g., 87.0, 87.1, 87.2... For comparison:

test temp high - [ID 0082][Parent 0001]
If
        'SensorPushNodeServer / Media Closet' Temperature >= 87.0°F
Then
   - No Actions - (To add one, press 'Action')
Else
   - No Actions - (To add one, press 'Action')
 
mediaclosetTempAlert - [ID 0084][Parent 0001]
If
        Program 'test temp high' is True
Then
        Send Notification to 'Default' content [Entry 12]
Else
   - No Actions - (To add one, press 'Action')

In contrast, the version where I set a state variable and watch that does work.  I don't know if this is an IoP issue or what...

-Alan

Posted
  On 6/3/2022 at 7:03 PM, webminster said:

No, it wasn't hysteresis.  It wasn't bobbling back and forth over the limit.  It was monotonically increasing (87.0, 87.1, 87.2).

Expand  

Even if it wasn't hysteresis @apostolakisl program examples should solve your problem.  Once the notification is sent the sensing program is disabled until the temp falls.  You can arrow that gap hysteresis if you want, just follow the example so that program 1 gets disabled.

  • Like 1
Posted (edited)
  On 6/3/2022 at 7:03 PM, webminster said:

No, it wasn't hysteresis.  It wasn't bobbling back and forth over the limit.  It was monotonically increasing (87.0, 87.1, 87.2).

Expand  

 

  On 6/3/2022 at 7:08 PM, webminster said:

That's what I did for post 2, and I just redid it and tested.  I am getting a trigger and send from that program 2 every time the temperature changes (and still is greater than the limit).  E.g., 87.0, 87.1, 87.2... For comparison:

test temp high - [ID 0082][Parent 0001]
If
        'SensorPushNodeServer / Media Closet' Temperature >= 87.0°F
Then
   - No Actions - (To add one, press 'Action')
Else
   - No Actions - (To add one, press 'Action')
 
mediaclosetTempAlert - [ID 0084][Parent 0001]
If
        Program 'test temp high' is True
Then
        Send Notification to 'Default' content [Entry 12]
Else
   - No Actions - (To add one, press 'Action')

In contrast, the version where I set a state variable and watch that does work.  I don't know if this is an IoP issue or what...

-Alan

Expand  

Yes, I just tested this and you are correct.  Something has changed, a program used to only be a trigger upon changing status, now it is a trigger every time it runs regardless of if it changes.  I just recently switched over to IoP and will need to look over my programs.  I have had a few things happen that I wasn't sure why they happened and this might be a reason.

But also, what Mr. Bill said.  That fixes the problem and also solves hysteresis issues which very well may happen.

Edited by apostolakisl
Posted
  On 6/3/2022 at 7:21 PM, apostolakisl said:

 

Yes, I just tested this and you are correct.  Something has changed, a program used to only be a trigger upon changing status, now it is a trigger every time it runs regardless of if it changes.  I just recently switched over to IoP and will need to look over my programs.  I have had a few things happen that I wasn't sure why they happened and this might be a reason.

But also, what Mr. Bill said.  That fixes the problem and also solves hysteresis issues which very well may happen.

Expand  

@Michel KohanimThis needs to be reported as a bug. The same thing happened during one of the version upgrades where the variables would trigger programs when the same value was written to them. (from REST commands anyway IIRC)  It was corrected immediately after reporting. 

ISY processing logic is based on triggers of changes only for most logic.

Posted
  On 6/7/2022 at 1:33 AM, apostolakisl said:
I may be wrong on this.  I swear it used to be that true/false status of a program would only trigger another program when it changes status.  But I just checked in a very old 3.3.10 ISY firmware and it triggers every time regardless of whether the status changed or stayed the same. @larryllix
That may be, but I believe it would violate the rest of the style of operation of ISY trigger logic.

IMHO Consistency of trigger logic would be most important. It can get complex enough for users already.

Perhaps the status vs switched logic could be applied giving users a choice. I try to avoid using the status of other programs. I find it obscure and a gotcha down the road. default_smile.png

Sent from my SM-G781W using Tapatalk


Guest
This topic is now closed to further replies.

×
×
  • Create New...