# How should it be done with a flow on and off with the same button

**URL:** <https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429>\
**Category:** Flows\
**Created:** [August 31, 2023, 2:34am UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429 "2023-08-31T02:34:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dunker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dunker/32/77765_2.png) [@Dunker](https://community.homey.app/u/Dunker)\
**Post date:** [August 31, 2023, 2:34am UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429/1 "2023-08-31T02:34:49Z")

</div>

Hi

Ive got a shelly i4 connected to a wallswitch .  
And i want to use the shelly i4 switch 1 to control : If button is pressed turn on tv that is connected with a smartplug aswell .

But then i want to use it otherway around if i press it then it should turn it off ?  
Any guide how to solve this ?

---

<div class="post-metadata">

**Author:** ![Cuprum](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cuprum/32/41409_2.png) [@Cuprum](https://community.homey.app/u/Cuprum)\
**Post date:** [August 31, 2023, 6:02am UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429/2 "2023-08-31T06:02:18Z")

</div>

Hoi!  
You can use some such kind of logic  
WHEN button pressed  
IF smartplug is ON  
switch smartplug OFF  
ELSE  
switch smartplug ON  
ENDIF

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [August 31, 2023, 8:06am UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429/3 "2023-08-31T08:06:01Z")

</div>

![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/9/69e2cbf35b8857b2c809b47d79f00132532eb71c.jpeg)

---

<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:** [September 2, 2023, 8:00pm UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429/4 "2023-09-02T20:00:28Z")

</div>

The toggle card is available for that:

 ![Screenshot_20230902-215843_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/c/ec43028dbd2e0192341259332c8663b4c2c7974d.jpeg)

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [September 2, 2023, 8:08pm UTC](https://community.homey.app/t/how-should-it-be-done-with-a-flow-on-and-off-with-the-same-button/88429/5 "2023-09-02T20:08:16Z")

</div>

And when there is no Toggle Card for that device:

> Between Turn Off and Turn On is an ---- Else ----  
> I have seen that missing in Shared Flows as Bug reported.

Visualized what @Cuprum wrote.
