# Flow using virtual device (mode) and sun sets (sun rises)

**URL:** <https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630>\
**Category:** Questions & Help\
**Created:** [February 18, 2022, 12:07pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630 "2022-02-18T12:07:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier1870](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/olivier1870/32/51700_2.png) [@olivier1870](https://community.homey.app/u/olivier1870)\
**Post date:** [February 18, 2022, 12:07pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/1 "2022-02-18T12:07:11Z")

</div>

Dear all,

I m trying to set up a flow which does something when my virtual device is ON, and when the sun sets!  
However it looks like the options change:

- When the sun sets only leaves the option “VD is turned ON”
- When the VD is “ON” only leaves the option “after sun set”

What bis the logic !??

Manythanks for your help

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [February 18, 2022, 1:52pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/2 "2022-02-18T13:52:12Z")

</div>

In the **When…** section only trigger cards are available. Trigger means status changes. Status changes are very short actions in time. E.g. something like “switched on”, the time changes from 10:00 to 10:01 (it’s less than a second), temperature changes from 14.2 to 14.3 °C, the sun sets (it’s handled like the time), a variable changes from Yes to No…

In the **And…** section only condition cards are available. Conditions are something like “is on” (not switched on!!!), it’s after sun set, it’s \< 14.2 °C, the music plays…

So the only way is:

**When…**  
– The sun sets  
**And…**  
– VD is ON  
**Then…**  
– whatever

I hope I was able to clarify the logic a bit.

---

<div class="post-metadata">

**Author:** ![olivier1870](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/olivier1870/32/51700_2.png) [@olivier1870](https://community.homey.app/u/olivier1870)\
**Post date:** [February 18, 2022, 2:21pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/3 "2022-02-18T14:21:42Z")

</div>

Many thanks for your reply. This is indeed what I anticipated. However, if I select “the sun sets” in the “when” section, I m left with “is turned ON” in the AND section. No way to select " IS ON"  
There must be a reason!

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [February 18, 2022, 3:05pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/4 "2022-02-18T15:05:54Z")

</div>

Maybe it’s a translation mistake. Could you share your flow please.

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [February 18, 2022, 4:27pm UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/5 "2022-02-18T16:27:01Z")

</div>

> [@olivier1870](#):
>
> I m left with “is turned ON” in the AND section.

You can use this in the AND section, for your purpose.

---

<div class="post-metadata">

**Author:** ![olivier1870](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/olivier1870/32/51700_2.png) [@olivier1870](https://community.homey.app/u/olivier1870)\
**Post date:** [February 19, 2022, 7:51am UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/6 "2022-02-19T07:51:31Z")

</div>

My flow is as follow:

I have created a virtual device called “Absence”, that can be turned ON/OFF Zwave button

What I m trying to implement, is a flow which turns a light ON when the sun sets, IF the “Absence” mode is ON.

In other words, I would like my flow to be:

WHEN: “The sun sets”  
AND: “Absence mode is ON”  
THEN: “Turn the light ON”

However, once “the sun sets” is selected, the “Absence mode is ON” is not available in the “AND section”. The only choice is “Is turned ON”, which I guess refers to a change of state (from OFF-\>ON)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/7/67da20d5986e268852f2e51c80376ed1f6ca68ed.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/4/243d7be8d2829cc958537c9b0b6d728345a16e59.png)

---

<div class="post-metadata">

**Author:** ![olivier1870](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/olivier1870/32/51700_2.png) [@olivier1870](https://community.homey.app/u/olivier1870)\
**Post date:** [February 19, 2022, 7:59am UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/7 "2022-02-19T07:59:47Z")

</div>

I have done a quick check -replacing “the sun sets” by a fixed time, looks like indeed “mode is turned ON” doesnt not does refer to a change of state but rather to its actual state (“is ON”)

many thanks to all

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [February 19, 2022, 9:32am UTC](https://community.homey.app/t/flow-using-virtual-device-mode-and-sun-sets-sun-rises/60630/8 "2022-02-19T09:32:58Z")

</div>

As I tried to explain, in the section **And…** (Und…) there are only condition cards (in your words: actual state) available.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/d/bd2c4b57748baf56a08a3b2b8604e1aa62bd3c06.png)  
Sorry, only in German language.

But it’s good that you understand it now.
