# Exporting data from ds18b20

**URL:** https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146
**Category:** General
**Created:** [5 September 2019 10:36 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146 "2019-09-05T10:36:36Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 10:36 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/1 "2019-09-05T10:36:37Z")

</div>

Hello,  
i have two ds18b20 sensors and want to export the data of my two temperature curves so i can put them into excel for example.  
Is that possible?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 10:40 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/2 "2019-09-05T10:40:01Z")

</div>

Definitely. If you search the forum you'll find others that have already done this...

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [5 September 2019 10:40 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/3 "2019-09-05T10:40:33Z")

</div>

Is this by chance a school project? I saw an almost identical question about a week ago. Have you tried using the forum search already?

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 11:44 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/4 "2019-09-05T11:44:50Z")

</div>

Yes. Can you help me with my problem? I tried a file node but it only saves my temperature oand not the time

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 11:50 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/5 "2019-09-05T11:50:42Z")

</div>

> [@RudiRuessel](#):
>
> but it only saves my temperature oand not the time

Your ds18b20 won't send you the time, so you will need to add it yourself. You can either do that using javascript in a function node or you could look at using the node-red-contrib-moment node

When asking a question it's useful if you include what the actual question is in the title which doesn't mention time at all.

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 11:52 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/6 "2019-09-05T11:52:10Z")

</div>

and where is my csv node saved?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 11:59 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/7 "2019-09-05T11:59:53Z")

</div>

you are going to have to explain what you mean.

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [5 September 2019 12:05 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/8 "2019-09-05T12:05:57Z")

</div>

> [@RudiRuessel](#):
>
> and where is my csv node saved?

Have you checked the info panel for each node yet? When you click a node the info panel is shown in the sidebar.  
[https://nodered.org/docs/user-guide/editor/sidebar/](https://nodered.org/docs/user-guide/editor/sidebar/)  
For the csv node in the core library, it shows a filename property if I remember correctly. But at the very least it will explain the what and how of the usage. Including how/where the file is saved, and how to configure that.

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 12:13 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/9 "2019-09-05T12:13:09Z")

</div>

'''  
[{"id":"e56a2129.2d864","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"26a3da89.2c0dc6","type":"inject","z":"e56a2129.2d864","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":204.5,"y":119,"wires":[["57ca2195.166ab"]]},{"id":"57ca2195.166ab","type":"rpi-ds18b20","z":"e56a2129.2d864","topic":"","array":false,"name":"","x":515.5,"y":127,"wires":[["b49b0b8e.970aa8","cd4e41df.9aea4","68190ba5.39b314","2d9ea03e.e2e3c"]]},{"id":"68190ba5.39b314","type":"debug","z":"e56a2129.2d864","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1017.5,"y":177,"wires":},{"id":"b49b0b8e.970aa8","type":"ui\_chart","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":0,"width":0,"height":0,"label":"Temperaturverlauf","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"80","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":939.5,"y":384,"wires":[]},{"id":"c89041ec.d0efb","type":"ui\_gauge","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":2,"width":0,"height":0,"gtype":"gage","title":"Innentemperatur","label":"Grad Celsius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":928.5,"y":428,"wires":},{"id":"22c9403e.ae8c6","type":"ui\_gauge","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":2,"width":0,"height":0,"gtype":"gage","title":"Außentemperatur","label":"Grad Celsius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":938.5,"y":474,"wires":},{"id":"cd4e41df.9aea4","type":"switch","z":"e56a2129.2d864","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"8A1579970203","vt":"str"},{"t":"eq","v":"AAF8E0521401","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":728,"y":450,"wires":[["c89041ec.d0efb"],["22c9403e.ae8c6"]]},{"id":"2d9ea03e.e2e3c","type":"file","z":"e56a2129.2d864","name":"","filename":"test.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1020,"y":237,"wires":[]},{"id":"ef2bf784.b388a8","type":"ui\_group","z":"","name":"Default","tab":"f5b991a8.313f3","disp":true,"width":"6","collapse":false},{"id":"f5b991a8.313f3","type":"ui\_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]  
'''  
I try to get a csv file with three columns. In the first should be the time, in the second temp. 1 and in the third temp. 2

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 12:16 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/10 "2019-09-05T12:16:02Z")

</div>

Unfortunately your flow isn't currently importable.Please read the following post [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) and then edit the above message.

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 12:20 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/11 "2019-09-05T12:20:02Z")

</div>

```auto
[{"id":"e56a2129.2d864","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"26a3da89.2c0dc6","type":"inject","z":"e56a2129.2d864","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":204.5,"y":119,"wires":[["57ca2195.166ab"]]},{"id":"57ca2195.166ab","type":"rpi-ds18b20","z":"e56a2129.2d864","topic":"","array":false,"name":"","x":515.5,"y":127,"wires":[["b49b0b8e.970aa8","cd4e41df.9aea4","68190ba5.39b314","2d9ea03e.e2e3c"]]},{"id":"68190ba5.39b314","type":"debug","z":"e56a2129.2d864","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1017.5,"y":177,"wires":[]},{"id":"b49b0b8e.970aa8","type":"ui_chart","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":0,"width":0,"height":0,"label":"Temperaturverlauf","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"80","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":939.5,"y":384,"wires":[[]]},{"id":"c89041ec.d0efb","type":"ui_gauge","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":2,"width":0,"height":0,"gtype":"gage","title":"Innentemperatur","label":"Grad Celsius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":928.5,"y":428,"wires":[]},{"id":"22c9403e.ae8c6","type":"ui_gauge","z":"e56a2129.2d864","name":"","group":"ef2bf784.b388a8","order":2,"width":0,"height":0,"gtype":"gage","title":"Außentemperatur","label":"Grad Celsius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":938.5,"y":474,"wires":[]},{"id":"cd4e41df.9aea4","type":"switch","z":"e56a2129.2d864","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"8A1579970203","vt":"str"},{"t":"eq","v":"AAF8E0521401","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":728,"y":450,"wires":[["c89041ec.d0efb"],["22c9403e.ae8c6"]]},{"id":"2d9ea03e.e2e3c","type":"file","z":"e56a2129.2d864","name":"","filename":"test.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1020,"y":237,"wires":[[]]},{"id":"ef2bf784.b388a8","type":"ui_group","z":"","name":"Default","tab":"f5b991a8.313f3","disp":true,"width":"6","collapse":false},{"id":"f5b991a8.313f3","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

now?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 12:30 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/12 "2019-09-05T12:30:30Z")

</div>

OK, so you can get the time from the timestamp, see earlier post if you want it formatted nicer.  
You need to understand the data format of the message coming out of your ds18 node.

Try also reading the info panel for the file node...

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 12:33 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/13 "2019-09-05T12:33:30Z")

</div>

i already read it. I get every ten secs the temperature of both sensors in my file. but how can i get the time?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [5 September 2019 12:35 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/14 "2019-09-05T12:35:39Z")

</div>

As I already said

> [@ukmoose](#):
>
> Your ds18b20 won't send you the time, so you will need to add it yourself. You can either do that using javascript in a function node or you could look at using the node-red-contrib-moment node

Good luck with your project

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 12:45 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/15 "2019-09-05T12:45:29Z")

</div>

and how does the java script looks like

---

<div class="post-metadata">

### Author: ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)
#### Post date: [5 September 2019 12:51 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/16 "2019-09-05T12:51:58Z")

</div>

I'd recommend using the moment node, honestly. It's an excellent contrib node. If a javascript style timestamp is sufficient (as in you don't need it to be human readable) you can also pass the message through a change node set to set your desired property to a timestamp.

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 12:57 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/17 "2019-09-05T12:57:14Z")

</div>

Okay i just installed the moment node. But how i have to connect it with my other nodes?

---

<div class="post-metadata">

### Author: ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)
#### Post date: [5 September 2019 13:01 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/18 "2019-09-05T13:01:29Z")

</div>

Play with it some. Do some searching on here to see how others have used it.

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [5 September 2019 13:02 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/19 "2019-09-05T13:02:22Z")

</div>

> [@RudiRuessel](#):
>
> Okay i just installed the moment node. But how i have to connect it with my other nodes?

> [@afelix](#):
>
> Have you checked the info panel for each node yet? When you click a node the info panel is shown in the sidebar.  
> [Sidebar : Node-RED](https://nodered.org/docs/user-guide/editor/sidebar/)  
> For the csv node in the core library, it shows a filename property if I remember correctly. But at the very least it will explain the what and how of the usage. Including how/where the file is saved, and how to configure that.

Same thing applies again. Start with the info panel, then do a forum search if more help is needed.

---

<div class="post-metadata">

### Author: ![RudiRuessel](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@RudiRuessel](https://discourse.nodered.org/u/RudiRuessel)
#### Post date: [5 September 2019 13:03 UTC](https://discourse.nodered.org/t/exporting-data-from-ds18b20/15146/20 "2019-09-05T13:03:02Z")

</div>

i nearly solved the problem. I only have one question. How can i get my 3 values in 3 different columns in my csv file?
