# Easiest flow for button held dim

**URL:** <https://community.homey.app/t/easiest-flow-for-button-held-dim/10727>\
**Category:** Questions & Help\
**Created:** [March 17, 2019, 7:33pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727 "2019-03-17T19:33:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kjettern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kjettern/32/9184_2.png) [@Kjettern](https://community.homey.app/u/Kjettern)\
**Post date:** [March 17, 2019, 7:33pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/1 "2019-03-17T19:33:05Z")

</div>

Hello.  
I have a button that have 3 triggers.  
Button pressed, button held and button released.  
I want to create a flow that will dim my light with 10% intervals as long as the button is pressed and stop dimming when I release the button.  
What’s the easiest way of doing this?  
Thanks

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [March 19, 2019, 11:09am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/2 "2019-03-19T11:09:57Z")

</div>

Hi @Kjettern

I don’t think this is (very easily) possible.

Your button will probably only send one signal after x seconds that the button was ‘held’.  
I think it is highly unlikely that the button will send a continuous signal while holding the button.

Off course it will also send a signal ‘button released’.

If you are able to correctly count the seconds between ‘button held’ and ‘button released’ you might be able to figure out how to dim the light accordingly, but in my (at this moment, still) really limited knowledge about Homey Flows, you need to create a logic flow that adds a value every second to a logic value. Then use that value to calculate the dim factor. And let those flows run in a loop continuously until the ‘button released’ has been received.

All in all, this could be quite a thing to build, but nice if you achieve this.

Let me know if you where able to do it. 😉

---

<div class="post-metadata">

**Author:** ![viix](https://avatars.discourse-cdn.com/v4/letter/v/4af34b/32.png) [@viix](https://community.homey.app/u/viix)\
**Post date:** [March 19, 2019, 11:28am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/3 "2019-03-19T11:28:54Z")

</div>

For the button held, use a dim over x duration card if the bulb supports it or use the transitions app to dim.  
On button release flow, Use the global tag of that bulb’s dim level and set that dim level on that bulb as the action?

[Transitions app](https://apps.athom.com/app/name.klep.transitions)

---

<div class="post-metadata">

**Author:** ![Bob\_Mijwaard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bob_mijwaard/32/11736_2.png) [@Bob\_Mijwaard](https://community.homey.app/u/Bob_Mijwaard)\
**Post date:** [March 19, 2019, 8:09pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/4 "2019-03-19T20:09:47Z")

</div>

I saw such a flow a couple of month ago, but can’t find it back.

---

<div class="post-metadata">

**Author:** ![Tasz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tasz/32/17196_2.png) [@Tasz](https://community.homey.app/u/Tasz)\
**Post date:** [March 19, 2019, 9:04pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/5 "2019-03-19T21:04:15Z")

</div>

My Fibaro dimmer have a card function that is called “start brightness transition” and “stop brightness transition”  
you can then choose between up or down and the transition time

But my Ikea bulbs do not have this function,

I think that this may depend on whether this function is supported by the device or app

---

<div class="post-metadata">

**Author:** ![pandaym](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pandaym/32/9126_2.png) [@pandaym](https://community.homey.app/u/pandaym)\
**Post date:** [April 17, 2019, 10:34pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/6 "2019-04-17T22:34:06Z")

</div>

You figured this out? I am having trouble with this too.

---

<div class="post-metadata">

**Author:** ![Kjettern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kjettern/32/9184_2.png) [@Kjettern](https://community.homey.app/u/Kjettern)\
**Post date:** [April 18, 2019, 7:41am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/7 "2019-04-18T07:41:22Z")

</div>

Well I haven’t tried it yet, but I figured out something else. Maybe I’m deciding to go with button held for light on / off and then button pushed for dimming. You can create a flow that will dim your light 20% every time you press down until its only 20% left. The same with button up, 20% increase until its 100%.

Flow will be something like: If button pressed, and variable xxx isn’t 100, then increase variable xxx 20. Same for decrease except with and variable xxx not 20.

---

<div class="post-metadata">

**Author:** ![pandaym](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pandaym/32/9126_2.png) [@pandaym](https://community.homey.app/u/pandaym)\
**Post date:** [April 18, 2019, 8:36am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/8 "2019-04-18T08:36:28Z")

</div>

That’s actually how I have it now, as I could not figure the real dimming flow out for hold out. I just have two buttons instead, so it was really easy to do it that way, because I did not need conditions for what way it dims 🙂

---

<div class="post-metadata">

**Author:** ![Matthieu\_Oostveen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_oostveen/32/8304_2.png) [@Matthieu\_Oostveen](https://community.homey.app/u/Matthieu_Oostveen)\
**Post date:** [April 18, 2019, 10:03am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/9 "2019-04-18T10:03:23Z")

</div>

I have actually been working on this for a bit of late, so maybe what I have done can be of use for you.

I am using a Xiaomi button that has the long-press function and an IKEA Tradfri bulb, I am also using the transitions app that @viix suggested.

On long-press, I check what the DimUP boolean is saying (true = dim UP), if it is true I start a transition from the current dimlevel of the bulb to 1 in 5 seconds with 0.5s steps. If it is false, I go to 0.  
At the same time I tell the bulb to start dimming to 100% (or 0%) in 5 seconds as well.

 ![10](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/4/4565e03a8873d0c537636f11da719b01f577ec9b.jpeg)

This only dims to full or off, so to stop the dimming something needs to happen when the button is released. Which is my next flow; I stop the transition and toggle the up/down so next time I dim the other way. (Forget the paper trail card, I need to tak ethat out still)

 ![40](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/f/f575d373e3c87d60a815e3416f0199b6a1147208.jpeg)

Now for the actual setting of the final dim-level, I created a third flow that takes the value that is in the transition and set it as the dim-level, only this time I dim to that immediately;

 ![59](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/1/1870ab6e8ffef1c2d665d80c386cd5b99d04765d.png)

Initially, I had another flow to change the dim-level immediately every time the transition value changed but that meant that the dimming level would “jump” to the next value which I didn’t like; this way it is a lot smoother and there is only a small “jump” when you release the button.

Hope that helps,  
Matthieu

---

<div class="post-metadata">

**Author:** ![Rob\_Verboven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rob_verboven/32/9879_2.png) [@Rob\_Verboven](https://community.homey.app/u/Rob_Verboven)\
**Post date:** [April 28, 2019, 2:21pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/10 "2019-04-28T14:21:40Z")

</div>

Hi @Matthieu_Oostveen, like @Kjettern this is also something i am looking to do and your setup looks promissing and capble to do with my setup (Remotec Scene master & Hue lights).

However your explantion is still a bit too complicated for me. I fully understand the idea, but do not understand all steps you did, so is it maybe possible to break it down a bit more?

---

<div class="post-metadata">

**Author:** ![Rob\_Verboven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rob_verboven/32/9879_2.png) [@Rob\_Verboven](https://community.homey.app/u/Rob_Verboven)\
**Post date:** [April 28, 2019, 5:29pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/11 "2019-04-28T17:29:32Z")

</div>

Hi @Matthieu_Oostveen i tried to copy your screenshots.  
Something is happening indeed, but it is not flawless unfortuately.

---

<div class="post-metadata">

**Author:** ![Matthieu\_Oostveen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_oostveen/32/8304_2.png) [@Matthieu\_Oostveen](https://community.homey.app/u/Matthieu_Oostveen)\
**Post date:** [May 8, 2019, 7:06pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/12 "2019-05-08T19:06:39Z")

</div>

Hi @Rob_Verboven,

Flawless is always a challenge so in these cases I try to aim for acceptable instead 🙂

So what do you have now and what is still missing, maybe we can figure out how to make it a little better for you?

Cheers,  
Matthieu

---

<div class="post-metadata">

**Author:** ![LogicalShrapnel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/logicalshrapnel/32/9538_2.png) [@LogicalShrapnel](https://community.homey.app/u/LogicalShrapnel)\
**Post date:** [January 9, 2020, 5:40pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/14 "2020-01-09T17:40:31Z")

</div>

@Matthieu_Oostveen

I’m trying to duplicate what you suggest but can’t get it working. I have it set up and dimming down and then letting go works and it stops as expected, but going in the oposite direction it always goes to 100% regardless of when I let go of the button.

My flows:  
**LongPress**  
When  
Button1 scene activated Held down  
And  
DimVariable = Yes  
Then  
Start transition name DHU (CurrentDimLevel-100,5s,0.5s)  
Lamp1 Dim to 100% during 5s  
Else  
Start transition name DHD (CurrentDimLevel-0,5s,0.5s)  
Lamp1 Dim to 0% during 5s

**Release**  
When  
Button1 scene activated Released  
Then  
Stop Transition DHD  
Stop Transition DHU  
Flip DimVariable

**TransitionDownStopped**  
When  
Transition DHD stopped  
Then  
Dim Lamp1 to value

**TransitionUpStopped**  
When  
Transition DHU stopped  
Then  
Dim Lamp1 to value

Is this something you have experienced? Are my flows identical to yours?

---

<div class="post-metadata">

**Author:** ![Matthieu\_Oostveen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_oostveen/32/8304_2.png) [@Matthieu\_Oostveen](https://community.homey.app/u/Matthieu_Oostveen)\
**Post date:** [January 9, 2020, 8:06pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/15 "2020-01-09T20:06:13Z")

</div>

Hello @LogicalShrapnel

I have not worked on this for a long time, so not sure it all still works actually 🙂

However looking at your flows, there is one difference which seems to be significant;

> [@LogicalShrapnel](#):
>
> Start transition name DHU (CurrentDimLevel-100,5s,0.5s)

Here I have “CurrentDimLevel - 1”.

Cheers,  
Matthieu

---

<div class="post-metadata">

**Author:** ![LogicalShrapnel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/logicalshrapnel/32/9538_2.png) [@LogicalShrapnel](https://community.homey.app/u/LogicalShrapnel)\
**Post date:** [January 9, 2020, 9:36pm UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/16 "2020-01-09T21:36:18Z")

</div>

Thanks! I think I got confused by the apps suggestion of 0-100 instead of relying on the value form the lamp. It’s working perfectly now. Or at least as perfect as possible with the current limitations.

Btw, I threw together a quick flow to change the temperature on double click if you (or anyone else) is interested.

Create variable Color and set it to 0.3

When  
Scene activated Pressed 2x  
And  
Color is exactly 0.9  
Then  
Lamp1 Set a temperature 0%  
Set Color to 0.3  
Else  
Calculate color as {{color+0.3}}  
Set a temperature Color after 1 sec

I needed the 1 sec for some strange reason. Otherwise it failed when setting it to 0.9

---

<div class="post-metadata">

**Author:** ![Schnaaf](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/schnaaf/32/10894_2.png) [@Schnaaf](https://community.homey.app/u/Schnaaf)\
**Post date:** [September 19, 2021, 11:04am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/17 "2021-09-19T11:04:06Z")

</div>

@Matthieu_Oostveen it might be good to mention in your post that this flow will only work with a remote that supports the long press release event. This might save some of us some time. I have a IKEA Tradfri E1810 laying around. This model does not support the release event unfortunately. Making it impossible to implement this flow setup.

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [September 19, 2021, 11:12am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/18 "2021-09-19T11:12:37Z")

</div>

> [@Schnaaf](#):
>
> and Remotec Scene Masters laying around. Both of these models do not support the release event unfortunately

So this is not possible?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a446b3da0dc9e62a00663905a2cd8cee4df3361b.jpeg)

---

<div class="post-metadata">

**Author:** ![Schnaaf](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/schnaaf/32/10894_2.png) [@Schnaaf](https://community.homey.app/u/Schnaaf)\
**Post date:** [September 19, 2021, 11:14am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/19 "2021-09-19T11:14:09Z")

</div>

@Rocodamelshekima correct. See also [IKEA Tradfri Remote E1810 button release events missing?](https://community.homey.app/t/ikea-tradfri-remote-e1810-button-release-events-missing/51908)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [September 19, 2021, 11:15am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/20 "2021-09-19T11:15:20Z")

</div>

Ow. Was talking about scene master and screenie was just taken. Tested and working with the scene master.

---

<div class="post-metadata">

**Author:** ![Schnaaf](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/schnaaf/32/10894_2.png) [@Schnaaf](https://community.homey.app/u/Schnaaf)\
**Post date:** [September 19, 2021, 11:31am UTC](https://community.homey.app/t/easiest-flow-for-button-held-dim/10727/21 "2021-09-19T11:31:32Z")

</div>

@Rocodamelshekima I stand corrected. I missed that this had to be configured through the “scene activated” event. I have edited my my earlier post

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/f/1f276fe60352242810b93e68a7fe69fa9ac173ed.png)
