# Get node-red-contrib-persist to restore chart

**URL:** <https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776>\
**Category:** General\
**Created:** [19 December 2020 21:54 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776 "2020-12-19T21:54:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomadoggy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomadoggy/32/34065_2.png) [@Tomadoggy](https://discourse.nodered.org/u/Tomadoggy)\
**Post date:** [19 December 2020 21:54 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/1 "2020-12-19T21:54:47Z")

</div>

@DeanC Thank you for your persist nodes! I have read through the documentation many times and tried a number of different configurations to get one of my UI charts to restore after a reboot/refresh, but so far to no avail. I have verified that the file is getting written to the correct directory on my Pi, and that this file is appropriately updating with the same data that is going directly into my chart (both chart and persist-in wired to the same message). However unable to restore. I assumed to use the persist-in wired directly to the chart and a few other configurations...Can you help a NOOB please?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [19 December 2020 22:14 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/2 "2020-12-19T22:14:33Z")

</div>

Can you add a debug node to a 'persist output' node (that has **exactly the same name** as the corresponding 'persist input' node) and click inject on the 'persist output' node.  
Is the stored data retrieved in the debug panel?

---

<div class="post-metadata">

**Author:** ![Tomadoggy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomadoggy/32/34065_2.png) [@Tomadoggy](https://discourse.nodered.org/u/Tomadoggy)\
**Post date:** [19 December 2020 22:19 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/3 "2020-12-19T22:19:11Z")

</div>

Paul, I have done that and when triggering the persist-out there is **no** message output to the debug. Both node configurations shown below:

![persistin](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3a02177bbe27a8cacf3c7892bbb857daa7f2380.png)

![persistout](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/4474743c92ee75df9b106f76990e2707551dec74.png)

Here is some of the data stored in the referenced file:

> {"Temp Chart Persist":{"topic":"Outside\_Temp","payload":[{"series":["Outside\_Temp"],"data":[[{"x":1608416023345,"y":78.6},{"x":1608416023724,"y":78.53},{"x":1608416053730,"y":78.53},{"x":1608416083724,"y":78.46},{"x":1608416113725,"y":78.49},{"x":1608416143728,"y":78.46},{"x":1608416173728,"y":78.55},{"x":1608416203725,"y":78.58},{"x":1608416233735,"y":78.66},{"x":1608416263727,"y":78.67},{"x":1608416293727,"y":78.82},{"x":1608416323728,"y":78.84},{"x":1608416353727,"y":78.94}]],"labels":[""]}],"qos":1,"retain":false,"\_topic":"Outside\_Temp","\_msgid":"1461e3b7.dba17c"}}

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [19 December 2020 22:20 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/4 "2020-12-19T22:20:57Z")

</div>

> [@Paul-Reed](#):
>
> that has **exactly the same name**

They don't have the same name.  
Temp Chart Persist  
Temp persist in

---

<div class="post-metadata">

**Author:** ![Tomadoggy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomadoggy/32/34065_2.png) [@Tomadoggy](https://discourse.nodered.org/u/Tomadoggy)\
**Post date:** [19 December 2020 23:26 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/7 "2020-12-19T23:26:39Z")

</div>

May I ask if there is a way to limit the data stored by this persist node? As I have it on the output of the chart...and that chart is set to limit the X-axis to nnn-days or nnnn-datapoints, will the file being written to by persist inherit these limits? May concern (may be unfounded) is that this storage file grows infinitely.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [19 December 2020 23:38 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/8 "2020-12-19T23:38:30Z")

</div>

The persist node will only save the **latest** data saved by the 'persist input' node, so everytime the chart is redrawn, the saved data will be overwritten with the latest data emitted by the ui\_chart.

Please read the node readme.

> **"The last message wins"**  
> Only the last message received within the storing interval is considered, all other previous messages are discarded. If no message is received within the storing interval, the next incoming message will immediately trigger a store procedure. Setting a large storing interval will reduce filesystem writes but will increase the risk of data loss. Additionally, the buffer is also stored when Node-RED is shutdown

---

<div class="post-metadata">

**Author:** ![Tomadoggy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tomadoggy/32/34065_2.png) [@Tomadoggy](https://discourse.nodered.org/u/Tomadoggy)\
**Post date:** [19 December 2020 23:40 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/9 "2020-12-19T23:40:31Z")

</div>

Thank you for the quick reply...I read that but apparently did not fully grasp. I will thus assume that since the persist node is on the output of my chart and the chart is configured to only display xxx duration of data, then the data store will reflect accordingly.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [19 December 2020 23:44 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/10 "2020-12-19T23:44:54Z")

</div>

> [@Tomadoggy](#):
>
> I will thus assume that since the persist node is on the output of my chart and the chart is configured to only display xxx duration of data, then the data store will reflect accordingly.

Yes, that's correct.

---

<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:** [2 January 2021 23:44 UTC](https://discourse.nodered.org/t/get-node-red-contrib-persist-to-restore-chart/37776/11 "2021-01-02T23:44:58Z")

</div>

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