Hiding group using "ui_control" node and "button"

Hi all,
I would hide group in my dashboard. I've tried all the solution which I've found in the forum but it still doesn't work.
I have a "button" node which sends a JSON message to the "ui_control" node.
The problem probably is the format of the JSON message.I've tried the following format:

{group:{hide:["tab_name_group_name_with_underscores"],show:["tab_name_another_group"],focus:true}}
and
{"group":{"hide":["Tab1_Group_1"]}}
and also
{tab:“tab_name_with_underscores”,group:{hide:“group_name_with_underscores”,show:“group_name_with_underscores”,focus:true}}
but no one works.
I also tried the flow in
https://flows.nodered.org/flow/f1b077d49f52866e74e9b983690b470f
but I had no results.
Could you help me?
Thanks a lot
Paolo

If the example you linked to doesn’t work, have you checked which version of Node-RED, nodejs & node-red-dashboard you are using?

So what are YOUR tabs called ? the examples above are purely examples - you need to use your tab names and group names (but replace any spaces with underscores - so Tab 1 Group 1 would be Tab_1_Group_1 - also that is a slightly old example in that it was for using in a function node - for any other node you need correctly formatted json - so for example

{"group":{"hide":["your_tab_your_group"]}}

(note the extra " around the property names. )

4 Likes

Thanks guys for tour replys.
The version of node Red installed in my Raspberry Is 0.18.3.
The name of the tab Is "testgroup" and the groups name are "uno" "due", "tre". So, I've tried the following:

'{"testgroup":{"hide":["testgroup_uno"]}}'
But It doesn t work.
Ant idea?

Your syntax is not quite correct it needs to be

 {"groups":{"hide":["testgroup_uno"]}}

Here is an example

[{"id":"9129737d.60fcb","type":"inject","z":"db8bd33.4e7c83","name":"","topic":"","payload":"{\"group\":{\"hide\":[\"testgroup_uno\"]}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":340,"wires":[["da87bbb8.d2bfb8"]]},{"id":"da87bbb8.d2bfb8","type":"ui_ui_control","z":"db8bd33.4e7c83","name":"","x":380,"y":380,"wires":[[]]}]

Hiding groups was only added in 2.9.4 or more recent version of dashboard so I assume you have that (the version is printed in the console wen you start Node-RED).

1 Like

Could You explain me Better how can I get the version of node red installed on my Raspberry?when i start the consolle i can't see the version..Sorry.
Thanks a lot
Paolo

if you run node-red-stop && node-red-start in a console it will stop and start Node-RED and show you the versions.

Thanks a lot dceejay. I've tried your code but it still doesn't work.
Here follow the node red version in my raspberry and also the entire flow which doesn't work.

Node red version
Node-RED version: v0.19.6
Node.js version: v10.15.2
Linux 4.14.98+ arm LE
Dashboard version 2.8.1 started at /ui

My flow
[{"id":"f5ef31ed.9dab7","type":"tab","label":"groupTEST","disabled":false,"info":""},{"id":"67fe18ba.e61688","type":"ui_text","z":"f5ef31ed.9dab7","group":"256ee50c.7774da","order":0,"width":0,"height":0,"name":"","label":"","format":"due","layout":"row-spread","x":570.8945503234863,"y":191.75390911102295,"wires":[]},{"id":"9a9b17e7.db7b88","type":"ui_text","z":"f5ef31ed.9dab7","group":"a20dc40b.fb1808","order":0,"width":0,"height":0,"name":"","label":"","format":"tre","layout":"row-spread","x":576.0195503234863,"y":245.00391292572021,"wires":[]},{"id":"988a6e81.2b276","type":"inject","z":"f5ef31ed.9dab7","name":"","topic":"","payload":"{\"group\":{\"hide\":[\"testgroup_uno\"]}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":421.69560623168945,"y":298.35070610046387,"wires":[["3b08c4c7.96a06c"]]},{"id":"3b08c4c7.96a06c","type":"ui_ui_control","z":"f5ef31ed.9dab7","name":"","x":583.362232208252,"y":300.0173897743225,"wires":[[]]},{"id":"b123fd52.5b5f5","type":"ui_text","z":"f5ef31ed.9dab7","group":"e099ab9b.c78f48","order":0,"width":0,"height":0,"name":"","label":"","format":"uno","layout":"row-spread","x":573.3622436523438,"y":135.01734924316406,"wires":[]},{"id":"256ee50c.7774da","type":"ui_group","z":"","name":"due","tab":"6d74c650.0fe308","order":2,"disp":true,"width":"6","collapse":false},{"id":"a20dc40b.fb1808","type":"ui_group","z":"","name":"tre","tab":"6d74c650.0fe308","order":3,"disp":true,"width":"6","collapse":false},{"id":"e099ab9b.c78f48","type":"ui_group","z":"","name":"uno","tab":"6d74c650.0fe308","order":1,"disp":true,"width":"6","collapse":false},{"id":"6d74c650.0fe308","type":"ui_tab","z":"","name":"testgroup","icon":"dashboard","order":35}]

could you help me?
Thanks a lot

As @dceejay says you need v2.9.4+ of dashboard

You say you have Dashboard version 2.8.1

you need to upgrade

to upgrade dashboard on PI

cd ~/.node-red
npm i node-red-dashboard@latest
node-red-stop && node-red-start

Fantastic!now It works.
Thanks a lot all my Friends

1 Like

Hi all, i have another question for you!
Now i'm able to hide/show group by sending a JSON message from "button"/"inject" node to "ui_control" node.
Now I would hide/show a group sending a message from a "function" node to "ui_control" node.
The question is: have I to use also in this case the JASON format for the message? Or could I use a "standard" format?
Thanks a lot
Paolo

What have you tried?

You need to send the same message to create the same effect.

Hello guys!
my question is how many groups can you hide/ operate at once? I have my group 1-3 working fine, but when i add a button to control group4, the button just stop working like any others for previous groups? Any thoughts?

Thanks!!! I had the same problem and you solved it!