# \[APP\]\[Pro\] Chronograph - Adds precise timer, stopwatch and transition functionality to Homey

**URL:** <https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214>\
**Category:** Apps\
**Tags:** app, official, tools, homey-pro\
**Created:** [September 17, 2019, 5:55am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214 "2019-09-17T05:55:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [September 17, 2019, 5:55am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/1 "2019-09-17T05:55:42Z")

</div>

# Chronograph

Adds precise timer- and stopwatch functionality to Homey.

> **[Chronograph | Homey](https://homey.app/en-us/app/nl.fellownet.chronograph/Chronograph/)**
>
> Adds precise timer, stopwatch and transition functionality to Homey.

[https://github.com/fellownet/chronograph](https://github.com/fellownet/chronograph)

## Features

- Create timers and stopwatches directly from flow cards, no need for a prior configuration,
- Start timers with a duration in milliseconds (fractional seconds), seconds, minutes, hours or days,
- Start stopwatches without a predefined end time,
- Trigger flows at exact timer- or stopwatch durations with millisecond (fractional seconds) precision,
- Self-explanatory flow cards for easy integration of timers and stopwatches in your home automation.

## Old Readme file:

FEATURES

- Self-explanatory flow cards for easy integration of timers, stopwatches and transitions in your home automation,
- Create timers, stopwatches and transitions directly from flow cards, no need for a prior configuration,
- Start timers with a duration in milliseconds (fractional seconds), seconds, minutes, hours or days,
- Start stopwatches without a predefined end time,
- Start transitions to gradually change a device parameter over time,
- Trigger flows at exact timer- or stopwatch durations with millisecond (fractional seconds) precision,
- Pause and resume timers, stopwatches and transitions with action cards or from within settings,
- Support for random or computed durations or adjustments using simple math expressions,
- All timers, stopwatches and transitions are persistent across Homey restarts,
- Target multiple timers, stopwatches and transitions at once using wildcards in supported cards.

SIMPLE MATH EXPRESSIONS

The start, resume and adjust action cards have built-in support for simple math expressions. This allows for random or computed timer and stopwatch durations, including calculations based on token values.

For example:

```
ceil(99.5) / 5
pick(1, 3, 5, 9) * 2
random(10, 30)
abs(-10)

```

In addition to basic math expressions, the following functions are supported:

- abs(x) - calculate the absolute value of a number,
- ceil(x) - rounds a number up to the next whole number,
- floor(x) - rounds a number down to the previous whole number,
- round(x) - rounds a number towards the nearest whole number,
- random(min, max) - a random number larger or equal to min and smaller than max,
- min(x, y) - the lowest number from the supplied list,
- max(x, y) - the largest number from the supplied list,
- pick(x, y[, n]) - pick a random value from the supplied list.

HOMEYSCRIPT

In addition to the available flow cards, timers and stopwatches can also be controlled using [HomeyScript](https://homeyscript.homey.app).

For example, this script will stop all running timers:

```
let app = await Homey.apps.getApp({id:'nl.fellownet.chronograph'});
app.apiGet('/timers').then(result => {
	let timers = JSON.parse(result);
	timers.forEach(timer => {
		app.apiDelete('/timers/' + timer.id);
	});
});

```

- GET /timers - retrieve a list of all active timers,
- GET /timers/:id - retrieve a single timer,
- PUT /timers/:id - pause or resume a timer,
- DELETE /timers/:id - stops a timer.
- GET /stopwatches - retrieve a list of all active timers,
- GET /stopwatches/:id - retrieve a single timer,
- PUT /stopwatches/:id - pause or resume a timer,
- DELETE /stopwatches/:id - stops a timer.
- GET /transitions - retrieve a list of all active transitions,
- GET /transitions/:id - retrieve a single transition,
- PUT /transitions/:id - pause or resume a transition,
- DELETE /transitions/:id - stops a transition.

### Please report **issues** or **feature** requests at [Issues · Qluster-IT/nl.qluster-it.Chronograph](https://github.com/Qluster-IT/nl.qluster-it.Chronograph/issues).

### Apps:

> [@\[Profile\] Arie J. Godschalk](https://community.homey.app/t/profile-arie-j-godschalk/70663/2):
>
> Apps developed or maintained by me: [Advanced Triggers](https://community.homey.app/t/app-pro-advanced-triggers-trigger-and-action-cards-with-eventname-for-advanced-flows/65651) , [BeNext](https://community.homey.app/t/app-pro-benext-benext-devices-for-homey/76104) , [Better Logic](https://community.homey.app/t/app-pro-better-logic-just-some-better-logic-and-variable-management/5568) , [Chronograph](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214) , [Device Capabilities](https://community.homey.app/t/app-pro-device-capabilities-enhance-the-capabilities-of-devices/43287) , [Advanced Virtual Device](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198) , [FTP Client](https://community.homey.app/t/app-pro-ftp-client/70876) , [Google Services](https://community.homey.app/t/google-services-app-for-translate-and-new-text-to-speech-for-any-device-with-url-input/43257) , [Homesh Controller](https://community.homey.app/t/app-pro-homesh-controller-homesh-satellite-connect-homey-pro-2023-to-homey-pro-for-led-speaker-zwave-satellite-and-network-resource/70369) , [Homesh Satellite](https://community.homey.app/t/app-pro-homesh-controller-homesh-satellite-connect-homey-pro-2023-to-homey-pro-for-led-speaker-zwave-satellite-and-network-resource/70369) , [JSON Handler and Manipulator](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317) , [LOQED](https://community.homey.app/t/app-pro-loqed-your-personal-doorman/89816) , [Music Url Converter](https://community.homey.app/t/music-url-converter-play-music-urls-on-homey-bigger-then-900-kb/43546) , [Reverse Proxy and DDNS](https://community.homey.app/t/app-pro-reverse-proxy-and-ddns/160862) , [Simple Log](https://community.homey.app/t/simple-log-app/146) , [Universal Media Player](https://community.homey.app/t/universal-media-player-a-generic-storages-place-for-your-homey-speakers-tvs-or-other-media-devices/43450) and [Virtual Devices](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723) . [Goto profi…](https://community.homey.app/t/profile-arie-j-godschalk/70663)

### Donations or Sponsorship

> [@\[Profile\] Arie J. Godschalk](https://community.homey.app/t/profile-arie-j-godschalk/70663/3):
>
> Donations or Sponsorship. You can help with the development, maintenance and support for the Apps, by donating or becoming a sponsor. This would be much appreciated! The more donations i receive, the more time i can make free for development and support. slight_smileDonations can be done through: [[PP] PayPal](https://paypal.me/QlusterIT) Requires a PayPal account. [[GS] Github Sponsors](https://github.com/sponsors/XeroxQ) Allowes for CreditCard. Sponsorships can be done through: [[P] Patreon](https://www.patreon.com/QlusterIT/membership) Requires a Patreon account. [[GS] Github Sponsors](https://github.com/sponsors/XeroxQ) …

---

<div class="post-metadata">

**Author:** ![Igy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/igy/32/22144_2.png) [@Igy](https://community.homey.app/u/Igy)\
**Post date:** [September 17, 2019, 7:25am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/2 "2019-09-17T07:25:15Z")

</div>

it looks perfect. However I do have some questions:

1. where can find remaining time of timer?
2. Is it possible to use remaining time in notifications (didn’t find this label)?

Thanx

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [September 17, 2019, 7:34am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/3 "2019-09-17T07:34:22Z")

</div>

There’s actually a new version under review by Athom that has a settings page with an overview of all timers and stopwatches currently running.

That version also includes tokens (tags/labels) with the duration of a timer or stopwatch, but those are only available after a trigger. I have yet to find a good way to include global tokens (those that exist all the time, in every card). It’s not trivial because it would most likely require me to update these tokens every xx milliseconds for it to be even slightly accurate, which would give too big of a load/stress on a Homey.

 ![screenshot](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/f/f631d47e184d2c5b9c2061f69948891121726c68.png)

---

<div class="post-metadata">

**Author:** ![Igy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/igy/32/22144_2.png) [@Igy](https://community.homey.app/u/Igy)\
**Post date:** [September 19, 2019, 11:26am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/4 "2019-09-19T11:26:30Z")

</div>

Nice, tested and one more comment. If I do a app restart, or Homey restart, timer information is lost. This is quite a problem for long term running timers (e.g. watering delay in case of rain).

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [September 19, 2019, 12:53pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/5 "2019-09-19T12:53:47Z")

</div>

That’s exactly one of the new features in v1.0.2 which is currently being prepared for release (see the release notes on github).

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [September 24, 2019, 9:43am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/6 "2019-09-24T09:43:46Z")

</div>

Version v1.0.2 has just been released:

- Timers and stopwatches are now persistent across application restarts and Homey reboots.
- Pause and resume timers and stopwatches from flow cards.
- Fine-tuning of the settings page.
- Pause and resume timers and stopwatches from settings.
- Support for timers longer than 24.855 days.
- Unit testing.

---

<div class="post-metadata">

**Author:** ![Hakurac](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hakurac/32/9945_2.png) [@Hakurac](https://community.homey.app/u/Hakurac)\
**Post date:** [September 27, 2019, 2:40pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/7 "2019-09-27T14:40:12Z")

</div>

How do I use the value of a stopwatch as a variable to make calculations?

---

<div class="post-metadata">

**Author:** ![Patrick1610](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick1610/32/6843_2.png) [@Patrick1610](https://community.homey.app/u/Patrick1610)\
**Post date:** [September 30, 2019, 2:58pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/8 "2019-09-30T14:58:14Z")

</div>

Hi, I really want to use this app instead of countdown since this is much more promising. I was just wondering, is it possible to add a timer with a variable end time? (like somewhere between 600s and 1800s?)

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [September 30, 2019, 7:56pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/9 "2019-09-30T19:56:01Z")

</div>

That’s exactly one of the new functionalities I’m currently working on. To give you an idea, I’ve pushed this [development branch](https://github.com/fellownet/chronograph/tree/math_in_timers) to github, so you can take a look at the [readme](https://github.com/fellownet/chronograph/blob/math_in_timers/README.md) to see if it suits your needs. The new functionality is currently being tested by a select few alpha testers, and it will be offered as a beta to the Athom review team hopefully somewhere next week.

![52](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/c/ccc7498edc6cfe3a9a04c5116459799d77322d8d.jpeg)

---

<div class="post-metadata">

**Author:** ![Patrick1610](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick1610/32/6843_2.png) [@Patrick1610](https://community.homey.app/u/Patrick1610)\
**Post date:** [September 30, 2019, 8:12pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/10 "2019-09-30T20:12:01Z")

</div>

You are the man! This looks amazing!! The random setting is used to make it look like I’m present when I’m away or asleep at night, so that needs to be completely random between a min and max nr of seconds so I’ll only need that expression for that.

But, I also see great potential in all the other math expressions you will be adding, and even have som current flows that will be simplified by this, very nice!  
I’m in stable release, because I read that switching from beta to stable would reset the entire application so I’ll have to wait a little longer! When do you think this wil hit stable release?

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [September 30, 2019, 8:19pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/11 "2019-09-30T20:19:30Z")

</div>

Two, maximum three weeks, max. Depending on problems that are discovered, and the time Athom takes to review the new release.

---

<div class="post-metadata">

**Author:** ![Patrick1610](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick1610/32/6843_2.png) [@Patrick1610](https://community.homey.app/u/Patrick1610)\
**Post date:** [September 30, 2019, 8:46pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/12 "2019-09-30T20:46:29Z")

</div>

Sounds great!! I’ts worth the wait, that’s for sure 🙂

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [October 1, 2019, 11:21am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/13 "2019-10-01T11:21:48Z")

</div>

Version **1.0.3 (stable)** has just been released with the following change:

- German translation, thanks to [Copiis](https://github.com/copiis).

Version **1.0.4 (beta)** has just been released with the following change:

- Support for simple math expressions in timer and stopwatch durations.

Kudos to Athom for reviewing the beta version of the app within a day 😉

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [October 1, 2019, 12:56pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/14 "2019-10-01T12:56:06Z")

</div>

**Version 1.0.5 (beta)** is offered for review and fixes a major import bug that causes crashes for **version** **1.0.4 (beta)**. Guess that’s why they’re called beta’s 😬

---

<div class="post-metadata">

**Author:** ![piotro](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/piotro/32/27212_2.png) [@piotro](https://community.homey.app/u/piotro)\
**Post date:** [October 2, 2019, 10:27am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/15 "2019-10-02T10:27:40Z")

</div>

Hello.  
App 1.03 crashes when I use “start or replace timer X” while the timer X is already running.  
I think it was working correctly (replacing running timer with newly provided value) in previous versions.  
When I alternatively try “adjust timer X” also nothing happens to the value of running timer, but at least app does not crash.

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [October 4, 2019, 6:14am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/16 "2019-10-04T06:14:32Z")

</div>

> [@BobKersten](#):
>
> That version also includes tokens (tags/labels) with the duration of a timer or stopwatch, but those are only available after a trigger. I have yet to find a good way to include global tokens (those that exist all the time, in every card). It’s not trivial because it would most likely require me to update these tokens every xx milliseconds for it to be even slightly accurate, which would give too big of a load/stress on a Homey.

It’s quite ambitious to have millisecond update of global tokens. I would appreciate the actual timer value as a global token even with seconds precision.  
Good work, by the way!

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [October 7, 2019, 11:09am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/17 "2019-10-07T11:09:30Z")

</div>

Version **1.0.6 (beta)** has just been released with the following change:

- Added transitions to gradually change a value over time.
- Tweaked support for simple math expressions in timer, stopwatch and transition durations.

If no issues arise, this will be the next stable release.

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 11, 2019, 10:25am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/18 "2019-10-11T10:25:15Z")

</div>

How can I use the Stopwatches with logic or better logic?  
e.g. variable Xy = stopwatch Xy

There is no tag for stopwatches available in logic or better logic!

Do I something wrong?! Or is the answer very simple,  
it’s no possible!

---

<div class="post-metadata">

**Author:** ![BobKersten](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bobkersten/32/7949_2.png) [@BobKersten](https://community.homey.app/u/BobKersten)\
**Post date:** [October 11, 2019, 1:48pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/19 "2019-10-11T13:48:35Z")

</div>

There’s a technical challenge here. Having tokens available whenever something unrelated triggered a flow is unfeasible. That would require the app to update tokens every few milliseconds to be somewhat precise. I could implement a work-around though. What if you could pause the timer once your event triggers, and then have a separate flow react on the pausing of the timer. At that point you’d have the exact duration of the timer in a token that you can use however you want. You can also resume the timer in the same flow. Would that help your cause?

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [October 11, 2019, 2:33pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/20 "2019-10-11T14:33:03Z")

</div>

I think that’s exactly what i’m looking for! 😀

What i want realize, is a kind of “Operating hours counter”.

I want to determined how long a specific device was turned on during the day. This is already possible with the Chronograph App but I can not store the result in a variable.

The Stopwatch should run everytime if the device is turned on and will be paused when it was turned off. End of the day i want to save the value of the Stopwatch in a varaiable. In this way it would be possible to visualize the “Operating hours counter” through insights.

Thanks a lot in advance!!

[Next page](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214.md?page=2)
