# Controlling only one dashboard session from NodeRed

**URL:** <https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042>\
**Category:** Dashboard\
**Created:** [22 November 2022 10:50 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042 "2022-11-22T10:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SveinHa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sveinha/32/71169_2.png) [@SveinHa](https://discourse.nodered.org/u/SveinHa)\
**Post date:** [22 November 2022 10:50 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/1 "2022-11-22T10:50:39Z")

</div>

I have a home automation system in NodeRed with several browsers running Dashboard UI. I have some outdoor cameras with motion detection that activates live video when motion occurs. Working very nice but the video appears on ALL screens/browsers and I would like to limit the video to only one or two screens. Found out I could use the sessionid to pick one screen but the sessionid keeps changing...

I manually store the sessionid in a flow variable by pressing a button in the selected browser and use it like this:

> [{"id":"65c3fad08f3dc9d3","type":"ui\_ui\_control","z":"4d395651357ab1b1","name":"ui control","events":"connect","x":1260,"y":920,"wires":[]},{"id":"36f82dc7dd8f6f5f","type":"change","z":"4d395651357ab1b1","name":"GarCam","rules":[{"t":"set","p":"url","pt":"msg","to":"[http://172.16.0.101:10101/mjpg/GarCam/video.mjpg?q=40&s=100","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Innkjørsel","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":950,"wires":[["199728487f30702d"]]},{"id":"199728487f30702d","type":"change","z":"4d395651357ab1b1","name":"Show](http://172.16.0.101:10101/mjpg/GarCam/video.mjpg?q=40&s=100%22,%22tot%22:%22str%22%7D,%7B%22t%22:%22set%22,%22p%22:%22payload%22,%22pt%22:%22msg%22,%22to%22:%22Innkj%C3%B8rsel%22,%22tot%22:%22str%22%7D%5D,%22action%22:%22%22,%22property%22:%22%22,%22from%22:%22%22,%22to%22:%22%22,%22reg%22:false,%22x%22:860,%22y%22:950,%22wires%22:%5B%5B%22199728487f30702d%22%5D%5D%7D,%7B%22id%22:%22199728487f30702d%22,%22type%22:%22change%22,%22z%22:%224d395651357ab1b1%22,%22name%22:%22Show) Videopage","rules":[{"t":"set","p":"payload","pt":"msg","to":"Kamera","tot":"str"},{"t":"set","p":"socketid","pt":"msg","to":"sock1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":950,"wires":[["65c3fad08f3dc9d3","f8858d5ec8804d75","92bb7069eb9483a6","809b154c6b6ea105"]]},{"id":"809b154c6b6ea105","type":"ui\_iframe","z":"4d395651357ab1b1","group":"0cf69380855e1696","name":"","order":2,"width":"28","height":"22","url":"","origin":"\*","scale":"80","x":1280,"y":950,"wires":[]},{"id":"0cf69380855e1696","type":"ui\_group","name":"Video","tab":"8f4c3716a72a96a8","order":1,"disp":false,"width":"32","collapse":false,"className":""},{"id":"8f4c3716a72a96a8","type":"ui\_tab","name":"Kamera","icon":"videocam","order":11,"disabled":false,"hidden":false}]

Any way to at least check whether the sessionid still is alive or any other ways to get this functionality?

To complicate the matter a bit, I run 2 Chromium browsers on one RPi 400 and only want one to display the video when motion occurs and some other dashboard tab othervice.

---

<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:** [22 November 2022 15:14 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/2 "2022-11-22T15:14:37Z")

</div>

The ui\_control node can report new connections - so you can hopefully use that to grab the session ids - and hopefully then work out which came from where - maybe you have to fix ip address of one of them - and then set you flow variable.

---

<div class="post-metadata">

**Author:** ![SveinHa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sveinha/32/71169_2.png) [@SveinHa](https://discourse.nodered.org/u/SveinHa)\
**Post date:** [22 November 2022 20:13 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/3 "2022-11-22T20:13:37Z")

</div>

Thanks @dceejay , that did the trick.

The ui\_control node reports both socketip and socketid on every refresh so when I receive a socketid from one specific socketip, I store it in flow-variable and use it to display video on one screen. On the RPi 400 with 2 browsers, it probably will be fairly random which one browser that displays the video but that is a minor problem at present.

---

<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:** [22 November 2022 21:29 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/4 "2022-11-22T21:29:13Z")

</div>

as I said - you may be able to fix the ip of at least one of the devices running a browser in which case it should then stick ok. But yes - if dhcp on both then yes you will need to sort it out at startup and hope they don't change 🙂

---

<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:** [23 November 2022 00:11 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/5 "2022-11-23T00:11:01Z")

</div>

Which is why uibuilder now sets a client id which will last for the whole browser session. 😉

---

<div class="post-metadata">

**Author:** ![SveinHa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sveinha/32/71169_2.png) [@SveinHa](https://discourse.nodered.org/u/SveinHa)\
**Post date:** [23 November 2022 19:47 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/6 "2022-11-23T19:47:11Z")

</div>

This is how it looks. These two monitors is connected to one RPi 400 with one Chromium browser on each monitor, both displaying NodeRed Dashboard from the same NodeRed Controller. I simulate motion detected outside and 20 secs later, the video is replaced by the previous tab (just changed the resolution on the monitors so I need to tidy up the design a bit...):

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57bcbf13039c4492490c9ee2d5cbc62bc24f64f1.jpeg "22. november 2022") ](https://www.youtube.com/watch?v=io3uuC6O3ms)

---

<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:** [7 December 2022 19:47 UTC](https://discourse.nodered.org/t/controlling-only-one-dashboard-session-from-nodered/71042/7 "2022-12-07T19:47:24Z")

</div>

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