# Download "body" data from Notehub Events

**URL:** <https://discuss.blues.com/t/download-body-data-from-notehub-events/1816>\
**Category:** Notehub.io\
**Created:** [November 27, 2023, 5:36pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816 "2023-11-27T17:36:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![TJK](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJK](https://discuss.blues.com/u/TJK)\
**Post date:** [November 27, 2023, 5:36pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/1 "2023-11-27T17:36:55Z")

</div>

Hello,  
I would like to download the body data from notehub into a csv file or similar. I am sure this is not the best way to get the data but I am pretty green with Blues and was looking for a simple method to get the data.  
Thank you.

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [November 27, 2023, 9:51pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/2 "2023-11-27T21:51:12Z")

</div>

Hi @TJK,

You can always manually download event data in JSON format using the “Download” button that appears in the top-right corner of the Events tab in your Notehub project.

However, the best practice is to [route your data](https://dev.blues.io/notehub/notehub-walkthrough/#routing-data-with-notehub) to another cloud endpoint as it comes in (or even manually through the Notehub UI if needed).

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![TJK](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJK](https://discuss.blues.com/u/TJK)\
**Post date:** [November 27, 2023, 10:11pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/3 "2023-11-27T22:11:29Z")

</div>

Thank you Rob,  
I used the download button before I posted my question. How is the json data opened? When I open it it opens in visual studio and is one long line. I would like to be able to collect the body data (sensor readings) in a single column and open it in say, Excel. I will get to utilizing cloud services soon but right now my brain is black and blue from setting up twilio and I don’t want to go off on another journey right now. If I can easily grab the data manually, I can get to work geting the first controllers installed in the field and work on data presentation later.  
Thank you for your help.  
Tom  
EDIT: I got it opened in excel but the body is just showing up a “record” . I see the date is unix time.

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [November 28, 2023, 2:26pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/4 "2023-11-28T14:26:55Z")

</div>

Hi @TJK,

I just tried this online “JSON to CSV/Excel” converter and it worked surprisingly well!

> **[JSON To CSV Converter](https://www.convertcsv.com/json-to-csv.htm)**
>
> Convert JSON to CSV/Excel

---

<div class="post-metadata">

**Author:** ![TJK](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJK](https://discuss.blues.com/u/TJK)\
**Post date:** [November 28, 2023, 3:52pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/5 "2023-11-28T15:52:43Z")

</div>

Thank you Rob.  
You are right on top of this. I appreciate your help. Can I ask another question?

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [November 28, 2023, 4:30pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/6 "2023-11-28T16:30:25Z")

</div>

Of course! Ask away…

---

<div class="post-metadata">

**Author:** ![TJK](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJK](https://discuss.blues.com/u/TJK)\
**Post date:** [November 28, 2023, 5:17pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/7 "2023-11-28T17:17:24Z")

</div>

Let me know if this question requires a new thread.  
I have outlined three main general tasks I need to complete in order to begin deploying into the field. (These system are all owned by me so there are no clients.) With help from the forum and your help, I have completed two of the tasks. The last thing I need to do is learn how to send a command to the notecard. I have explored environment variables and have that aspect working satisfactorily. As a general example of what I need to do consider the on-board LED on the swan. I would like to send a message that issues a one-time command to blink the LED one time or a one-time comand that turns the LED on and then send another command that turns the LED off. Environment variables do not seem well suited for this task and I don’t think twilio accommodates two-way communication. I reviewed the Valve-Monitor accelerator but that example goes well beyond my knowledge and immediate need. Could you please let me know if there is a simple way to accomplish this task and if so, point me in the right direction?  
Thank you Rob,  
Tom

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [November 28, 2023, 6:57pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/8 "2023-11-28T18:57:05Z")

</div>

Hi @TJK,

I actually think environment variables are very well suited to this task! In the on/off scenario, you could:

1. [Set an environment variable in Notehub](https://dev.blues.io/guides-and-tutorials/notecard-guides/understanding-environment-variables/#setting-a-notehub-device-variable), provide some arbitrary name like `on` and set it to `true` or `false`.
2. In your firmware, depending on whether this is battery powered or not, you could use the `sync:true` argument in your [hub.set request](https://dev.blues.io/api-reference/notecard-api/hub-requests/#hub-set) which will very quickly sync any environment variable changes to your device(s). (Or if you’re battery powered you’ll likely want to wait for the next periodic inbound sync to retrieve env var changes.)
3. Use the [env.get API](https://dev.blues.io/api-reference/notecard-api/env-requests/#env-get) to read the value of the `on` env var, and enable/disable the LED as needed.

Let me know if that doesn’t make sense!

Rob

---

<div class="post-metadata">

**Author:** ![TJK](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJK](https://discuss.blues.com/u/TJK)\
**Post date:** [November 28, 2023, 7:12pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/9 "2023-11-28T19:12:43Z")

</div>

You are right. Thank you. I overlooked that possibility.  
You’re pretty good at this Rob.  
Tom

---

<div class="post-metadata">

**Author:** ![Kachi](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@Kachi](https://discuss.blues.com/u/Kachi)\
**Post date:** [September 10, 2024, 6:52pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/10 "2024-09-10T18:52:27Z")

</div>

Hi Rob, I am in a bit of a pickle here. I have been able to download the Json file from the events tab on notehub, and converted it to CSV. my main challenge is to adequately figure out which data i do need.

Let me explain - currently for example I see  
(body\_pm02\_5), (body\_pm02\_5\_rstd), and (body\_pm02\_5cf1).

which of these headers contain the PM2.5 readings which I can use for my analysis.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [September 16, 2024, 4:24pm UTC](https://discuss.blues.com/t/download-body-data-from-notehub-events/1816/11 "2024-09-16T16:24:23Z")

</div>

Hi @Kachi,

I assume this is related to data from the Airnote project? If so, the first value is the one you care about `body_pm02_5`.

Thanks,  
Rob
