2017-04-03, 12:22 AM
set json path in node-red to $.updates..values[?(@.path=="environment.water.temperature")]..value this will output temp in K
[
{
"id": "fc84cccf.b90698",
"type": "jsonpath",
"z": "ad773e6c.c040d",
"expression": "$.updates..values[?(@.path==\"environment.water.temperature\")]..value",
"split": true,
"name": "watertemp",
"x": 350,
"y": 580,
"wires": [
[
"7d3d63e4.1727d4"
]
]
},
{
"id": "f991b1e7.ef9748",
"type": "function",
"z": "ad773e6c.c040d",
"name": "KelvintC2",
"func": "msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;",
"outputs": "1",
"noerr": 0,
"x": 520,
"y": 580,
"wires": [
[
"d6c718f7.0949e",
"ff26732b.c64298"
]
]
},
{
"id": "d6c718f7.0949e",
"type": "ui_text",
"z": "ad773e6c.c040d",
"group": "ce804676.cbb9e",
"order": 1,
"width": "4",
"height": "1",
"name": "",
"label": "outSide Temperature",
"format": "{{msg.payload}}C",
"layout": "row-left",
"x": 700,
"y": 600,
"wires": []
},
{
"id": "ce804676.cbb9e",
"type": "ui_group",
"z": "",
"name": "Weather",
"tab": "4c2b5852.80dfe",
"order": 1,
"disp": true,
"width": "16"
},
{
"id": "4c2b5852.80dfe",
"type": "ui_tab",
"z": "",
"name": "Weather",
"icon": "dashboard",
"order": 1
}
]
[
{
"id": "fc84cccf.b90698",
"type": "jsonpath",
"z": "ad773e6c.c040d",
"expression": "$.updates..values[?(@.path==\"environment.water.temperature\")]..value",
"split": true,
"name": "watertemp",
"x": 350,
"y": 580,
"wires": [
[
"7d3d63e4.1727d4"
]
]
},
{
"id": "f991b1e7.ef9748",
"type": "function",
"z": "ad773e6c.c040d",
"name": "KelvintC2",
"func": "msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;",
"outputs": "1",
"noerr": 0,
"x": 520,
"y": 580,
"wires": [
[
"d6c718f7.0949e",
"ff26732b.c64298"
]
]
},
{
"id": "d6c718f7.0949e",
"type": "ui_text",
"z": "ad773e6c.c040d",
"group": "ce804676.cbb9e",
"order": 1,
"width": "4",
"height": "1",
"name": "",
"label": "outSide Temperature",
"format": "{{msg.payload}}C",
"layout": "row-left",
"x": 700,
"y": 600,
"wires": []
},
{
"id": "ce804676.cbb9e",
"type": "ui_group",
"z": "",
"name": "Weather",
"tab": "4c2b5852.80dfe",
"order": 1,
"disp": true,
"width": "16"
},
{
"id": "4c2b5852.80dfe",
"type": "ui_tab",
"z": "",
"name": "Weather",
"icon": "dashboard",
"order": 1
}
]