I'll prefix this post by saying that I might not be doing this the right way, and I'm open to other suggestions!
I have two items - one which returns a numerical status, and the other which returns text (dynamic html body of an email for the trigger to send if the status > 0). Problem I have is I cannot guarantee that the text item will be updated when the trigger fires on the status item, causing the occasional alert being sent with a warning subject, and a body stating that everything is ok - somewhat confusing for the recipients!
What I'm looking for is a condition for the trigger to ensure that the timestamp on the text item is newer/greater than the timestamp on the status item - I've tried text.now()>status.now() and text.time()>status.time() (of course these are simplified expressions for the purpose of this post). Both of these cause the alert to never be triggered - presumably because the seconds-since-epoch and current time are for the time of the trigger check, rather than the time of the last item value.
Any ideas would be very much appreciated.
Cheers,
Ben.
I have two items - one which returns a numerical status, and the other which returns text (dynamic html body of an email for the trigger to send if the status > 0). Problem I have is I cannot guarantee that the text item will be updated when the trigger fires on the status item, causing the occasional alert being sent with a warning subject, and a body stating that everything is ok - somewhat confusing for the recipients!
What I'm looking for is a condition for the trigger to ensure that the timestamp on the text item is newer/greater than the timestamp on the status item - I've tried text.now()>status.now() and text.time()>status.time() (of course these are simplified expressions for the purpose of this post). Both of these cause the alert to never be triggered - presumably because the seconds-since-epoch and current time are for the time of the trigger check, rather than the time of the last item value.
Any ideas would be very much appreciated.
Cheers,
Ben.
Comment