# Identify data from device using dashboard

**URL:** <https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, security\
**Created:** [22 December 2021 15:23 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563 "2021-12-22T15:23:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [22 December 2021 15:23 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/1 "2021-12-22T15:23:49Z")

</div>

Hi all,

a dashboard created with Node-RED can be accessed by more than one devices (if the url is known).  
Is it possible to detect which device is e.g. operating a dashboard node switch / button (e.g by reading the IP address, device name ...) and to inhibit this action?

Thx!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [22 December 2021 15:45 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/2 "2021-12-22T15:45:24Z")

</div>

yes, look at ui-control node.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 December 2021 15:51 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/3 "2021-12-22T15:51:10Z")

</div>

The UI Control node gives msg.socketid and msg.socketip when a client connects to the dashboard.  
And a button click sends socketid. Unfortunately the socketids don't match.  
 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbb1c80340d53752f068daaeef388dd1ae5f4321.jpeg)

---

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [22 December 2021 15:53 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/4 "2021-12-22T15:53:11Z")

</div>

Ok, you mean I can use `socketip` from the message emitted by node `ui control` when somebody is doing what?  
In the help is mentioned 'changes tab'. Is that similar to 'operating and switch / button?

---

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [22 December 2021 15:54 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/5 "2021-12-22T15:54:13Z")

</div>

Nevertheless, I will test it and come back with questions again.

Thank you all!  
🙂

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [22 December 2021 15:56 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/6 "2021-12-22T15:56:11Z")

</div>

When someone connect to the ui you can use the IP to disable tabs/groups, hide tabs/groups. or disable ability to run flow, it all depends on how you wish to code/run flow.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 December 2021 15:58 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/7 "2021-12-22T15:58:56Z")

</div>

Clicking a UI button does not result in an output from ui-control, regardless of the ui-control node settings.  
Apparently it can do when the user changes tab or group, so maybe it would work if your buttons are each in a different group (not tried this yet)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 December 2021 16:00 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/8 "2021-12-22T16:00:27Z")

</div>

> [@E1cid](#):
>
> When someone connect to the ui you can use the IP to disable tabs/groups, hide tabs/groups. or disable ability to run flow,

Is there an example flow somewhere for this @E1cid?

---

<div class="post-metadata">

**Author:** ![nosered1966](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nosered1966/32/52859_2.png) [@nosered1966](https://discourse.nodered.org/u/nosered1966)\
**Post date:** [22 December 2021 16:01 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/9 "2021-12-22T16:01:28Z")

</div>

@jbudd  
But if the socketids do not match how can i know from which user the button is clicked if the button (or switch) does not send IP address?

OK, I have now seen the latest answer from @E1cid and I understand that with this I can handle it. But as always: The devil is in the detail!

I hope you will help me when when it comes to implement it...

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [22 December 2021 16:13 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/10 "2021-12-22T16:13:06Z")

</div>

A VERY CRUDE EXAMPLE HERE

```auto
[{"id":"c2ef87a2.1a2908","type":"ui_ui_control","z":"c791cbc0.84f648","name":"","events":"connect","x":210,"y":1620,"wires":[["1a59dbc8.f9b424","6a13635f.d7e39c"]]},{"id":"1a59dbc8.f9b424","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":1620,"wires":[]},{"id":"6a13635f.d7e39c","type":"switch","z":"c791cbc0.84f648","name":"","property":"socketip","propertyType":"msg","rules":[{"t":"eq","v":"192.168.1.10","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":1660,"wires":[["3e3e6b9a.b5b024"]]},{"id":"3e3e6b9a.b5b024","type":"change","z":"c791cbc0.84f648","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Home_test1\"],\"show\":[\"Home_test2\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":1700,"wires":[["c2ef87a2.1a2908"]]},{"id":"f513a3ed.176318","type":"ui_switch","z":"c791cbc0.84f648","name":"","label":"switch","tooltip":"","group":"f811fd2e.819418","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":510,"y":1500,"wires":[[]]},{"id":"3a4cb48.0488b4c","type":"ui_switch","z":"c791cbc0.84f648","name":"","label":"switch","tooltip":"","group":"d1c84c65.50dd68","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":false,"x":510,"y":1540,"wires":[[]]},{"id":"f811fd2e.819418","type":"ui_group","name":"test1","tab":"8f03e639.85956","order":2,"disp":true,"width":"6","collapse":false},{"id":"d1c84c65.50dd68","type":"ui_group","name":"test2","tab":"8f03e639.85956","order":3,"disp":true,"width":"6","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 December 2021 16:42 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/11 "2021-12-22T16:42:48Z")

</div>

That's not working for me: my browser IP matches the one specified in the switch node, change node sends message to ui-control but both groups are visible.

Edit - updating and restarting node-red seems to have sorted it.

---

<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:** [21 January 2022 16:43 UTC](https://discourse.nodered.org/t/identify-data-from-device-using-dashboard/55563/12 "2022-01-21T16:43:37Z")

</div>

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