IS there a way to change a ui element of the group with another

Is there a way to let the player coming from the the ui_mp4frag node ?
background: I don´t want to replace my old view method which graps a more detailed picture of the cams than the video stream. So ein want implement a button for video and picture mode. but don´t know how to disable the player or change inside the group between the video view ( ui_mp4frag node) and picture mode (ui template node) . Any idea on that ? perhaps @kevinGodell ? :slight_smile:

You can use ui-contorl to enable/diable hide/show groups/tabs, read the ui-control in-built help text.

You can also feed msg.enabled true/false to most ui nodes to enable or disable them e.g.

[{"id":"31c8a351.f79b3c","type":"inject","z":"30af2d3e.d94ea2","name":"enable","props":[{"p":"enabled","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":660,"wires":[["b81a05e7.733ff"]]},{"id":"b81a05e7.733ff","type":"ui_template","z":"30af2d3e.d94ea2","group":"2d4fe667.28f8ba","name":"","order":11,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":280,"y":680,"wires":[[]]},{"id":"89b3861e.e2325","type":"inject","z":"30af2d3e.d94ea2","name":"","props":[{"p":"enabled","v":"false","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"disable","x":120,"y":700,"wires":[["b81a05e7.733ff"]]},{"id":"ab11b443.0b62d","type":"inject","z":"30af2d3e.d94ea2","name":"show timestamp","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":620,"wires":[["b81a05e7.733ff"]]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
1 Like

Thx!
I got it to work:

[{"id":"17d5e81d7fa0a6eb","type":"ui_switch","z":"f35bf9c81635c79c","name":"","label":"Cam 4 Bilder","tooltip":"","group":"62575f31e409f3f7","order":3,"width":"7","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":750,"y":700,"wires":[["07b4946c73dc2818","64f20fdc836a91ce"]]},{"id":"64f20fdc836a91ce","type":"function","z":"f35bf9c81635c79c","name":"payload2action","func":"let newPayload = {};\nif(msg.payload)\n{\n    newPayload = '{\"group\":{\"show\":[\"Webcams_Cam_4_-_Garten_Bilder_(Reolink)\"]}}';\n    msg.payload = newPayload;\n    return msg;\n}\nelse\n{\n    newPayload = '{\"group\":{\"hide\":[\"Webcams_Cam_4_-_Garten_Bilder_(Reolink)\"]}}';\n    msg.payload = newPayload;\n    return msg;\n}\nreturn null;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":760,"wires":[["e115152d288926ba"]]},{"id":"e115152d288926ba","type":"json","z":"f35bf9c81635c79c","name":"","property":"payload","action":"","pretty":false,"x":1170,"y":760,"wires":[["61ef938ed9953932","da87bbb8.d2bfb8"]]},{"id":"da87bbb8.d2bfb8","type":"ui_ui_control","z":"f35bf9c81635c79c","name":"","events":"connect","x":1900,"y":1080,"wires":[[]]},{"id":"62575f31e409f3f7","type":"ui_group","name":"Webcams Controller","tab":"9f7f7c23.5626d8","order":1,"disp":true,"width":"14","collapse":true,"className":""},{"id":"9f7f7c23.5626d8","type":"ui_tab","name":"Webcams","icon":"videocam","order":14,"disabled":false,"hidden":false}]

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