House dashboard, tab display problem

Hi for my house I made a dashboard to manage my different api and connected device, but when I am on one of the tabs has set up my devices and my wife logs in to modify another device, the ui_control sends the change of tab on our two sessions, do you have a solution for this change to be targeted on a single session, can you help me?

I think you'll find it is because there is only one dashboard. You can multiple tabs but they all affect the same single dashboard. I had a similar effect with my IoT students when a pair of students were working in two tabs on the same instance of Node-RED. Took a while before we realised what was going on.

Quelle solution avais vous trouvé?

Probably not the solution you are looking for...
I took the quick and easy solution and assigned each student to their own Raspberry Pi - Zero.

2 Likes

Hi,

ui-control triggers tab changes to all connected clients only if no socketid is specified
if you specify the socketid of a single client only these client will be affected.
image
this inject node will only change the tab on the client specified by it's socketid

you can get the socketid by the ui-control node listening for connect events (or via responses of input widgets)
image

To differentiate yourself form your wife you have the chance via fixed ip addresses as the socketid changes on all connects randomly

image

1 Like

thank you i will try

Hi I sent him the socket id but nothing changed, I tested with the ip, and even the two together but nothing worked, I even tested it in the payload.
But with the notification message it works, are you sure that's the only thing to change?

First: It only works by providing the socketid as under one ip-address there could be more than one session. The ip address might only be usefull to distinguish different users.

TL;DR: Upgrade the dashboard to the latest version

After testing I was a little bit lost as the socketid given by the ui-control node differs from the browsers socketid and seams to be wrong

image

Browser

image

They are not the same. The browsers socketid works fine but the socketid given by the ui-control node in version below 3.1.3 might give you wrong gesults (EDIT)

but the socket id coming from a ui widget (here a button) is fine
image

Investigating a little bit further there was an issue up to version 3.1.3 Wrong socketid displayed by ui-control node · Issue #738 · node-red/node-red-dashboard · GitHub

So upgrade to the latest version and it should work as expected

here my little test flow:

[{"id":"2d8ea7af5b1757b8","type":"ui_ui_control","z":"677e78e.a3a7288","name":"","events":"change","x":367,"y":612,"wires":[["5f2a9a1765eaa802"]]},{"id":"5f2a9a1765eaa802","type":"debug","z":"677e78e.a3a7288","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":509,"y":612,"wires":[]},{"id":"fda0b01a484a037f","type":"inject","z":"677e78e.a3a7288","name":"","props":[{"p":"socketid","v":"vGJn-WuDD377upHqAAAX","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"tab\":0}","payloadType":"json","x":220,"y":612,"wires":[["2d8ea7af5b1757b8"]]}]

I opened two windows in private browsing on two different browsers on my pc and still does not work but I am in 3.1.0 :confused:
I quickly switch to 3.1.5 to test

3.1.3: Maintenance Release

Fixes

  • Remove main entry from package.json. Issue #740

  • Let date-picker send repeated existing values.

  • Warn if Node.js version not 12+.

  • Allow ui-dropdown to accept single string for one valid option.

  • Fix socketid back to be in sync with reality. Issue #738

I am using Dashboard 3.1.5 and have found this issue.

Think you might have to raise an issue on github if you found a reproduceable bug.

Hi, it's good for me, since the migration everything works now. Thank you all.

1 Like

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