How would you trigger an alert for a boolean status over a period of time

for example:

if water is flowing: flowrate = 1

if water is not flowing : flowrate = 0

how would i use this to trigger an alert if flowrate = 1 for (x) amount of time then send email etc…

To trigger an alert for a boolean status over a period of time, you would need to use the ‘Trigger by Variable’ type of Action in TagoIO. Here’s how you can set it up:

1. Select the Variable for Testing: Choose the variable that you want to monitor, in this case, `flowrate`.

2. Specify the Condition Type: Since you want to trigger an alert when the flowrate is 1 for a certain amount of time, you would need to use a condition that can evaluate the state over time. This might involve writing a custom script in an Analysis to keep track of how long the `flowrate` has been at 1.

3. Provide a Supplementary Value for the Condition: This would be the threshold time (x amount of time) that the `flowrate` needs to be at 1 before an alert is triggered.

4. Define the Field Type for Comparisons: In this case, the field type would be the boolean status of the `flowrate`.

5. Set Up Trigger Conditions: Navigate to the Trigger section in your dashboard and set up the conditions as specified.

6. Action Execution: If the condition is met (i.e., `flowrate` has been 1 for the specified amount of time), the action will execute. This could be sending an email, which you can set up in the Actions section.

Since the memory provided does not include details about evaluating a condition over a period of time directly within the Trigger settings, you would likely need to use an Analysis script to perform this logic. The Analysis would monitor the `flowrate` variable, and once it detects that the condition has been met for the specified duration, it would trigger the action to send an email alert.

For more information on setting up triggers and actions, you can refer to the TagoIO documentation on Trigger by Variable

Please note that the exact implementation details, such as how to write the Analysis script to monitor the duration, are not provided in the memory. You would need to develop custom logic in JavaScript within an Analysis to achieve this functionality.