# 1 Computer, 2 Monitors, 1 Static Dashboard, 4 Rotating Dashboards

**URL:** <https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784>\
**Category:** General\
**Created:** [6 December 2021 17:21 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784 "2021-12-06T17:21:10Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [6 December 2021 17:21 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/1 "2021-12-06T17:21:10Z")

</div>

I saw a previous post on how to rotate screens with a control ui, which is great, but I'm looking at doing the following.

I have 1 PC feeding two monitors.

I have one main Node Red tab called Dashboard that is my main dashboard.

I have 4 other Node Red tabs (part of the same project) that I would like to rotate through on the 2nd screen (probably in a 2nd browser).

Anyway to do this in the current dashboard node?

Thanks  
Kyle

---

<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:** [6 December 2021 22:02 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/2 "2021-12-06T22:02:17Z")

</div>

I don't think you can do this with Dashboard since it is really a single user-system. I'm fairly sure that if you rotate the tabs on one browser window, it will rotate the other as well.

---

<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:** [6 December 2021 23:18 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/3 "2021-12-06T23:18:04Z")

</div>

As long as the msg includes the sessionid of the other browser session, the control commands should only go to that session

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [6 December 2021 23:32 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/4 "2021-12-06T23:32:17Z")

</div>

What would that msg look like to push to the control\_ui?

I'm assuming I could bookmark the node red server with the same sessionID's so they would be static for that tab in Chrome?

---

<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:** [7 December 2021 11:01 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/5 "2021-12-07T11:01:47Z")

</div>

well no - the session is created every time the browser connects and will change every time you reload the page - but will then stay. So you will need to capture it when it connects the first time (from the ui-control node) and then ensure you add it to every message you send to the ui-control node. If you add a debug node set to show complete message you should be able to see what I mean.

---

<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:** [7 December 2021 14:05 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/6 "2021-12-07T14:05:02Z")

</div>

> [@dceejay](#):
>
> will change every time you reload the page - but will then stay

Worth noting that it _might_ not be that stable if using from a mobile device or a device that the extreme of your Wi-Fi connection. The id will change if the connection is lost and reformed as well as on a page load.

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [9 December 2021 19:48 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/7 "2021-12-09T19:48:28Z")

</div>

A few questions.

I'm seeing this as my debug out of the control node.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f58857147f6ef2350e73d5a32e3a33e08b4727df.png)

My session ID in my browser is :

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52f9a24be955eff659dd26264f3ddadc5838be55.png)

It's not the same. Am I missing something?

I'm having trouble figuring out how to grab the socketid automatically from a tab and sticking it into the socketid payload.....but first I need to figure out why these ID's are not the same.

Kyle

---

<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:** [9 December 2021 21:28 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/8 "2021-12-09T21:28:40Z")

</div>

> [@aa0z](#):
>
> Am I missing something?

Another browser tab 😉

Every browser tab has a different socketid and every time you reload a tab, the socketid will change.

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [9 December 2021 21:49 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/9 "2021-12-09T21:49:37Z")

</div>

That's what I thought. Closed down Chrome on every computer I had....no luck. Still a different socketID number.

---

<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:** [9 December 2021 23:02 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/10 "2021-12-09T23:02:16Z")

</div>

So check out what device has the ip of .100

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [9 December 2021 23:29 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/11 "2021-12-09T23:29:54Z")

</div>

Yep, that's the computer with no chrome tabs open.

This doesn't make any sense.

---

<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:** [10 December 2021 20:05 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/12 "2021-12-10T20:05:23Z")

</div>

Have you checked the task manager to make sure you don't have a hidden connection? If not, maybe try restarting node-red to get a fresh session.

To dig deeper into what sockets are open, you would probably need to restart node-red in debug mode so that you can dig into the objects.

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [10 December 2021 20:23 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/13 "2021-12-10T20:23:08Z")

</div>

That's a good idea.

Any idea how I can grab the session ID from the Chrome tab automatically and insert that into the payload? I guess I could put an input and have the end user manually insert it so it rotates.

---

<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:** [10 December 2021 20:31 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/14 "2021-12-10T20:31:22Z")

</div>

Open the dashboard page, then open the browser devtools and reload the dashboard. Use the network page and find the line that has a status of 101.

Click on that line and look at the headers. I think that the id you want is in the cookie `io=........`

---

<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:** [10 December 2021 21:17 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/15 "2021-12-10T21:17:16Z")

</div>

It is in the msg sent by the ui-control node whenever a browser connects

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [11 December 2021 20:13 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/16 "2021-12-11T20:13:51Z")

</div>

Ok, thanks to those who have responded and gave some mentoring. I feel like I've made some progress, but again stumped so I've included all the documentation to help troubleshoot. I still can't get my session to rotate tabs.

Below is the flow (with code)

This flow gets the socketID and IP from the tab and then a user inputs this into dashboard user form to ensure which browser tab the user wants to rotate.

 ![flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8c7064a60cb9fc7217f4e5c1b1862f5b57e647c.png)

Dashboard group. After the input, a popup text box shows what was entered and it stores the socketid and socketip in a global variable.

![rotating display](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/1129d378d93dc0bbda0fec355f58a8471584effd.png)

I've ensured the socketid is the same and correct. This is when the tab connects and changes to the "Configuration & Resets" tab which the above dashboard is on.

![GetUIControl](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0f7dde5f67d8b80996270b8c37d473cdd4c9e3d.png)

from the developer network debug. Verified the socketid is correct.

 ![network trace](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9f435ecdbe0b25fe58f5549ed934db107cd7d35.png)

at 20 seconds past the min rotate to tab 1, 40 seconds rotate to tab 2, 0 seconds rotate to tab 3. Here is my function code.

 ![rotate function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a316be5bc9c59b3cc27ad9c930adba59b907681a.png)

debug out of the function which I'm pushing into the control\_UI. All the objects look correct to me. I added the seconds to ensure it was firing at the right time interval.

![after function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc5a4af34045605a80e6a14b63474848e912b579.png)

Only issue I see I have is I'm not getting any debug out of the After Rotate UI Control debug node, well that and it's not rotating.

Kyle

```auto
[{"id":"5c4dd14a7c2c8a1e","type":"ui_ui_control","z":"204548a488401a1b","name":"Get IU Control","events":"all","x":1260,"y":1200,"wires":[["3e32507cf496c14e","bee1f8812d8d8760","2743e8dfd93fb7c8"]]},{"id":"e21f3e0591833840","type":"function","z":"204548a488401a1b","name":"Rotate tabs based on seconds","func":"let currentTime = new Date();\nlet seconds = currentTime.getSeconds();\nlet socketid = global.get('socketid');\nlet socketip = global.get('socketip');\n\nif (seconds == 20)\n{\n return {\"payload\":\"change\",\"tab\":1, \"name\":\"Radio Info\", \"socketid\":socketid, \"socketip\":socketip, \"seconds\":seconds};\n}\n\nif (seconds == 40)\n{\n return {\"payload\":\"change\", \"tab\":2, \"name\":\"OP Competition\", \"socketid\":socketid, \"socketip\":socketip, \"seconds\":seconds};\n}\n\nif (seconds == 0)\n{\n return {\"payload\":\"change\", \"tab\":3, \"name\":\"Band Stats\", \"socketid\":socketid, \"socketip\":socketip, \"seconds\":seconds};\n}\n\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":1220,"wires":[["57273c6d705dbfce","aa4d1f3abac4a62f"]]},{"id":"57273c6d705dbfce","type":"debug","z":"204548a488401a1b","name":"After Function","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":1180,"wires":[]},{"id":"0979daa9c078c057","type":"ui_form","z":"204548a488401a1b","name":"","label":"Socket ID & IP","group":"0ae735dd5356d1e8","order":3,"width":8,"height":2,"options":[{"label":"Socket ID","value":"socketid","type":"text","required":true,"rows":null},{"label":"Machine IP","value":"socketip","type":"text","required":true,"rows":null}],"formValue":{"socketid":"","socketip":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":620,"y":1060,"wires":[["80b7b6186bcf121d","e0137d1a709aca80"]]},{"id":"80b7b6186bcf121d","type":"function","z":"204548a488401a1b","name":"Set Global Rotating Session ID","func":"let socketip = msg.payload.socketip\nlet socketid = msg.payload.socketid\nglobal.set(\"socketid\",socketid)\nglobal.set(\"socketip\",socketip)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":1060,"wires":[[]]},{"id":"87bbe35110f717a1","type":"ui_toast","z":"204548a488401a1b","position":"dialog","displayTime":"","highlight":"","sendall":false,"outputs":1,"ok":"OK","cancel":"Cancel","raw":false,"className":"","topic":"","name":"Show Socket ID","x":1080,"y":1100,"wires":[[]]},{"id":"e0137d1a709aca80","type":"function","z":"204548a488401a1b","name":"Set payload to printout","func":"socketid = msg.payload.socketid\nsocketip = msg.payload.socketip\n\nmsg.payload = \"socketid=\" + socketid + \" \" + \"IP=\" + socketip;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1100,"wires":[["87bbe35110f717a1"]]},{"id":"bee1f8812d8d8760","type":"ui_text","z":"204548a488401a1b","group":"0ae735dd5356d1e8","order":1,"width":8,"height":1,"name":"","label":"This Socket ID : ","format":"{{msg.socketid}}","layout":"row-spread","className":"","x":1480,"y":1200,"wires":[]},{"id":"320d94a84c4edd14","type":"inject","z":"204548a488401a1b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":150,"y":1220,"wires":[["e21f3e0591833840"]]},{"id":"3e32507cf496c14e","type":"debug","z":"204548a488401a1b","name":"Get UI Control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1480,"y":1160,"wires":[]},{"id":"2743e8dfd93fb7c8","type":"ui_text","z":"204548a488401a1b","group":"0ae735dd5356d1e8","order":2,"width":8,"height":1,"name":"","label":"This IP :","format":"{{msg.socketip}}","layout":"row-spread","className":"","x":1460,"y":1240,"wires":[]},{"id":"aa4d1f3abac4a62f","type":"ui_ui_control","z":"204548a488401a1b","name":"Rotate UI Control","events":"change","x":650,"y":1220,"wires":[["c473245f3df6387a"]]},{"id":"c473245f3df6387a","type":"debug","z":"204548a488401a1b","name":"After Rotate UI Control","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":1200,"wires":[]},{"id":"0ae735dd5356d1e8","type":"ui_group","name":"Rotating Dispaly","tab":"08eed6c3517c624e","order":5,"disp":true,"width":8,"collapse":false,"className":""},{"id":"08eed6c3517c624e","type":"ui_tab","name":"Configuration & Resets","icon":"mi-storage","order":6,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![aa0z](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@aa0z](https://discourse.nodered.org/u/aa0z)\
**Post date:** [18 December 2021 16:53 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/17 "2021-12-18T16:53:02Z")

</div>

Bump. Posted this on some other places.

I've been playing around with this for a few days with no progress. I've tried everything.

Kyle

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 February 2022 16:53 UTC](https://discourse.nodered.org/t/1-computer-2-monitors-1-static-dashboard-4-rotating-dashboards/54784/18 "2022-02-16T16:53:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
