Jump to content

How is this value derived?


Teken

Recommended Posts

Posted (edited)

I have a Autelis Bridge that can communicate with the ISY. It is currently sending 1 wire temperature sensor readings into a State Variable. I crafted a very simple and basic program to see how it would operate in practice.

 

This is a test!

 

I do realize that the state variable will send me alerts each time there is a change of state. I will change how this behaves later on but wanted to know what this value that is being pushed to me?

 

The value is stated as 2.11?

 

To test the workings of the system I lowered the value to 180, as the current state at the time was like 183, 184. Even my broken math knows the difference is still not 2.11?

 

I later dropped the trip level to another two points (178) and the system sent in the same alert value of 2.11?? There must be something obvious I am missing here so any insight as to how this value is generated and derived would be greatly appreciated.

post-1970-0-40487400-1406659224_thumb.png

post-1970-0-44979100-1406659255_thumb.png

post-1970-0-10577100-1406659262_thumb.png

Edited by Teken
Posted

What does your custom notification definition look like?

 

-Xathros

Posted

What does your custom notification definition look like?

 

-Xathros

 

Its super basic nothing fancy.

post-1970-0-73617000-1406660973_thumb.png

Posted

Sorry.  I have no clue what the 2.11 means in this case.

 

-Xathros

Posted (edited)

I recreated your custom notification on my test system and ran a test.  The value I get in place of your "Value: 2.11" is the name of my device tree "Network: XathTest".  In my test case, the program was sending an X10 command.  It looks like {Alert.Details} is related to the most recent event to occur within the system.  There are very few places in the ISY that support floating point values.  Energy and Climate modules come to mind.  You might look at the data available from those and see if you can spot a 2.11 somewhere.

 

-Xathros

Edited by Xathros
Posted

I recreated your custom notification on my test system and ran a test.  The value I get in place of your "Value: 2.11" is the name of my device tree "Network: XathTest".  In my test case, the program was sending an X10 command.  It looks like {Alert.Details} is related to the most recent event to occur within the system.  There are very few places in the ISY that support floating point values.  Energy and Climate modules come to mind.  You might look at the data available from those and see if you can spot a 2.11 somewhere.

 

-Xathros

 

Hello Xanthros,

 

You might be on to something here Sir! Below is a screen shot from the Autelis Bridge. As you can see the temperature value at this (moment in time) is 18.8 C'.

 

I am unsure if the decimal value is being sent in to the ISY and the system is simply trying to make heads and tails of it. But, if you look at the first posting you clearly see the State Variable value that is pushed from the Autelis device is a whole number.

 

It still doesn't explain how this same value of 2.11 is derived from or generated. Even my broken math knows at this moment in time 180 - 188 = 8 :mrgreen:  

post-1970-0-16271000-1406664930_thumb.png

Posted (edited)

Now I see it!  Its the Variable ID.

 

As in:

/rest/vars/set/<var-type>/<var-id>/<value>

Sets a variable given by var-id var-type:

1 – Integer

2 – State

 

So in this case, the alert was caused by a change in value of variable 2.11 <state.11>

 

I modified my program to be driven by a state variable and tested by changing the variable value.  Now I get "Value: 2.1"

 

My State variable is ID#1 so that correlates to your perfectly.

 

-Xathros

Edited by Xathros
Posted

Now I see it!  Its the Variable ID.

 

As in:

/rest/vars/set/<var-type>/<var-id>/<value>

Sets a variable given by var-id var-type:

1 – Integer

2 – State

 

So in this case, the alert was caused by a change in value of variable 2.11 <state.11>

 

-Xathros

 

OMG!  :shock:  You Sir, are simply amazing in your trouble shooting and deductive reasoning!  :-P  Now, how do I pump out the current temperature value that is being displayed in the State Variable to an email alert?

Posted (edited)

OMG!  :shock:  You Sir, are simply amazing in your trouble shooting and deductive reasoning!  :-P  Now, how do I pump out the current temperature value that is being displayed in the State Variable to an email alert?

Easy: ${var.2.11}

 

-Xathros

Edited by Xathros
Posted (edited)

Hrmmm, where does one find that with in the ISY UI?  :oops:

 

When customizing the notification, Select Variables, then the variable name from the list.  It will insert the above substitution variable in the notification.  Alternatively, you could just type it in since we know the type and ID: 2 and 11 hence ${var.2.11}

 

post-1150-0-50324300-1406666779_thumb.jpg

 

-Xathros

Edited by Xathros
Posted

When customizing the notification, Select Variables, then the variable name from the list.  It will insert the above substitution variable in the notification.  Alternatively, you could just type it in since we know the type and ID: 2 and 11 hence ${var2.11}

 

attachicon.gifScreen Shot 2014-07-29 at 4.44.39 PM.jpg

 

-Xathros

 

Xanthros,

 

I swear sometimes the people on this forum should get paid!  :-P  I totally forgot there were options to the left side and was just fixated that there was only an ALERT option!

 

Shakes head . . .  :oops:

 

I also realize I could simply type in your text but missed the first period (old eyes) now the temperature value is coming in via e-mail alerts. Now, what is the best method to receive a notification while not being bombarded by endless e-mails?

 

So for example my threshold is going to be 22'C or in the system 220. If the Autelis Bridge sends out a temp which is at 22 or above I want only one message. But, if the system indicates the temperature is climbing XX degree's in XX minutes / hours, I want to again receive a notification but don't want endless e-mails.

 

I have some past programs that I used but want to try something with more logic and brains at this point. Any insight to craft such a program would be most helpful kind Sir!

Posted (edited)

Something like this should do it:

 

Create an integer variable: i.NotificationSuspend and set it's value to 0

Create another integer variable: i.AlertSentAt and set it's value to 0

Create another integer variable: i.AlertDelta and set it's value to 0

 

 

Program: SecureRoomMonitor (Modify your program to something like this:)

If 
  $Secure_Room > 220
  and $i.NotificationSuspend = 0

Then
   Send Notification
   $i.NotificationSuspend = 1
   $i.AlertSentAt = $Secure_Room
   Run Program NotificationSuspend (ThenPath)

Else
   $i.AlertDelta = $Secure_Room 
   $i.AlertDelta -= $i.AlertSentAt
   Run Program OverrideSuspend (IfPath)

Program: Notification Suspend

If

Then
   Wait 20 minutes
   $i.NotificationSuspend = 0

Else

Modify the wait to meet your needs.

 

And another program to monitor the rate change during the Suspend Period:

 

Program: OverrideSuspend

if
   $i.AlertDelta >= 50

Then
   $i.NotificatiopnSuspend = 0
   Run Program SecureRoomMonitor (IfPath)

Else

In this configuration, if the temp increases another 5 deg during the 20 minute notification suspend time, the suspend is overridden, an alert sent and the alert suspend restarted. This will happen everytime the temp increases 5deg above the temp at the previous alert.  Otherwise, the alert will continue once every 20 mins until the temp drops below 22C.  Adjust as necessary.

 

Hope this helps.

 

-Xathros

 

EDITED to correct program logic and Syntax

Edited by Xathros
Posted

Xathros,

 

In the first program how did you bring up the = sign? All I see for options are is, is not, >, <, =<, => options.

Posted (edited)

Sorry. Use "is".  I typed out those programs yesterday and I often make the mistake of substituting "=" for "is".

 

-Xathros

Edited by Xathros
Posted

Sorry. Use "is".  I typed out those programs yesterday and I often make the mistake of substituting "=" for "is".

 

-Xathros

 

OK, good to know I am not totally losing it! Now in your else clause is the last entry a mistake? I see no method to add in a third element of - i.AlertSentAt.

 

Unless that is a separate line entry in the Else clause. A repost of the final program would be great.

Posted

OK, good to know I am not totally losing it! Now in your else clause is the last entry a mistake? I see no method to add in a third element of - i.AlertSentAt.

 

Unless that is a separate line entry in the Else clause. A repost of the final program would be great.

Yes Sir it was.  I have just edited the whole thing to make it functional and syntactically correct.  Note:  I changed s.AlertSentAt to and integer i.AlertSentAt, Added a line to SecureRoomMonitor to set i.AlertSentAt and corrected the calculation section in the Else of SecureRoomMonitor

 

Sorry for all the errors.  Was rushing out the door when I posted that yesterday.

 

-Xathros

Posted

Here is the final version reposted from above:

 

Create an integer variable: i.NotificationSuspend and set it's value to 0

Create another integer variable: i.AlertSentAt and set it's value to 0

Create another integer variable: i.AlertDelta and set it's value to 0

 

 

Program: SecureRoomMonitor (Modify your program to something like this:)

If 
  $Secure_Room > 220
  and $i.NotificationSuspend = 0

Then
   Send Notification
   $i.NotificationSuspend = 1
   $i.AlertSentAt = $Secure_Room
   Run Program NotificationSuspend (ThenPath)

Else
   $i.AlertDelta = $Secure_Room 
   $i.AlertDelta -= $i.AlertSentAt
   Run Program OverrideSuspend (IfPath)

Program: Notification Suspend

If

Then
   Wait 20 minutes
   $i.NotificationSuspend = 0

Else

Modify the wait to meet your needs.

 

And another program to monitor the rate change during the Suspend Period:

 

Program: OverrideSuspend

if
   $i.AlertDelta >= 50

Then
   $i.NotificatiopnSuspend = 0
   Run Program SecureRoomMonitor (IfPath)

Else

In this configuration, if the temp increases another 5 deg during the 20 minute notification suspend time, the suspend is overridden, an alert sent and the alert suspend restarted. This will happen everytime the temp increases 5deg above the temp at the previous alert.  Otherwise, the alert will continue once every 20 mins until the temp drops below 22C.  Adjust as necessary.

 

 

-Xathros

Posted

OK, I have set up the three programs to reflect what has been provided. It doesn't seem to operate as we intend it though? Because its not actually 22'C in my secure room. I changed the value to 180 (18'C). The current temperature in that room is 185 (18.5'C) and I changed the notification suspend to a reasonable 5 minutes to replicate a real world condition.

 

My alert delta is set for degree 20 (2'C) change.

 

Since the room is above 180, at its current state of 185 I would have expected e-mails every 5 minutes until it dropped back down to 180.

 

Also, can you explain to me the logic of  

  •         $i.Alert_Delta -= $i.Alert_Sent_At   <-- What does the -= operator do and how is it supposed to work in this instance?
Posted

Also,I wanted to confirm the value of 20 for the delta is indeed 2 degree increments opposed to 20 degree increments. As the value being pushed from the Autelis bridge is a whole number of (currently) 185.

 

So, I want to make sure the program shouldn't be 

  • Over Ride Suspend 
  •         $i.Alert_Delta >= 20
  •  
  • When it should actually be 
  •         $i.Alert_Delta >= 2 
  •  
Posted

First, the program won't trigger until the temp value changes.  Bump the value up one and see if it triggers.

 

In my original posting my program said: $i.AlertDelta = $Secure_room - $i.AlertSentAt.  This is not valid code in the ISY but is the intended goal. 

Doing this the ISY way:

$i.AlertDelta is $Secure_Room sets AlertDelta to the current Secure_Room temp value.

$i.AlertDelta -= $i.AlertSentAt subtracts i.AlertSentAt from i.AlertDelta leaving i.AlertDelta with the actual difference between the current Room temp and the temp when the last alert was sent.

 

-Xathros

Posted

 

Also,I wanted to confirm the value of 20 for the delta is indeed 2 degree increments opposed to 20 degree increments. As the value being pushed from the Autelis bridge is a whole number of (currently) 185.

 

So, I want to make sure the program shouldn't be 

  • Over Ride Suspend 
  •         $i.Alert_Delta >= 20
  •  
  • When it should actually be 
  •         $i.Alert_Delta >= 2 
  •  

 

Correct.  I have to do this with my CAI based temp probes as well.  Everything is 10X actual.

 

-Xathros

Posted

@Teken

 

Modify NotificationSuspend as follows:

If

Then
   Wait 20 minutes
   $i.NotificationSuspend = 0
   Run Program SecureRoomMonitor (IfPath)

Else

If the room temp is steady, the monitor program will not automatically retrigger even when above the threshold since it requires a change in temp value to trigger.  The change above will force the notification to resend as long as the temp remains above the threshold.

 

-Xathros

Posted

@Teken

 

Modify NotificationSuspend as follows:

If

Then
   Wait 20 minutes
   $i.NotificationSuspend = 0
   Run Program SecureRoomMonitor (IfPath)

Else

If the room temp is steady, the monitor program will not automatically retrigger even when above the threshold since it requires a change in temp value to trigger.  The change above will force the notification to resend as long as the temp remains above the threshold.

 

-Xathros

 

Xathros,

 

That is most excellent and I thank you! I can see using both variations of this program in some existing applications. Where in one case I would want to know a state of change but not receive endless emails. While in some instances I would want (defined emails threshold) until that condition no longer existed.

 

I am going to play with this for the next few hours and see what shakes out.

 

I gather I will need to recreate 31 more Integer Variables / Programs for the other sensors now. 

Posted (edited)

Xathros,

 

That is most excellent and I thank you! I can see using both variations of this program in some existing applications. Where in one case I would want to know a state of change but not receive endless emails. While in some instances I would want (defined emails threshold) until that condition no longer existed.

 

I am going to play with this for the next few hours and see what shakes out.

 

I gather I will need to recreate 31 more Integer Variables / Programs for the other sensors now. 

Your welcome.

 

More sensors will require more variables.  You might consider renaming the ones we have used already to reflect the sensor to which they belong and name additional ones according to their sensor as well.  May I suggest:

s.Secure_RoomTemp

i.Secure_RoomAlertTmp

i.Secure_RoomDelta

i.SecureRoomSuspend

 

You can rename the existing variables on the variables page and they will be updated throughout your programs automagically.

 

I would also recommend creating folders for each sensor's set of programs to keep things organized and give you an easy way to enable/disable the programs for individual sensors.

 

-Xathros

Edited by Xathros
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.5k
×
×
  • Create New...