Realtime Update

How to Realtime update the dashboard when device is connected or disconnected.
Actually i get notification when device is connected or disconnected and also data change in database but i have to refresh browser to see the changes in dashboard.
Thank you.

How are you displaying the status that does not get changed till you refresh?

Are you using the latest version of node-red-dashboard? You can check that in the menu Manage Palette.

Hello, Thanks for replying I am using 2.28.2 version of dashboard.
Hope you understand my scenario!
Let me more clear to you.
Suppose I have device which can lit 4 bulbs currently my device is connected and my dashboard is showing connected in UI and also in database it show online/connected i.e. 1.
But when I disconnect device or remove device then it notifies me disconnected and also database show offline/disconnected i.e. 0 but dashboard UI is same as before showing connected but when I refresh browser then it show disconnected.
So i want it Realtime , the moment I disconnect device dashboard show disconnected.
One thing more i clear i created my dashboard using template node in which i use HTML,CSS and Js.

If you are sending the template the new status then it should update immediately. If it doesn't then post the template you are using and probably someone who knows about that way of doing it will help. I have not much experience in that area so I will leave it to someone else (I usually use the standard dashboard nodes).

1 Like

Ok, Thanks for your time.

Don't forget to post the template and show us the message you are feeding into it. Without that no-one can help.

There is a problem i am a fresher working for a firm and they don't allow me to share any kind of code that's why i am asking Raw Questions.

Fair enough but there is no need to open different posts to ask the same question. Probably there is a simple solution but I can´t see how to help you given the amount of information available.

You could mock up (non) working examples instead of posting sensitive (IP) code.

1 Like

Hii Andrei,
I may give couple of images and tell you the scenario.

This is my webpage dashboard.
This is the situation when device is connected and let database status has value 1.
But when i remove the device i need the Situation like this
but the problem is that database status will 0 when i disconnect the device but browser doesn't show this off page without refreshing the browser.
I need to refresh the browser to see this situation

The HTML in the template node is loaded to the browser running the dashboard. Note however that your flow is running in a server (the runtime) You want data from the runtime updating the browser so you need to access data (msg object) in the template node. I suggest reading the following article to start off.

Thank you Andrei , i try and acknowledge you.

@Andrei @Colin @Steve-Mcl , Hello ,
Lets leave everything and suggest me as i am newbie in node red world, How can i create an node-red application which is connected to mqtt broker and database.
Now i want to fetch data from database in real time, whatever i update in database will reflect on node red html template dashboard.

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