# Chronograph calculate times

**URL:** <https://community.homey.app/t/chronograph-calculate-times/112072>\
**Category:** Questions & Help\
**Created:** [June 27, 2024, 2:56pm UTC](https://community.homey.app/t/chronograph-calculate-times/112072 "2024-06-27T14:56:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Lesage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/john_lesage/32/16576_2.png) [@John\_Lesage](https://community.homey.app/u/John_Lesage)\
**Post date:** [June 27, 2024, 2:56pm UTC](https://community.homey.app/t/chronograph-calculate-times/112072/1 "2024-06-27T14:56:11Z")

</div>

I have a smart plug that controls a Humidifier, I have made a flow to inform me when the smart plug has started 5 times. Now I also want to check the time the smart plug was on during these 5 times to check the waterreservoir.  
Eg. 1st **H** umidifier was on for 40 minutes, 2nd **H** was on for 2 hours, 3rd **H** was on for 1 hour, etc. I want to receive a message if the **H** is on for 3,5 hours

---

<div class="post-metadata">

**Author:** ![Hielke\_de\_Jong](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hielke_de_jong/32/79029_2.png) [@Hielke\_de\_Jong](https://community.homey.app/u/Hielke_de_Jong)\
**Post date:** [June 27, 2024, 9:01pm UTC](https://community.homey.app/t/chronograph-calculate-times/112072/2 "2024-06-27T21:01:27Z")

</div>

with [Chronograph App for Homey | Homey](https://homey.app/en-us/app/nl.fellownet.chronograph/Chronograph/) it is possible to use a stopwatch.

---

<div class="post-metadata">

**Author:** ![Cuprum](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cuprum/32/41409_2.png) [@Cuprum](https://community.homey.app/u/Cuprum)\
**Post date:** [June 28, 2024, 4:39am UTC](https://community.homey.app/t/chronograph-calculate-times/112072/3 "2024-06-28T04:39:52Z")

</div>

Actually there is no reason to calculate time in flows. We can measure it directly 😉  
How to do it - to many possible paths and different timer apps, but main steps…

- Use some Timer ( does not matter it counts back or forwards, but You must set event when it reaches back to zero or to the specified runed time for **H** )
- When **H** starts, start ( actually resume, do not set new value) the Timer
- When **H** stops, pause ( again, not zero/set ) the Timer
- When the timer reaches zero/determined value - send message
- Use automatic ( together with “send message” ) or manual ( GUI / button / … ) re-setting The Timer

Above are the bones of logic, if i need to build something. Just for comment - i personally prefer to have separate event handling for re-seting timer, because there may be “human factor delay” between message and tank refill.

---

<div class="post-metadata">

**Author:** ![John\_Lesage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/john_lesage/32/16576_2.png) [@John\_Lesage](https://community.homey.app/u/John_Lesage)\
**Post date:** [June 28, 2024, 10:00am UTC](https://community.homey.app/t/chronograph-calculate-times/112072/4 "2024-06-28T10:00:25Z")

</div>

Hi Hielke,

Thanks, can you provide an example?

Regards,

John

---

<div class="post-metadata">

**Author:** ![John\_Lesage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/john_lesage/32/16576_2.png) [@John\_Lesage](https://community.homey.app/u/John_Lesage)\
**Post date:** [June 28, 2024, 10:01am UTC](https://community.homey.app/t/chronograph-calculate-times/112072/5 "2024-06-28T10:01:24Z")

</div>

:HI Cuprum,

Same as above, can you please provide an example?

Regards,

John

---

<div class="post-metadata">

**Author:** ![Cuprum](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cuprum/32/41409_2.png) [@Cuprum](https://community.homey.app/u/Cuprum)\
**Post date:** [June 28, 2024, 10:37am UTC](https://community.homey.app/t/chronograph-calculate-times/112072/6 "2024-06-28T10:37:36Z")

</div>

Ok, some PoC, As here is quite hot, i used Fan instead. Also used some other handfull pieces. But hope, the change of devices is easy… also take it easy, used only ~10 minutes and not fully tested/debuged it 😇

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/a/ca16106561a556e7050ca274c690257a6387785c.png)

---

<div class="post-metadata">

**Author:** ![Hielke\_de\_Jong](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hielke_de_jong/32/79029_2.png) [@Hielke\_de\_Jong](https://community.homey.app/u/Hielke_de_Jong)\
**Post date:** [June 28, 2024, 2:27pm UTC](https://community.homey.app/t/chronograph-calculate-times/112072/7 "2024-06-28T14:27:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/a/ba15bd2b0c02ecc2bf9759396b4a17a4bf36454f.png)

Witch extra check when you turn it on (but for reminder if stopwatch was not set to 0).

---

<div class="post-metadata">

**Author:** ![John\_Lesage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/john_lesage/32/16576_2.png) [@John\_Lesage](https://community.homey.app/u/John_Lesage)\
**Post date:** [June 28, 2024, 2:43pm UTC](https://community.homey.app/t/chronograph-calculate-times/112072/8 "2024-06-28T14:43:21Z")

</div>

thanks a lot I will try this tonight 😉
