# Flow help needed with Ikea trådfri devices

**URL:** <https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371>\
**Category:** Questions & Help\
**Created:** [February 24, 2020, 7:11pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371 "2020-02-24T19:11:20Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 24, 2020, 7:11pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/1 "2020-02-24T19:11:20Z")

</div>

Hi, guys (and gals)

I have the following flow in my kitchen. As Homey doesn’t support my Ikea dimmer I wanted to make something that would do the job for a while. Everything seems to work fine (I use the notification to check the variable), but the Ikea lights don’t dim to the set value. Any ideas on what to do? It seems they just turn on, but don’t dim to the set value. They don’t even dim to the previous value (which would indicate some sort of delay somewhere), but always to the last used value.

I’ve also tried setting the device dim level directly, but with the same [lack of] result.

Bug? User fault?

 ![Screenshot_20200224-080040_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/2/c2e16ea567ae1ca22ca12bf076bf28e44437f38f.jpeg) ![Screenshot_20200224-080044_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/0/00e2b9e5d15c60dba28a0b977d5474e19f4af261.jpeg) ![Screenshot_20200224-080057_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/9/e9876450a3de861f962832449cb431d9db27a360.jpeg)

---

<div class="post-metadata">

**Author:** ![Morgan](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morgan/32/15416_2.png) [@Morgan](https://community.homey.app/u/Morgan)\
**Post date:** [February 24, 2020, 7:41pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/2 "2020-02-24T19:41:38Z")

</div>

“Dim to” is set in % so I think you need to use 1/100 in Logic.  
1% = 0.01  
50% = 0.5  
100% = 1

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 24, 2020, 9:06pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/3 "2020-02-24T21:06:24Z")

</div>

Thanks, that was it. HOWEVER, now there’s another problem.

I’ve tried “less than 1” (stopped one short), “less than 1.01” (went to 100%) and “not larger than 1” etc. Except for the first, this is what happens when I increment by 0.2.

- 20%, output “Led set to 0.2”
- 40%, output “Led set to 0.4”
- 60%, output “Led set to 0.6”
- 80%, output “Led set to 0.8”
- 100%, output “Led set to 1”
- Turned off, output “Led turned off (1.2)”
- Still turned off, output “Led set to 0”
- 20% etc etc

The first statement in the “else” clause is to set the variable to 0.

---

<div class="post-metadata">

**Author:** ![rzarajczyk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rzarajczyk/32/8447_2.png) [@rzarajczyk](https://community.homey.app/u/rzarajczyk)\
**Post date:** [February 25, 2020, 9:03am UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/4 "2020-02-25T09:03:15Z")

</div>

> Turned off, output “Led turned off (1.2)”

This is indeed strange. Could you attach exact flow which produced this output? I suppose the screenshot in the original post is outdated, and I’m pretty sure there are some cards which were not visible during taking a screenshot (maybe [https://flow.homey.app/](https://flow.homey.app/) would be easier to screenshot)

---

<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 25, 2020, 4:42pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/5 "2020-02-25T16:42:33Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/2/1259eea3e9e4045ba5502ddae104d0f1fafa0154.png)  
When you Set Dim to, you don’t have to Turn ON, this are two commands for ON at the same time, this could influence each other. Same for OFF, better remove:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fcab8885899d9384da117e85a7e1a30678d38c36.png)  
and use only:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/1/c126851aab17cb5304a527e37375d9ba78f4b87b.png)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 25, 2020, 7:27pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/6 "2020-02-25T19:27:18Z")

</div>

I did the turn on, then dim as a test. I’ll post the current flow tabs underneath.

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 25, 2020, 7:36pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/7 "2020-02-25T19:36:01Z")

</div>

Ok, so I’m checking my variable to see if it’s 1 or higher (which should trigger the ‘turn off’ clause). While it’s from 0.0 to 0.8, this should be true.

 ![Screenshot_20200225-202816_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/9/197fd5926d8e684b9810d23fa2bd7a548317768a.jpeg)

The expected result would be, if true the variable is incremented to 0.2-1.0, dimming is done and the variable is output. If false (the variable is already 1), the variable should be set to 0 and the lights turned off. The notification should then tell me that the variable is reset. Next click should be 0, in which the true clause is met again.

 ![Screenshot_20200225-202250_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/b/cba1a74985c021ff9681dcd46a4140587b80cb30.jpeg)

This is the output. Note that it’s turning off while the variable is 1, then the true clause is met but the variable doesn’t increment before the next round. It’s almost as if the increment is delayed somehow.

 ![Screenshot_20200225-203325_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/e/ee3edfb40b6f934fd5af62520f8ae26756d4af28.jpeg)

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 25, 2020, 7:36pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/8 "2020-02-25T19:36:58Z")

</div>

The expected output would be “Led turned off (0)” followed by “Led set to 0.2”. Or am I crazy?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 25, 2020, 8:04pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/9 "2020-02-25T20:04:51Z")

</div>

Multiple action cards in a flow are executed in parallel (all at the same time), while you’re assuming that they are executed sequentially (one after the other).

So while the action to increment the variable is started, the action to log the value of the variable is also started. And because the variable hasn’t been incremented yet, it will log the “previous” value.

---

<div class="post-metadata">

**Author:** ![rzarajczyk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rzarajczyk/32/8447_2.png) [@rzarajczyk](https://community.homey.app/u/rzarajczyk)\
**Post date:** [February 25, 2020, 8:10pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/10 "2020-02-25T20:10:18Z")

</div>

Please read this topic: [Concurrency in flows](https://community.homey.app/t/concurrency-in-flows/25944)

Generally you cannot assume flow cards will be executed in the order you defined them - if you want a sequence, add a delay between cards.

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 25, 2020, 8:54pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/11 "2020-02-25T20:54:46Z")

</div>

Ok, thanks. I wasn’t aware of that. Guess my inner programmer got the best of me 😉 Thanks, all! 🙂

---

<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 26, 2020, 2:43pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/12 "2020-02-26T14:43:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/b/8b3704aeaff440b4d9194120bfcd83d39d1f5faf.png)  
You can round the variable to 2 decimals with logic calculate:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/4/b47f0fa2f320e89d5ec8b9a9ce4ffe140ccdc625.png)  
a setting with more than 2 decimals does mostly not work.  
(use your own variable names 😉 )

---

<div class="post-metadata">

**Author:** ![Tiwas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tiwas/32/10066_2.png) [@Tiwas](https://community.homey.app/u/Tiwas)\
**Post date:** [February 26, 2020, 4:18pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/13 "2020-02-26T16:18:15Z")

</div>

Do you recommend using using Logic over Better Logic? Logic doesn’t seem to be able to get to my variables defined in BL…

---

<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 26, 2020, 4:41pm UTC](https://community.homey.app/t/flow-help-needed-with-ikea-tradfri-devices/26371/14 "2020-02-26T16:41:04Z")

</div>

**round((Set volume-0.01),2)** can be used in BetterLogic  
Personally don’t use BetterLogic because I don’t need it, so it saves another App.
