Hi Everyone, I am trying to find a way to create an Attribute in AF that records how long it has been since another attribute has been a certain value.

For example, consider a health tag that is either 1 for healthy or 0 for unhealthy, I want to configure another attribute that records the time as soon as the health tag becomes 0.

 

 

Parents
  • If your Healthy attribute only changes state (0 -> 1 -> 0) without repeating values, then you can use the TimeEq function. Otherwise if the values repeat (0 -> 0 -> 1 -> 1 -> 0 -> 0 -> 0), then you'll need to find the timestamp of the original change, and you can use the Int function to get the time difference in seconds between the two timestamps (timestamp of change - timestamp of now).

Reply
  • If your Healthy attribute only changes state (0 -> 1 -> 0) without repeating values, then you can use the TimeEq function. Otherwise if the values repeat (0 -> 0 -> 1 -> 1 -> 0 -> 0 -> 0), then you'll need to find the timestamp of the original change, and you can use the Int function to get the time difference in seconds between the two timestamps (timestamp of change - timestamp of now).

Children
No Data