# Countdown and virtual devices

**URL:** <https://community.homey.app/t/countdown-and-virtual-devices/1908>\
**Category:** Apps\
**Tags:** virtual-device\
**Created:** [September 20, 2018, 5:08pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908 "2018-09-20T17:08:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andre/32/1004_2.png) [@Andre](https://community.homey.app/u/Andre)\
**Post date:** [September 20, 2018, 5:08pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/1 "2018-09-20T17:08:46Z")

</div>

The Countdown app and virtual devices are must have apps. They both work perfectly, and I use them in many flows. However I would also like a counter, which can trigger at different levels, an be shown with its value in the mobile app.  
I do not see any other app doing that…

---

<div class="post-metadata">

**Author:** ![Andre](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andre/32/1004_2.png) [@Andre](https://community.homey.app/u/Andre)\
**Post date:** [September 20, 2018, 5:48pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/3 "2018-09-20T17:48:14Z")

</div>

I use that for on/off States. With a normal counter which can be started, stopped and trigger I could not find. And showing values of counters in the app is the other which would give great opportunities.

---

<div class="post-metadata">

**Author:** ![CyberSponk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cybersponk/32/8334_2.png) [@CyberSponk](https://community.homey.app/u/CyberSponk)\
**Post date:** [September 20, 2018, 5:53pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/4 "2018-09-20T17:53:59Z")

</div>

Take a look at BetterLogic App: ([https://apps.athom.com/app/net.i-dev.betterlogic](https://apps.athom.com/app/net.i-dev.betterlogic)).

In the Background/Backend of Homey in the App create a Number-Variable, on Frontend (Devices) a Slider-Device with the created Number-Variable.

So you can Count/Discount in the Background and see the last Value of your “Counter” in Front of the created Device.

With the Sliding-Device you also can change the Variable if you e.g. on the Road.

Using this for e.g. Blinds and works perfekt.

---

<div class="post-metadata">

**Author:** ![Andre](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andre/32/1004_2.png) [@Andre](https://community.homey.app/u/Andre)\
**Post date:** [September 29, 2018, 7:56pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/5 "2018-09-29T19:56:36Z")

</div>

It looks like I want multiple things:

1. Visible counters on the frontend to easily see values of the counters
2. Instead of a countdown counter a simple counter which continues until I stop it.
3. Trigger a counter at different levels (this should be easy if tags can be used)

For the first two I have not seen an option.

---

<div class="post-metadata">

**Author:** ![Seraphim](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/seraphim/32/8879_2.png) [@Seraphim](https://community.homey.app/u/Seraphim)\
**Post date:** [September 30, 2018, 8:02am UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/6 "2018-09-30T08:02:08Z")

</div>

Hello Andre,

it’s not a perfect solution but you can try the following:

1. Visualisation of a counter  
There are three variables you can set for a virtual device, e.g. measure\_temperature. If you create a virtual thermostat or a virtual kettle you can create a flow, telling the device to write your counter to e.g. the temperature value of your virtual device. (If variable X changes/is set then “set a virtual sensor value” to X)

2. Counter instead of countdown  
There is a time function in within Homey. You could us “Every…” second/minute/etc) to increment your counter variable by 1/2/etc.  
Keep an eye on your average load, could be possible that your Homey get some problems if there are to many processes each an every second.

3. Trigger by counter  
As you already mentioned, now this should be easy. Either by a variable value or a change of your virtual device.

Other solution:  
Use the countdown app. If a device does something start a countdown and create different flows to do different things.  
E.g.:

1. If something happens then start a 180 seconds countdown
2. If countdown “timer value has changed” and countdown “is exact” X do something (there is no need to wait until 0)

You can also use the virtual device trick for this to visualise it: If timer value has changed and is exact X than “set a virtual sensor value”

Regards  
Andreas

---

<div class="post-metadata">

**Author:** ![seiko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/seiko/32/10963_2.png) [@seiko](https://community.homey.app/u/seiko)\
**Post date:** [September 30, 2018, 1:09pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/7 "2018-09-30T13:09:44Z")

</div>

Is it a solution for point 2 if you use the following flow?

If counter changed AND Value = 1 THEN restart Counter

This way you create a loop and you can stop the counter in any flow you want

---

<div class="post-metadata">

**Author:** ![Andre](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andre/32/1004_2.png) [@Andre](https://community.homey.app/u/Andre)\
**Post date:** [October 7, 2018, 5:09pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/8 "2018-10-07T17:09:25Z")

</div>

I would need another parameter then to keep track of the amount of times the counter is restarted.  
Looking at the functionality the flow editor gives this should in my opinion be by default available.

With #1 (visualisation of a counter) I would neeed a configurable number then to make a value visible.  
For #2 I am alss wurried that it takes to many flows and processes. This is one of the reasons I would like to make them vissible…

---

<div class="post-metadata">

**Author:** ![Homey2](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/homey2/32/37387_2.png) [@Homey2](https://community.homey.app/u/Homey2)\
**Post date:** [April 22, 2021, 4:45pm UTC](https://community.homey.app/t/countdown-and-virtual-devices/1908/9 "2021-04-22T16:45:50Z")

</div>

Late reply for those who read the above: have a look at Chronograph which allows to create a device with a timer/stopwatch/transition.
