# \[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:** 20

<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:** [December 29, 2022, 4:27pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/394 "2022-12-29T16:27:45Z")

</div>

Glenn,

Do you also have Timer reached … with a variable in it?  
Like this:

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

Because, if so, that never worked before right?

@Ronni ,

Indeed, and, unfortuancly, this cannot be solved for Variables.  
Well, not without including the Athom-API (which is very memory heavy).

‌

In your example:

Image 1 And-card: all the app does here is evaluated ALL When Timers flowcards with the given Name.  
Then Homey will evaluate each card to check wether to really execute the flows.  
There the name is checked based on the content of the token(variable in this case) and executed (or not).

Image 1 Start card:

Here the App gets the value of the variable, and then i can start the timer.

Image 2:  
When Any Timer is done, all Timer-When cards are evaluated to be executed.  
I give the TImer name and Homey the token/variable/text value.  
I evaluate this and if the are the same, the flow is executed.

Image 3:

Whenever you save a flow with this card, the app gets a signal.  
The app then saves the names and reached-info from the cards.

But when you use a variable/token, i cannot read that: i get a name like [[homey:app:logic|\*\*\*\*]].

And i cannot read the inside/value of a (random) tag, without requiring full access to the Homey-Api.

This would be a terrible overhead, and create much checkups when running any(!) timer.  
Or i would need to watch all variables/token that is/are used within each flowcard.

---

<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:** [December 29, 2022, 4:33pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/395 "2022-12-29T16:33:08Z")

</div>

When you use the Timer/Stopwatch reached … with a direct name, that works fine.  
Just not when you use a token/tag/variable with a name in it.

That is currently not possible for flowcards that have arguments that the app needs to know and match with a specific variable (like the “split”/reached time).

---

<div class="post-metadata">

**Author:** ![Ronni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronni/32/34633_2.png) [@Ronni](https://community.homey.app/u/Ronni)\
**Post date:** [December 30, 2022, 11:59am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/396 "2022-12-30T11:59:49Z")

</div>

Thank you very much for the explanation! It’s not a big deal, and I agree, that it’s overkill to implement the entire Homey API just for that.  
Maybe you could implement timer names in the Chronograph config, but that’s a different story, and propably a big rewrite of the entire app!

---

<div class="post-metadata">

**Author:** ![GibStorm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gibstorm/32/48274_2.png) [@GibStorm](https://community.homey.app/u/GibStorm)\
**Post date:** [January 4, 2023, 3:42pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/397 "2023-01-04T15:42:35Z")

</div>

I love the app. Just wish I could somehow grab the time state from a counter and, for example, put it in a variable or send it in a notification.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 5, 2023, 3:56pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/398 "2023-01-05T15:56:25Z")

</div>

Hi @GibStorm,

Not exactly what you were looking for, but it triggered me to create a script/flow/device for that purpose.  
You can find importable flows for a [Timer](https://community.homey.app/t/share-your-device-advanced-virtual-devices-from-device-capabilities/68676/57), and for a [Stopwatch](https://community.homey.app/t/share-your-device-advanced-virtual-devices-from-device-capabilities/68676/58)

Flow example:

 ![Screenshot from 2023-01-05 16-27-21](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/0/40538c72e274d82df4879e1340642b9af193986a.png)

AVD device:  
 ![Screenshot from 2023-01-05 16-53-49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/1761c879de28c810d679811e427b3107e3baf6c6.png)

Script (_use it with Homeyscript flow card “Run code with argument, and return number-tag”_):

```auto
// Get value (milliSeconds) of a running timer; Argument = timer name.

var timerName = (args[0]);

	let app = await Homey.apps.getApp({id:'nl.fellownet.chronograph'});
	app.apiGet('/timers/').then(result => {
		let timers = JSON.parse(result);
		timers.forEach(timer => {
        if ( timer.name == timerName ) {
		      app.apiGet('/timers/' + timer.name);
					// create/update tag [timername]_duration
          global.set(timer.name + "_duration", timer.duration);
          //// just a check for timer name:
          //console.log("TimerName: " + timer.name + " - Duration: " + timer.duration);
        }
  	  });
	});	
const timerDuration = global.get(timerName + "_duration");
return Number(timerDuration); 

```

---

<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:** [January 5, 2023, 8:41pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/399 "2023-01-05T20:41:11Z")

</div>

I’ll also work on a flowcard with token.  
Can you make a feature request at the support link in the app store? Thanks!

---

<div class="post-metadata">

**Author:** ![JB2K](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jb2k/32/134070_2.png) [@JB2K](https://community.homey.app/u/JB2K)\
**Post date:** [January 8, 2023, 8:15pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/400 "2023-01-08T20:15:53Z")

</div>

I optimised your code with chatgpt 😂😂

> // Get value (milliSeconds) of a running timer; Argument = timer name.
> 
> async function getTimerDuration(timerName) {  
> let app = await Homey.apps.getApp({id: ‘nl.fellownet.chronograph’});  
> let timers = JSON.parse(await app.apiGet(‘/timers/’));
> 
> for (const timer of timers) {  
> if (timer.name === timerName) {  
> global.set(timerName + ‘\_duration’, timer.duration);  
> return Number(timer.duration);  
> }  
> }  
> }
> 
> const timerDuration = getTimerDuration(args[0]);  
> return timerDuration;

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 8, 2023, 10:14pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/401 "2023-01-08T22:14:10Z")

</div>

😜 I hate that kind of bots 😆  
I’m at coding level: “damn, it works after just one weekend, now don’t touch it” 😅

---

<div class="post-metadata">

**Author:** ![Glenn\_Dijkstra](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/glenn_dijkstra/32/17251_2.png) [@Glenn\_Dijkstra](https://community.homey.app/u/Glenn_Dijkstra)\
**Post date:** [January 15, 2023, 8:45am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/402 "2023-01-15T08:45:56Z")

</div>

hi, sorry for the late response.  
I have it like this. The red arrow starts the stopwatch.  
The green one does not activate.

 ![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/5/8509c25c4c5eb1fe992c245839a8454991ca813c.png)

I just use normal delays in the meanwhile, but it would be nice if it could work the normal way.

Ohhh and I checked. The stopwatch runs as it should so the problem really is with the green arrow.

---

<div class="post-metadata">

**Author:** ![Jux2k2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jux2k2/32/68336_2.png) [@Jux2k2](https://community.homey.app/u/Jux2k2)\
**Post date:** [January 22, 2023, 9:49pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/403 "2023-01-22T21:49:22Z")

</div>

Hei  
Not really sure what I am doing wrong. I have a few flows that should start stopwatches but nothing is happening.

When I “install the devices” and click on one of these stopwatches its like I cant start them. I would press the “start/stop” button and they d just blink but nothing would be started. Really weird.

I have no flow that would prevent any stopwatch from starting… I have tried to restart the app a few times without any effect. Help is appreciated 🙂 thx

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 22, 2023, 9:56pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/404 "2023-01-22T21:56:43Z")

</div>

No need for installing devices for using timers/stopwatches/transitions

> [@Arie\_J\_Godschalk](#):
>
> Create timers and stopwatches directly from flow cards, no need for a prior configuration,

Just make sure you use unique names for your timers/stopwatches/transitions

---

<div class="post-metadata">

**Author:** ![Jux2k2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jux2k2/32/68336_2.png) [@Jux2k2](https://community.homey.app/u/Jux2k2)\
**Post date:** [January 22, 2023, 10:15pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/405 "2023-01-22T22:15:55Z")

</div>

Yes I know, I have installed the devices afterwards only to check what was going wrong.  
Their names are unique.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [January 23, 2023, 6:19am UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/406 "2023-01-23T06:19:49Z")

</div>

Upload your flow for us to have a look at it.

---

<div class="post-metadata">

**Author:** ![Jux2k2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jux2k2/32/68336_2.png) [@Jux2k2](https://community.homey.app/u/Jux2k2)\
**Post date:** [January 23, 2023, 12:13pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/407 "2023-01-23T12:13:33Z")

</div>

![PS0](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/f/7f6472196af556dcb9307635a414c2eaadd4d506.png)  
 ![PS1](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/4/b4ca634218373e0704bb55ef8c8617c6d48aa111.png)  
 ![PS2](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/d/3de16f4f08a6a265d7d1210673efeb9d5eff860d.png)  
 ![PSend](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/8/78aeacd52ae1e3c651c650a5755ab914e1ed4b14.png)

I do get a notification in the timeline from PS\_Step\_0 but nothing related to stopwatches seems to happen thereafter.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [January 23, 2023, 12:40pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/408 "2023-01-23T12:40:03Z")

</div>

Have you looked in the Chronograph-app’s settings page to see if the stopwatches are running when expected?  
Is Elwof home and charging? Print something to the timeline (Simplelog is very nice for logging BTW) for all then-else to see what is going on.

I do not think PS\_Step\_2 will work. If I remember correctly it is not possible to have a dynamic time-check in the when-card.

---

<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:** [January 23, 2023, 12:41pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/409 "2023-01-23T12:41:45Z")

</div>

Ps step 2 will not work: the duration has reached cannot be given a tag/token.

---

<div class="post-metadata">

**Author:** ![Jux2k2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jux2k2/32/68336_2.png) [@Jux2k2](https://community.homey.app/u/Jux2k2)\
**Post date:** [January 23, 2023, 9:10pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/410 "2023-01-23T21:10:22Z")

</div>

Thanks all.  
The Tesla app wasnt providing reliable data about the car, so I have set a condition on the EV charger power instead.  
And yes the step 2++ flows did not work as I used a variable in the duration.

This now seems to work. Thanks!

---

<div class="post-metadata">

**Author:** ![Glenn\_Dijkstra](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/glenn_dijkstra/32/17251_2.png) [@Glenn\_Dijkstra](https://community.homey.app/u/Glenn_Dijkstra)\
**Post date:** [January 25, 2023, 10:01pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/411 "2023-01-25T22:01:39Z")

</div>

Hi Arie, any idea about my post yet?

---

<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:** [February 6, 2023, 12:53pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/413 "2023-02-06T12:53:56Z")

</div>

> [@Glenn\_Dijkstra](#):
>
> Hi Arie, any idea about my post yet?

Which one?

---

<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:** [February 6, 2023, 12:56pm UTC](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214/414 "2023-02-06T12:56:31Z")

</div>

## Now in Test:

New flowcards:

### Retrieve the (elapsed) duration of timers, stopwatches and transitions.

You will get Number tokens if applicable:

- Duration (ms)
- Duration (Seconds)
- Duration (Minutes)
- Duration (Hours)
- Elapsed (ms)
- Elapsed (Seconds)
- Elapsed (Minutes)
- Elapsed (Hours)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8d7d03930f59d28f301f3b8cd03577e4d977ba9d.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/e/6eadd3b2afaccd0028066fddb85015c53a4b7868.png)

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

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