# Light, dimming, dashboard

**URL:** <https://discourse.nodered.org/t/light-dimming-dashboard/20544>\
**Category:** Dashboard\
**Created:** [18 January 2020 19:45 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544 "2020-01-18T19:45:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [18 January 2020 19:45 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/1 "2020-01-18T19:45:21Z")

</div>

Hello . I am new to red-node so still alot to learn.  
I am using all my z-wave on fibaro hc 2 and that is working god.  
I have now set my lights up, i am using switch, slide and a guage to se how many % the light is on. so when i use the slide all is ok. But if i use the switch to turn off the light the slide is still at the same position. added some pictures and the flow. Any have some good advices.

 ![flow1jpg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b805d63fadd8e2fcc2212c92fa5e45f709a98494.jpeg)  
 ![flo3jpg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58fedd97ff76a31be3cd58b9f6cbe3e81c1a7f52.jpeg)

[flows.json.txt](https://discourse.nodered.org/uploads/short-url/kmw56dslLTEls1jWLv2Jkk7XYas.txt) (2.0 KB)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 January 2020 20:02 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/2 "2020-01-18T20:02:38Z")

</div>

You need to:

- add a switch and a change node on the slider output that will output a true (or 1 perhaps) if the slider is \>xx% and false (or 0) if below yy%. That output will then need to be fed back to the input of the switch. You might chose something like 0% for xx and 1% for yy for example. You will probably want to put that logic into a sub-flow so that you can reuse the same process for each light.
- Do some similar process for the output of the switches so that if the switch goes on, you set the slider value to 100% and if it goes off, the slider value goes to 0%.

Now the difficulty is to stop the two different processes from interfering with each other. e.g. if the slider triggers the switch, you don't then want it changing the slider again. There are several ways to do that but I'll leave you to think of some ideas. 😉

---

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [19 January 2020 09:06 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/3 "2020-01-19T09:06:00Z")

</div>

Tanks. tried that , But dident get it to work. Think i need it in with a tespoon.

I have it like this.

server-node- switch  
^ - slide- changenode. Then changenode back to switch.  
or like this  
server-node-slide-switch. changenode. then changnode bac to switch.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 January 2020 09:57 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/4 "2020-01-19T09:57:11Z")

</div>

Maybe like this

```auto
[{"id":"139ccf82.c9432","type":"ui_switch","z":"846d7832.3348c8","name":"","label":"switch","tooltip":"","group":"29422079.db4db","order":2,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"100","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":180,"y":1380,"wires":[["1eea49e4.cc5be6"]]},{"id":"1eea49e4.cc5be6","type":"ui_slider","z":"846d7832.3348c8","name":"","label":"slider","tooltip":"","group":"29422079.db4db","order":1,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","min":0,"max":"100","step":1,"x":330,"y":1380,"wires":[["54f5b2b3.b16f1c","6bac8cb8.78e7e4"]]},{"id":"54f5b2b3.b16f1c","type":"ui_gauge","z":"846d7832.3348c8","name":"","group":"29422079.db4db","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":550,"y":1380,"wires":[]},{"id":"6bac8cb8.78e7e4","type":"switch","z":"846d7832.3348c8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":170,"y":1520,"wires":[["139ccf82.c9432"],["3492729d.ffd83e"]]},{"id":"3492729d.ffd83e","type":"change","z":"846d7832.3348c8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1520,"wires":[["139ccf82.c9432"]]},{"id":"29422079.db4db","type":"ui_group","z":"","name":"Default","tab":"4e7a1ada.29ed94","disp":true,"width":"6","collapse":false},{"id":"4e7a1ada.29ed94","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 January 2020 10:49 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/5 "2020-01-19T10:49:01Z")

</div>

When you try and it doesn't work, it is best to share the flow (and pictures of it) so that we can help you understand what is wrong.

---

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [20 January 2020 17:57 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/6 "2020-01-20T17:57:01Z")

</div>

thanx. Got that working. But if i use the fibaro app to turn off/on the light nodered dosent change the status. But if i use Nodered to turn off/on the fibaro app shows status changed

---

<div class="post-metadata">

**Author:** ![oddmn](https://avatars.discourse-cdn.com/v4/letter/o/54ee81/32.png) [@oddmn](https://discourse.nodered.org/u/oddmn)\
**Post date:** [25 January 2020 10:55 UTC](https://discourse.nodered.org/t/light-dimming-dashboard/20544/7 "2020-01-25T10:55:37Z")

</div>

Hello. I am doing somthing wrong here, if i use my hc2 to turn of lights, Node red dont adjust settings after that, so if i turn off lights they are still on in node red.  
upploading flow.

[flows (2).json](https://discourse.nodered.org/uploads/short-url/zidAWGahGeFhMTUdYOUSHdKjP1z.json) (11.4 KB)
