# Start advanced flow when virtual switch turned on

**URL:** <https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527>\
**Category:** Questions & Help\
**Tags:** advancedflow\
**Created:** [November 23, 2023, 4:31pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527 "2023-11-23T16:31:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 23, 2023, 4:31pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/1 "2023-11-23T16:31:13Z")

</div>

Hi all, is there any way how to start advanced flow then virtual device switch is turned on?

I would like to have button when guests come to apartment, then i just turn on switch and it raises water temperature in water heater which is controlled via Sonoff tasmota TH320D via MQTT.  
I have advanced flows like this, and there is no option to set temperature when i choose AND or THEN.  
Or how to start theese flows periodically, but temp needs to be at first place…

 ![boiler](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/2/0266f3e781ca82bb7cc9b521a29a64044383ba13.png)

The main problem is, that the first box does not check temperature periodically…

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 23, 2023, 6:07pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/2 "2023-11-23T18:07:15Z")

</div>

When your guests arrive you turn on the virtual device. That is your trigger.  
You want the boiler turned on when the watertemperature is below 65 degrees. That is the condition,  
so:  
WHEN: virtual device is turned on  
AND: temperature is below 65 degrees  
THEN: turn on boiler

When your guests leave:

WHEN: virtual device is turned off  
AND temperature is above 55 degrees  
THEN: turn off boiler

Your flow will handle the boiler switch-on and -off during their presence or absence

---

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 23, 2023, 6:28pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/3 "2023-11-23T18:28:22Z")

</div>

That is the problem, i have no option to set temp in AND…

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 23, 2023, 7:16pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/4 "2023-11-23T19:16:59Z")

</div>

You have to use a logical AND-cart: ‘tag’ is smaller then 65. choose as tag the watertemperature of your boiler  
 ![Scherm­afbeelding 2023-11-23 om 20.20.49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/604b50645da0ab085d1ffac6baa1e84eeaa52c50.jpeg)

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 23, 2023, 9:00pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/5 "2023-11-23T21:00:26Z")

</div>

About your screenprint:  
If the watertemperature is greater then 70 degrees, you want the boiler to turn off? Not only when the virtual-device-card is on, but always?  
If the watertemperature is less then 45 degrees you always want the boiler to turn on?  
If that is true, you should remove the ‘Is turned on’-cards in the second and third line

---

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 23, 2023, 9:18pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/6 "2023-11-23T21:18:47Z")

</div>

It works! 🙂 and i can set first card to “Every 60 seconds start” 🙂 thank you! 🙂

---

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 23, 2023, 9:19pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/7 "2023-11-23T21:19:31Z")

</div>

No, it should work like this,  
Switch off - temp should be lower, 45-50 degrees  
Switch on - higher temp 🙂

 ![boiler2](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/0/c0f7e7bc426ce4789e306ecefa86672a62f666b5.png)

This is how it works like it should 🙂

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 23, 2023, 9:40pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/8 "2023-11-23T21:40:11Z")

</div>

The third line: when the watertemperature is below 45 degress AND the switch is on the boiler will not turn on.  
(edit 23:30 this is not correct: line 1 will turn the boiler on)

The second line: when the watertemperature is above 68 degrees AND the switch is off the boiler will not turn off.  
(edit 23:30 this is not correct: line 4 will turn the boiler off)

---

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 23, 2023, 9:44pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/9 "2023-11-23T21:44:13Z")

</div>

Both, second and third work, i have tested it short while ago when all went to bathroom 🙂  
When the switch is on, only first and second line are working, because of 3rd and 4th card…

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 24, 2023, 8:03pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/10 "2023-11-24T20:03:42Z")

</div>

4 triggers every 30 seconds may influence the responstime of other flows.

this is how I would do it:

 ![Scherm­afbeelding 2023-11-24 om 20.54.50](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/f/bff93dca74712579dbefa8e3fa2cb87e5c3da7ea.jpeg)

---

<div class="post-metadata">

**Author:** ![vikino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vikino/32/90198_2.png) [@vikino](https://community.homey.app/u/vikino)\
**Post date:** [November 24, 2023, 8:41pm UTC](https://community.homey.app/t/start-advanced-flow-when-virtual-switch-turned-on/95527/11 "2023-11-24T20:41:53Z")

</div>

This looks good, but, for this i need to re-wire boiler from circuit breaker and contactor.  
Because, we have two tarrif electricity, “cheaper” when boiler heats up water and “more expensive” when it gets remotely disconnected from power grid. And in this time also tasmota is powered off, and if in this time, when tasmota is off, temp goes less than “60” degrees, then becomes online again, it wont turn on boiler, because it does not check temp, thats why im checking temp on all 4 rows, but sure, i can do it by 5 minutes 🙂
