Hi,
How can I create a workflow which will trigger an action when the device readings have crossed a threshold for X min.
For example the freezer temperature is above -20 c for more than 10 min?
Hi @Roi_Aranyi,
You will want to make use of a Timer Node and a Conditional Node. The Timer Node will trigger after a set amount of time, and the Conditional Node will give you a boolean that sends you right or left for true and false. So you will go right (true) if the freezer has been above -20 degrees, and perform some actions afterwards for handling the lower temperature (email notification, text notification, alert). The On Change Node may also provide some of what you are looking for, or you could do a timestamp comparison of the last recorded value to check for those 10 minutes (details found here).
There is also a feature request here that could benefit, so be sure to vote!
Let me know how else I can help,
Julia
Thanks Julia,
Will this solution ensure the temp was above -20 the all time or is just sampled in two different time points?
Hi @Roi_Aranyi,
The solution I provided above is ideal for two time points in some use cases, but another engineer pointed out to me a better solution for your use case. It was recommended that you use the Storage: Set Value Node to store the current time if the temperature of the freezer goes above -20 degrees. Then, when your Device State workflow is triggered, you can compare the time of current workflow to the time you have just stored in workflow storage by subtracting one from the other in a Conditional Node. Then, if the time is over 10 minutes, you will be able to send a notification or perform an action from the workflow.
Let me know if an example would make this clearer!
Thanks,
Julia
Thanks again Julia,
I think I understand the general idea, just one question:
In the solution you’ve mentioned would each reading above the threshold will get the Set Value Node to keep current time?
How do I keep the Set Value Node from overriding the time of the first time the temp crossed the threshold?
Hi @Roi_Aranyi,
You do not have to override the time for every cross of the threshold, but you are able to if your use case calls for it. I have built out an example workflow we can walk through:
The workflow below will store the time if the temperature is above -20, and will send a text alert if the temperature stays above -20 for longer than 10 minutes.
This workflow receives mock temperature values from my Virtual Button:
Then I get my stored value which I have named tempTime
and put that value on the payload at data.lastTemp
. If it is null, I will know that the temperature has been at the correct levels, but if it is not null, it will hold the time at which the temperature was too high.
Then I check my current temperature reading:
If it is below -20, it goes left, and my stored tempTime
value is reset to null.
If it is too hot (above -20), the path goes right to a conditional that will check if tempTime
has a stored value.
If it does have a stored value, we go left to another conditional that compares the current time and the stored time, and if more than 10 minutes have passed since the temperature was above -20, I will receive a text notification:
If my stored tempTime
value is null, the workflow goes right and sets my storage value to the current time:
If it does have a stored value, we go left to another conditional that compares the current time and the stored time:
Then, when 10 minutes have gone by and my temperature is still too high, I receive a text notifying me that I should check it out!
Let me know how else I can help,
Julia
Perfect.
Thank you
Hi @JuliaKempf, I’m running into a similar situation but in my case what I’m trying to accomplish is:
- Bring values from a dashboard ‘slide/set’ input to a Virtual Button into the workflow - for example, Temperature Max threshold
- Once I get a sensor temp report, I want to compare the last dashboard threshold value (temp_max, for example) with the current sensor temp reading
- if current > temp_max then send SMS, for example
I was successful in setting the temp_max threshold from the dashboard input control into the correct device payload. But the problem I’m having the way I’m working the workflow is that all temp sensor reports are compared to the same temp_max threshold from my one device:
The Data Explorer also confirms we have successful hexID (6DD2 in this case) tag payload transfer (no other device has this data):
What is the best way, in your view, to then compare the correct device (in this case 6DD2) from the dashboard input with the correct device temp reading from the workflow to make a decision based on :
- the correct Device
- with the correct reported temp vs temp>max?
Here’s the workflow detail currently :

Let me know if this makes sense and/or if you need any add’nl info
Right now, I am getting an SMS msg everytime ANY sensor reports a TEHU state and the TEMP has gone > the LAST SET dashboard threshold setting, regardless of device (I have two Input Controls for two separate devices, including ‘6DD2’, yet the values used to ‘compare’ on the workflow are the last set on the dashboard, 6DD2 or the other).
Thank you in advance to you or whoever’s helping!!! j
@JuliaKempf never mind! I got it. Following @yoursunny 's post Sending temperature data values with SMS and his use of the Gauge Query Node PLUS identifying that I was using the wrong device_ID payload path, I can now successfully compare the right sensor temp read to the last known dashboard ‘set’ threshold:
Thanks @yoursunny for your post/idea!