# Need examples for dashboards

**URL:** https://discourse.nodered.org/t/need-examples-for-dashboards/2791
**Category:** Dashboard
**Created:** [3 September 2018 05:00 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791 "2018-09-03T05:00:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aihysp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aihysp/32/2278_2.png) [@aihysp](https://discourse.nodered.org/u/aihysp)
#### Post date: [3 September 2018 05:00 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791/1 "2018-09-03T05:00:21Z")

</div>

Hi i want to design a dashboard in Node for IOT(Home use)

can anyone give me some examples for some slick design and code  
i don't see any examples online but youtube videos

i am have switches that will go 1/0 , ON/OFF , and some that are just on  
no dimmers

thanks!

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 September 2018 07:38 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791/2 "2018-09-03T07:38:27Z")

</div>

Is it just the UI design that you want ideas on?

---

<div class="post-metadata">

### Author: ![aihysp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aihysp/32/2278_2.png) [@aihysp](https://discourse.nodered.org/u/aihysp)
#### Post date: [3 September 2018 11:32 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791/3 "2018-09-03T11:32:45Z")

</div>

if you can give me also cool coding ideas

like how to coonect a number of lamps to one switch and that sort of stuff  
or timres on UI

all this is cool 🙂  
thanks!

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 September 2018 12:30 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791/4 "2018-09-03T12:30:09Z")

</div>

You are unlikely to get much help just asking general questions about how to code stuff, so best to ask spcific questions.  
As to ask how to control a number of lights from one switch then just wire them all to the same pin.  
I have little idea what you mean by timeres on the UI. Do you mean time resolution? Or are you asking about timers. If timers then again you need to say what you want to see on the UI and what you want the timer to do.

---

<div class="post-metadata">

### Author: ![murraybrandon](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/murraybrandon/32/26015_2.png) [@murraybrandon](https://discourse.nodered.org/u/murraybrandon)
#### Post date: [20 July 2020 04:13 UTC](https://discourse.nodered.org/t/need-examples-for-dashboards/2791/5 "2020-07-20T04:13:29Z")

</div>

Here is an example of what you can do with the basic dashboard components, complete with animated icons when the appliances are moving.

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1c74768e271a97aa5b03849cb5164a886e7bd44.png)

For example:

```auto
[{"id":"225f531a.adf3ac","type":"ui_switch","z":"c35bb098.5d79b","name":"Washer Washing?","label":"Washer Current Action","tooltip":"","group":"b6ded3e3.ee1a8","order":2,"width":"6","height":"1","passthru":false,"decouple":"true","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-modx fa-spin","oncolor":"blue","offvalue":"false","offvalueType":"bool","officon":"clear","offcolor":"red","x":890,"y":1300,"wires":[[]],"info":"wi-wu-rain"},{"id":"b418a3a.55a926","type":"change","z":"c35bb098.5d79b","name":"WASHER_WASHING?","rules":[{"t":"set","p":"payload","pt":"msg","to":"WASHER_WASHING","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1300,"wires":[["225f531a.adf3ac"]]},{"id":"91e98b72.5ca428","type":"ui_switch","z":"c35bb098.5d79b","name":"Washer On?","label":"Washer Switch","tooltip":"","group":"b6ded3e3.ee1a8","order":1,"width":"6","height":"1","passthru":false,"decouple":"true","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"flash_on","oncolor":"green","offvalue":"false","offvalueType":"bool","officon":"flash_off","offcolor":"red","x":870,"y":1260,"wires":[[]]},{"id":"e88040e4.67997","type":"change","z":"c35bb098.5d79b","name":"WASHER_SWITCH_ON?","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":1260,"wires":[["91e98b72.5ca428"]]},{"id":"72133dbe.4e7c84","type":"ui_text","z":"c35bb098.5d79b","group":"b6ded3e3.ee1a8","order":3,"width":"6","height":"1","name":"Washer Watts","label":"Washer Watts","format":"{{msg.payload.get_realtime.power_watts}}","layout":"row-spread","x":880,"y":1340,"wires":[]},{"id":"fdc591df.37ad8","type":"function","z":"c35bb098.5d79b","name":"Calculate power_watts","func":"msg.payload.get_realtime.power_watts = Math.floor(msg.payload.get_realtime.power_mw / 1000);\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":1340,"wires":[["72133dbe.4e7c84"]]},{"id":"83b7dbd2.31ea48","type":"comment","z":"c35bb098.5d79b","name":"Washer Dashboard","info":"","x":650,"y":1220,"wires":[]},{"id":"1b910e4d.f191c2","type":"function","z":"c35bb098.5d79b","name":"Calculate how long since washing started","func":"var washerStartTime = global.get(\"WASHER_START_TIME\") || msg.payload;\nvar minutesDiff = (msg.payload - washerStartTime) / 60000;\nmsg.payload = Math.floor(minutesDiff);\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":1380,"wires":[["621f4cf7.2fa9c4"]]},{"id":"215a0df5.fb6262","type":"switch","z":"c35bb098.5d79b","name":"WASHER_WASHING?","property":"WASHER_WASHING","propertyType":"global","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":660,"y":1380,"wires":[["1b910e4d.f191c2"],["883f3074.4a777"]]},{"id":"883f3074.4a777","type":"change","z":"c35bb098.5d79b","name":"payload=100","rules":[{"t":"set","p":"payload","pt":"msg","to":"100","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":1420,"wires":[["621f4cf7.2fa9c4"]]},{"id":"621f4cf7.2fa9c4","type":"ui_gauge","z":"c35bb098.5d79b","name":"Washer Progress","group":"b6ded3e3.ee1a8","order":4,"width":"6","height":"3","gtype":"donut","title":"","label":"Washer Mins","format":"{{value}}","min":0,"max":"100","colors":["#00ff00","#00ff00","#00ff00"],"seg1":"","seg2":"","x":1310,"y":1420,"wires":[]},{"id":"b6ded3e3.ee1a8","type":"ui_group","z":"","name":"Laundry","tab":"cf3c7e32.8cfb1","order":4,"disp":true,"width":"6","collapse":false},{"id":"cf3c7e32.8cfb1","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

Happy to answer questions on any of the parts.

I have been using some global variables (anything in upper case in my flows is a global variable) to keep system wide totals that need to persist between reboots of Node Red.
