Numerical expression for obtaining max from list of variables
Posted: Tue Jan 30, 2024 12:38 am
Hi,
I have a specific scenario where I want to pass an HTTP request command that includes the maximum value of the last 5 wind sensor readings. I have confirmed that the template variables [wind0wind-prev1], [wind0wind-prev2], [wind0wind-prev3], etc... are returning the correct values that I want, and I am trying to figure out if there is an expression available to get the maximum value from that list if template variables.
I see in the documentation there are numerical expressions "max" and "min", can that be used in this scenario? If so, what would the syntax be to take the maximum of an array of variables?
Let me know if anyone has any ideas.
Thank you very much.
I have a specific scenario where I want to pass an HTTP request command that includes the maximum value of the last 5 wind sensor readings. I have confirmed that the template variables [wind0wind-prev1], [wind0wind-prev2], [wind0wind-prev3], etc... are returning the correct values that I want, and I am trying to figure out if there is an expression available to get the maximum value from that list if template variables.
I see in the documentation there are numerical expressions "max" and "min", can that be used in this scenario? If so, what would the syntax be to take the maximum of an array of variables?
Let me know if anyone has any ideas.
Thank you very much.