Creating an elapsed time notification

Hi All, I need some help in creating rule in rule machine on a notification of elapsed time between two triggers.

For context - im trying to get a notification on how long I spend in my Gym. So the best way to automate this is to get hubitat to give me a mobile notification of elapsed time between two consecutive gym door(contact sensor) ā€œopensā€.
Can someone help me on how to create this

Here’s a sample RM rule that will provide you with what you’re looking for:

The Ā« Define Required Expression Ā» is using the rule’s Private Boolean to ensure that the rule only triggers every other time the door opens.

This rule will give you the difference between the first and second time the door opens in minutes. Another option would be to calculate the difference in time between every times the door opens.

Does this help?

5 Likes

Thank you! Yes it definitely worked.
I just added an additional action item of sending a notification on my phone of that "TimeDiff" value. Thanks again.

1 Like