# Realtime Update

**URL:** <https://discourse.nodered.org/t/realtime-update/44487>\
**Category:** Dashboard\
**Created:** [21 April 2021 08:09 UTC](https://discourse.nodered.org/t/realtime-update/44487 "2021-04-21T08:09:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 08:09 UTC](https://discourse.nodered.org/t/realtime-update/44487/1 "2021-04-21T08:09:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2021 08:23 UTC](https://discourse.nodered.org/t/realtime-update/44487/2 "2021-04-21T08:23:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 08:54 UTC](https://discourse.nodered.org/t/realtime-update/44487/3 "2021-04-21T08:54:46Z")

</div>

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.  
ThankYou  
Kartik

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2021 09:09 UTC](https://discourse.nodered.org/t/realtime-update/44487/4 "2021-04-21T09:09:12Z")

</div>

> [@Kartiknodered](#):
>
> 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).

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 09:10 UTC](https://discourse.nodered.org/t/realtime-update/44487/5 "2021-04-21T09:10:58Z")

</div>

Ok, Thanks for your time.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2021 09:16 UTC](https://discourse.nodered.org/t/realtime-update/44487/6 "2021-04-21T09:16:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 13:02 UTC](https://discourse.nodered.org/t/realtime-update/44487/7 "2021-04-21T13:02:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [21 April 2021 13:08 UTC](https://discourse.nodered.org/t/realtime-update/44487/8 "2021-04-21T13:08:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 April 2021 13:08 UTC](https://discourse.nodered.org/t/realtime-update/44487/9 "2021-04-21T13:08:56Z")

</div>

> [@Kartiknodered](#):
>
> they don't allow me to share any kind of code

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

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 13:17 UTC](https://discourse.nodered.org/t/realtime-update/44487/10 "2021-04-21T13:17:10Z")

</div>

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

 ![Screenshot (85)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/23f0d0b2efd4cc4143903ebb1370328800ae496b.png)  
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 ![Screenshot (86)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3a81a9ec9d9d34d6bceb74c4c7274b312f83906.png)  
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  
 ![Screenshot (86)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3a81a9ec9d9d34d6bceb74c4c7274b312f83906.png)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [21 April 2021 13:31 UTC](https://discourse.nodered.org/t/realtime-update/44487/11 "2021-04-21T13:31:09Z")

</div>

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.

[https://flows.nodered.org/flow/2f1aaf0635f9bf23207152682323240a](https://flows.nodered.org/flow/2f1aaf0635f9bf23207152682323240a)

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [21 April 2021 13:40 UTC](https://discourse.nodered.org/t/realtime-update/44487/12 "2021-04-21T13:40:10Z")

</div>

Thank you Andrei , i try and acknowledge you.

---

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [22 April 2021 07:27 UTC](https://discourse.nodered.org/t/realtime-update/44487/13 "2021-04-22T07:27:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 May 2021 07:28 UTC](https://discourse.nodered.org/t/realtime-update/44487/14 "2021-05-22T07:28:19Z")

</div>

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