# Dim Level in Virtual Device via MQTT

**URL:** <https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555>\
**Category:** Questions & Help\
**Created:** [November 30, 2019, 11:11am UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555 "2019-11-30T11:11:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/markus_f/32/14910_2.png) [@Markus\_F](https://community.homey.app/u/Markus_F)\
**Post date:** [November 30, 2019, 11:11am UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/1 "2019-11-30T11:11:51Z")

</div>

Hi everyone,

I would like to query a dimming level via MQTT in a virtual device and of course also set it.

Can someone help me, who has ever done that this way? Maybe anyone can share his flows here. On/off via MQTT is pretty simple and works fine, but I don’t know how I should do this for the dim level. I think I need a logic to do this right?

How much flow do I need per Dim Level and how do I best build it?

As an example, let’s just take the topics:  
State: living room light / dim  
Set: living room light / dim / set

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [December 10, 2019, 4:37pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/2 "2019-12-10T16:37:13Z")

</div>

I heave read somewhare the u have to use the command dim/update. I’m struggling with té same question at this moment. When I’m home I gonna try this command.

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/markus_f/32/14910_2.png) [@Markus\_F](https://community.homey.app/u/Markus_F)\
**Post date:** [December 10, 2019, 7:23pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/3 "2019-12-10T19:23:34Z")

</div>

If you find a solution, it would be nice… I think it is very easy, but I have no Idea how I have to start with Flows 😅

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [December 10, 2019, 7:27pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/4 "2019-12-10T19:27:40Z")

</div>

dim/update won’t work here 🙈

---

<div class="post-metadata">

**Author:** ![PO\_Blomstrand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/po_blomstrand/32/12476_2.png) [@PO\_Blomstrand](https://community.homey.app/u/PO_Blomstrand)\
**Post date:** [December 10, 2019, 8:09pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/5 "2019-12-10T20:09:13Z")

</div>

dim/set works for me!

Edit: Sorry, I don’t know when dealing with a VD.

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [December 10, 2019, 8:14pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/6 "2019-12-10T20:14:50Z")

</div>

Can you tel me the complete command you send to homey?

This is what i send

homie/homey-topic/salontafel-3/dim/set

But the light won’t dim when i send a payload from a slider in node red

---

<div class="post-metadata">

**Author:** ![PO\_Blomstrand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/po_blomstrand/32/12476_2.png) [@PO\_Blomstrand](https://community.homey.app/u/PO_Blomstrand)\
**Post date:** [December 10, 2019, 8:16pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/7 "2019-12-10T20:16:21Z")

</div>

One example: homie/homey/sanglampor/dim/set

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [December 10, 2019, 8:21pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/8 "2019-12-10T20:21:55Z")

</div>

It works 😀

I was sending a value from 0-1 but i have to send a value from 1-100 🙈

---

<div class="post-metadata">

**Author:** ![PO\_Blomstrand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/po_blomstrand/32/12476_2.png) [@PO\_Blomstrand](https://community.homey.app/u/PO_Blomstrand)\
**Post date:** [December 10, 2019, 8:23pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/9 "2019-12-10T20:23:02Z")

</div>

Nice!!

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/markus_f/32/14910_2.png) [@Markus\_F](https://community.homey.app/u/Markus_F)\
**Post date:** [December 10, 2019, 9:10pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/10 "2019-12-10T21:10:33Z")

</div>

Can you share your flow here? 😅

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [December 10, 2019, 9:37pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/11 "2019-12-10T21:37:38Z")

</div>

the flow in node red is verry simple.

Couple a slider to an mqtt output node. Set the slide to en velue from 1-100 and in the mqtt node you enter te topic as i discribe "(but then whit you topic name and device name ofcourse 🤣 )

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/markus_f/32/14910_2.png) [@Markus\_F](https://community.homey.app/u/Markus_F)\
**Post date:** [December 10, 2019, 9:55pm UTC](https://community.homey.app/t/dim-level-in-virtual-device-via-mqtt/21555/12 "2019-12-10T21:55:25Z")

</div>

Than I have to upset nodered first 😅
