How to access Grafana dashboard with a ui button

Hello; I'm trying to view the history by accessing Grafana dashboard from my node-red dashboard when I click on a button , but the access isn't authorized , I tried to replace "localhost" or with the IP address of my raspberry pi , but I still can't access it, if I type the same link on my url bar it directs me to the grafana login page than to the dashboard I want to access.

[{"id":"195063e9.d5324c","type":"ui_button","z":"1f72a396.dd2dcc","name":"","group":"334534ab.9b33fc","order":1,"width":"5","height":"1","passthru":false,"label":"<a  class=\"link\" href=\"http://localhost:8889/d/5HOvvp4Wk/smart-green-app?orgId=1&kiosk\">l'historique</a>&nbsp&nbsp <img  height=\"20px\" width=\"25px\" src=\"/gr.png\" />","tooltip":"","color":"","bgcolor":"#ddb6c6","icon":"","payload":"","payloadType":"str","topic":"","x":2176.0521507263184,"y":129.67711067199707,"wires":[[]]},{"id":"334534ab.9b33fc","type":"ui_group","z":"","name":"Group 9","tab":"6223b67a.9315e8","order":4,"disp":false,"width":"5","collapse":false},{"id":"6223b67a.9315e8","type":"ui_tab","z":"","name":"Tableau de bord","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Where are you going to get the data from to look at?
Have you searched the forum using 'grafana' to see how others are using it?
Can you access the granafa history using the address in a browser outside of NR?

Also the flow you provide is just a ui_button node and in it you have set the label to some HTML. That is not going to work, what is in the label option just shows in the dashboard as the label of the button.

So you're saying that this is illogical !

I'm saying anything you put in a ui_button node's label option only displays on the button in the dashboard. If you change the label option to 'STOP' then the label will show.
It is not used for any thing else.

Attach a debug node (set to display the 'complete msg object' and you will see what happens. As explained in the Info tab for the ui_button node;

Clicking the button generates a message with msg.payload set to the Payload field. If no payload is specified, the node id is used.

1 Like

I think one option would be to make the button bring up an iframe containing the grafana page.

@zenofmud Actually, it works try this one for example:
[{"id":"3ec370c7.bf8f6","type":"ui_button","z":"276447cb.393008","name":"","group":"ea687868.82aba8","order":20,"width":"6","height":"1","passthru":false,"label":" <a href=\"\" >Link</a>","tooltip":"","color":"","bgcolor":"#a1c45a","icon":"","payload":"","payloadType":"str","topic":"","x":570,"y":60,"wires":[[]]},{"id":"ea687868.82aba8","type":"ui_group","z":"","name":"Météo","tab":"8219815a.93f9e","order":1,"disp":false,"width":"6","collapse":false},{"id":"8219815a.93f9e","type":"ui_tab","z":"","name":"Tableau de bord","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

The example doesn't work for me.

Well I stand corrected, you are correct, it does work, but my guess is that it was never intended for that purpose

@dceejay - what is your take on adding html link code to the label of a button - or any dashboard element?

Addala, If you take http://localhost:8889/d/5HOvvp4Wk/smart-green-app?orgId=1&kiosk and enter it into a browser, does it work?

My take ? It's your dashboard to do with what you will.

1 Like