node-red-contrib-get-oura-data
v1.6.2
Published
Get client data from Oura API
Downloads
14
Readme
node-red-contrib-get-oura-data
How to Install
Run this in your ~/.node-red
npm install node-red-contrib-get-oura-data
Description:
This node using Oura API to get data of Oura ring user.
- Input: user account personal access token (mandatory), timestamp (optional).
- Output: User data of selected fields: Daily Activity, Heart Rate, Personal Info, Readiness Summaries, Session, Sleep Period, Tag, Workouts...
Supports:
- Node.js v 11.15.x
- Node-Red v 1.0.5
How to use:
- Create flow and add this node between an inject node and a debug node.
- Add Personal Access Token of your Oura account to field "Token".
- Choose which field of data you want to get.
- Inject and you can get your data in debug node.
Specify time:
By default, if the node can't find "End Date", it will be set to current day, if no "Start Date" specified, it will be set to one week before "End Date".
You can specify dates in many formats, as long as they start with year/month/day, you can specify dates in node Oura or add dates to inject node with msg.payload -> string (node will NOT work with timestamp), node will separate "Start Date" and "End Date" by the comma (,), if there is no comma, node will take it as "Start Date", and if you want to specify "End Date", put a comma at the beginning.
E.g:
- 2022/06/01
- 22/6/1
- 2022/05/31,2022/06/01
- 22/5/31,2022-06-01T12:21:00+09:00
- ,21/11/30
- 2000-04-21T12:21:00+09:00
As long as there is date specified in the inject node, they will override the dates of Oura node, even if they are auto-generated
Notice:
Ouraring V2 API: Daily Activity return 1 day earlier than specified "End Date", this is due to Oura API functioning, not the node bug.
Example Flow
[
{
"id": "195dda2d953fcef6",
"type": "tab",
"label": "Ouraring Example Flow",
"disabled": false,
"info": "",
"env": []
},
{
"id": "5fe0716b52718c13",
"type": "inject",
"z": "195dda2d953fcef6",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 110,
"y": 100,
"wires": [
[
"23ef0e47a4c81265"
]
]
},
{
"id": "8ef85d83fae66246",
"type": "debug",
"z": "195dda2d953fcef6",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 260,
"wires": []
},
{
"id": "23ef0e47a4c81265",
"type": "Oura",
"z": "195dda2d953fcef6",
"token": "",
"apiVer": "v2",
"dataTypeV1": "activity",
"dataTypeV2": "daily_activity",
"startTime": "2022/05/11",
"endTime": "2022/05/14",
"name": "",
"x": 220,
"y": 180,
"wires": [
[
"8ef85d83fae66246"
]
]
}
]