Hiding group using "ui_control" node and "button"


#1

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


#2

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


#3

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

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?


#5

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).


#6

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


#7

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


#8

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


#9

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

You say you have Dashboard version 2.8.1

you need to upgrade


#10

to upgrade dashboard on PI

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

#11

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


#12

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


#13

What have you tried?


#14

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