Last active
September 27, 2021 08:57
-
-
Save albizan/a5bb5286254c870fe4031b7ddd8c4f24 to your computer and use it in GitHub Desktop.
Google Sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"c6e7e594.441748","type":"mqtt in","z":"8a89e69f.375608","name":"","topic":"/itsDataDouble","qos":"2","datatype":"json","broker":"23789271.e54d6e","nl":false,"rap":true,"rh":0,"x":360,"y":260,"wires":[["22eaad4b.398232"]]},{"id":"22eaad4b.398232","type":"function","z":"8a89e69f.375608","name":"","func":"const today = new Date();\nconst year = today.getFullYear();\nconst month = today.getMonth() + 1 // January is 0, WTF Javascript\nconst day = today.getDate();\nconst time = `${today.getHours()}:${today.getMinutes()}:${today.getSeconds()}`;\nconst fullDate = `${day}/${month}/${year}`;\nconst result = [];\n\n// Push date\nresult.push(`${fullDate} - ${time}`);\n\n// Push humidity value\nresult.push(msg.payload.val1.toFixed(2) + \" bar\")\n\n// Push temperature\nresult.push(msg.payload.val2.toFixed(2) + \"°\")\n\n\n//msg.payload =`${fullDate} ${time} - HUM: ${msg.payload.val1.toFixed(2)} bar - TEMP: ${msg.payload.val2.toFixed(2)}°`\nmsg.payload = result;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":260,"wires":[["4f682d2b.7855b4","2d016c0.f5cd094"]]},{"id":"4f682d2b.7855b4","type":"GSheet","z":"8a89e69f.375608","creds":"11076975.d43f17","method":"append","action":"","sheet":"1EruWR_LY-uEZm6pmXUPyq4OWaI7JhBmJYm6E9tbetRw","cells":"Foglio3!A2","flatten":false,"name":"Google Sheet","x":880,"y":260,"wires":[[]]},{"id":"2d016c0.f5cd094","type":"debug","z":"8a89e69f.375608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":160,"wires":[]},{"id":"23789271.e54d6e","type":"mqtt-broker","name":"HIVEMQ","broker":"broker.hivemq.com","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"11076975.d43f17","type":"gauth"}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment