var battery; // battery voltage data
var int_humidity; // humidity data from within the sensor housing
var ext_temp; // external temperature data
var int_temp; // temperature data from within the sensor housing
battery = msg.payload.uplink_message.decoded_payload.bat;
int_humidity = msg.payload.uplink_message.decoded_payload.humid;
ext_temp = msg.payload.uplink_message.decoded_payload.onewire_temp;
int_temp = msg.payload.uplink_message.decoded_payload.temp;
msg.payload = "bat=" + String(battery) + "&"
+ "intHumid=" + String(int_humidity) + "&"
+ "extTemp=" + String(ext_temp) + "&"
+ "intTemp=" + String(int_temp) + "&"
+ "date=" + String(msg.myymd) + " " + String(msg.mytimes);
msg.url = "https://dweet.io/dweet/for/<My_Dweet_address>?" + msg.payload;
// check dweet with - https://dweet.io/get/latest/dweet/for/<My_Dweet_address>
return msg;
[
{
"id": "4a48c27d77b24951",
"type": "tab",
"label": "Tiny house 12",
"disabled": false,
"info": "",
"env": []
},
{
"id": "9eb5f086aba506f2",
"type": "mqtt in",
"z": "4a48c27d77b24951",
"name": "whi-tinyhouse-12",
"topic": "#",
"qos": "0",
"datatype": "json",
"broker": "770475c1.8593ac",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 100,
"y": 60,
"wires": [
[
"611459927e315292"
]
]
},
{
"id": "1b6fa839582e5f27",
"type": "debug",
"z": "4a48c27d77b24951",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 660,
"y": 200,
"wires": []
},
{
"id": "42efdbdb620f1c41",
"type": "function",
"z": "4a48c27d77b24951",
"name": "process tiny house 12 data",
"func": "var battery; // battery voltage data\nvar int_humidity; // humidity data from within the sensor housing\nvar ext_temp; // external temperature data\nvar int_temp; // temperature data from within the sensor housing\n\nbattery = msg.payload.uplink_message.decoded_payload.bat;\nint_humidity = msg.payload.uplink_message.decoded_payload.humid;\next_temp = msg.payload.uplink_message.decoded_payload.onewire_temp;\nint_temp = msg.payload.uplink_message.decoded_payload.temp;\n\nmsg.payload = \"bat=\" + String(battery) + \"&\"\n + \"intHumid=\" + String(int_humidity) + \"&\"\n + \"extTemp=\" + String(ext_temp) + \"&\"\n + \"intTemp=\" + String(int_temp) + \"&\"\n + \"date=\" + String(msg.myymd) + \" \" + String(msg.mytimes);\n\nmsg.url = \"https://dweet.io/dweet/for/SMC-Tiny-House-12-bundoora?\" + msg.payload;\n\n// check dweet with - https://dweet.io/get/latest/dweet/for/<My_Dweet_address>\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 120,
"wires": [
[
"510be4e1f5acfe72"
]
]
},
{
"id": "611459927e315292",
"type": "simpletime",
"z": "4a48c27d77b24951",
"name": "",
"mydate": true,
"myymd": true,
"myyear": true,
"mymonth": true,
"mymonthn": true,
"mydom": true,
"mydoy": true,
"myday": true,
"myhourpm": true,
"myhour": true,
"mytime": true,
"mytimes": true,
"myminute": true,
"myminutes": true,
"mysecond": true,
"mymillis": true,
"myepoch": true,
"myrawdate": true,
"mypm": true,
"x": 290,
"y": 60,
"wires": [
[
"42efdbdb620f1c41",
"98d5072b7123bd5f"
]
]
},
{
"id": "98d5072b7123bd5f",
"type": "debug",
"z": "4a48c27d77b24951",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 680,
"y": 60,
"wires": []
},
{
"id": "510be4e1f5acfe72",
"type": "http request",
"z": "4a48c27d77b24951",
"name": "dweet tiny house 12 data",
"method": "POST",
"ret": "obj",
"paytoqs": "body",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 410,
"y": 200,
"wires": [
[
"1b6fa839582e5f27"
]
]
},
{
"id": "770475c1.8593ac",
"type": "mqtt-broker",
"name": "whi-tinyhouse-12",
"broker": "au1.cloud.thethings.network",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]