# 3 temperature Output calculate AVG

**URL:** <https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806>\
**Category:** General\
**Created:** [8 January 2021 19:16 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806 "2021-01-08T19:16:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [8 January 2021 19:16 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/1 "2021-01-08T19:16:52Z")

</div>

Hello  
i have this script

```auto
[{"id":"88e25ccc.26438","type":"inject","z":"3ddc05.29f503fc","name":"20min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1380,"wires":[["6e9bd378.23487c","6b1bf86a.7f7d68","1c54e009.db931"]]},{"id":"6e9bd378.23487c","type":"http request","z":"3ddc05.29f503fc","name":"station=WYN","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=WYN","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1320,"wires":[["9cc540f5.dcb39"]]},{"id":"9cc540f5.dcb39","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.WYN","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1320,"wires":[["cc0cee7c.d7fcf"]]},{"id":"cc0cee7c.d7fcf","type":"function","z":"3ddc05.29f503fc","name":"","func":"msg.payload = {\nTemperatur: msg.payload.temperature\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":1320,"wires":[["84c8f28.bc2491"]]},{"id":"84c8f28.bc2491","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1020,"y":1320,"wires":[]},{"id":"6b1bf86a.7f7d68","type":"http request","z":"3ddc05.29f503fc","name":"station=GOE","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=GOE","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1460,"wires":[["625b3202.b68ebc"]]},{"id":"625b3202.b68ebc","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.GOE","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1460,"wires":[["4eba41c.51e9ec"]]},{"id":"4eba41c.51e9ec","type":"function","z":"3ddc05.29f503fc","name":"","func":"msg.payload = {\nTemperatur: msg.payload.temperature\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":1460,"wires":[["8174003a.08764"]]},{"id":"8174003a.08764","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1020,"y":1460,"wires":[]},{"id":"1c54e009.db931","type":"http request","z":"3ddc05.29f503fc","name":"station=EGO","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=EGO","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1600,"wires":[["6411ddf2.fed4c4"]]},{"id":"6411ddf2.fed4c4","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.EGO","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1600,"wires":[["33488a96.e7ce16"]]},{"id":"33488a96.e7ce16","type":"function","z":"3ddc05.29f503fc","name":"","func":"msg.payload = {\nTemperatur: msg.payload.temperature\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":1600,"wires":[["b1e7633b.51ceb"]]},{"id":"b1e7633b.51ceb","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1020,"y":1600,"wires":[]}]

```

at the end i wish to have a AVG of this 3 Temperature is there a node for?

have a nice day  
vinc

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [8 January 2021 19:39 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/2 "2021-01-08T19:39:17Z")

</div>

this would put out the pure number

```auto
[{"id":"88e25ccc.26438","type":"inject","z":"3ddc05.29f503fc","name":"20min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1380,"wires":[["6e9bd378.23487c","6b1bf86a.7f7d68","1c54e009.db931"]]},{"id":"6e9bd378.23487c","type":"http request","z":"3ddc05.29f503fc","name":"station=WYN","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=WYN","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1320,"wires":[["9cc540f5.dcb39"]]},{"id":"9cc540f5.dcb39","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.WYN","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1320,"wires":[["35fe931b.1e9f4c"]]},{"id":"84c8f28.bc2491","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1140,"y":1320,"wires":[]},{"id":"6b1bf86a.7f7d68","type":"http request","z":"3ddc05.29f503fc","name":"station=GOE","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=GOE","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1460,"wires":[["625b3202.b68ebc"]]},{"id":"625b3202.b68ebc","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.GOE","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1460,"wires":[["2c6cd741.c58848"]]},{"id":"8174003a.08764","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":1460,"wires":[]},{"id":"1c54e009.db931","type":"http request","z":"3ddc05.29f503fc","name":"station=EGO","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=EGO","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1600,"wires":[["6411ddf2.fed4c4"]]},{"id":"6411ddf2.fed4c4","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.EGO","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1600,"wires":[["a7fba2a9.073c6"]]},{"id":"b1e7633b.51ceb","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":1600,"wires":[]},{"id":"35fe931b.1e9f4c","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1320,"wires":[["84c8f28.bc2491"]]},{"id":"2c6cd741.c58848","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1460,"wires":[["8174003a.08764"]]},{"id":"a7fba2a9.073c6","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1600,"wires":[["b1e7633b.51ceb"]]}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2021 21:03 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/3 "2021-01-08T21:03:33Z")

</div>

Just join messages and calculate.  
eg

```auto
[{"id":"d887e9ed.a49db","type":"inject","z":"8d22ae29.7df6d","name":"20min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":3120,"wires":[["53948fac.5dcf28","2e4dde11.fd7182","573d4135.dc548"]]},{"id":"53948fac.5dcf28","type":"http request","z":"8d22ae29.7df6d","name":"station=WYN","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=WYN","tls":"","persist":false,"proxy":"","authType":"","x":290,"y":3040,"wires":[["b1b996b4.d5c79"]]},{"id":"2e4dde11.fd7182","type":"http request","z":"8d22ae29.7df6d","name":"station=GOE","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=GOE","tls":"","persist":false,"proxy":"","authType":"","x":290,"y":3180,"wires":[["61d7e41.b07f81c"]]},{"id":"573d4135.dc548","type":"http request","z":"8d22ae29.7df6d","name":"station=EGO","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=EGO","tls":"","persist":false,"proxy":"","authType":"","x":290,"y":3320,"wires":[["deb0f682.82ed18"]]},{"id":"b1b996b4.d5c79","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.WYN.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"WYN","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":3080,"wires":[["ec4642fa.e3c88"]]},{"id":"61d7e41.b07f81c","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.GOE.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"GOE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":3220,"wires":[["ec4642fa.e3c88"]]},{"id":"deb0f682.82ed18","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.EGO.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"EGO","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":3360,"wires":[["ec4642fa.e3c88"]]},{"id":"ec4642fa.e3c88","type":"join","z":"8d22ae29.7df6d","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":490,"y":3220,"wires":[["381e1787.e82f","f678b54a.3d1f9"]]},{"id":"381e1787.e82f","type":"function","z":"8d22ae29.7df6d","name":"","func":"msg.payload.average=Math.round((Object.values(msg.payload).reduce((pv, cv) => pv + cv, 0)/Object.keys(msg.payload).length)*100)/100;\nlet msg1={topic:\"WYM\",payload:{Temperatur:msg.payload.WYN,average:msg.payload.average}},\n msg2={topic:\"EGO\",payload:{Temperatur:msg.payload.EGO,average:msg.payload.average}},\n msg3={topic:\"GOE\",payload:{Temperatur:msg.payload.GOE,average:msg.payload.average}};\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"initialize":"","finalize":"","x":610,"y":3300,"wires":[["d74e5b2e.aa5e58"],["6a78b0e8.cef2d"],["547c4890.835b68"]]},{"id":"f678b54a.3d1f9","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":3140,"wires":[]},{"id":"6a78b0e8.cef2d","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"msg","x":810,"y":3240,"wires":[]},{"id":"547c4890.835b68","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":810,"y":3320,"wires":[]},{"id":"d74e5b2e.aa5e58","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":810,"y":3160,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [8 January 2021 21:26 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/4 "2021-01-08T21:26:37Z")

</div>

thanks a lot @E1cid  
yes there is the needed average, i just try to modifie it to have just one output

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2021 21:35 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/5 "2021-01-08T21:35:39Z")

</div>

```auto
[{"id":"5ec6038e.3eba4c","type":"http request","z":"8d22ae29.7df6d","name":"station=GOE","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=GOE","tls":"","persist":false,"proxy":"","authType":"","x":110,"y":3140,"wires":[["93919ca1.6a47e8"]]},{"id":"7b2ec319.a6d86c","type":"inject","z":"8d22ae29.7df6d","name":"20min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":3080,"wires":[["4d22a18d.0aaac8","5ec6038e.3eba4c","d7a0c0d7.983398"]]},{"id":"93919ca1.6a47e8","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.GOE.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"GOE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":120,"y":3180,"wires":[["ed766a7a.ccab78"]]},{"id":"4d22a18d.0aaac8","type":"http request","z":"8d22ae29.7df6d","name":"station=WYN","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=WYN","tls":"","persist":false,"proxy":"","authType":"","x":110,"y":3000,"wires":[["3e139f4d.4fb7b8"]]},{"id":"d7a0c0d7.983398","type":"http request","z":"8d22ae29.7df6d","name":"station=EGO","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=EGO","tls":"","persist":false,"proxy":"","authType":"","x":110,"y":3280,"wires":[["f077acd3.279a7"]]},{"id":"ed766a7a.ccab78","type":"join","z":"8d22ae29.7df6d","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":310,"y":3180,"wires":[["7dacb35.e6ca54c"]]},{"id":"3e139f4d.4fb7b8","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.WYN.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"WYN","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":120,"y":3040,"wires":[["ed766a7a.ccab78"]]},{"id":"f077acd3.279a7","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.EGO.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"EGO","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":120,"y":3320,"wires":[["ed766a7a.ccab78"]]},{"id":"7dacb35.e6ca54c","type":"change","z":"8d22ae29.7df6d","name":"","rules":[{"t":"set","p":"payload.average","pt":"msg","to":"$round($sum(payload.*)/$count($keys(payload)),2)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":3180,"wires":[["41b8718c.c4bf78"]]},{"id":"41b8718c.c4bf78","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":3140,"wires":[]}]

```

all values are in msg.payload

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [8 January 2021 21:53 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/6 "2021-01-08T21:53:23Z")

</div>

have also done something, it works but will not get a price for it 😉

```auto
[{"id":"88e25ccc.26438","type":"inject","z":"3ddc05.29f503fc","name":"20min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1380,"wires":[["6e9bd378.23487c","6b1bf86a.7f7d68","1c54e009.db931"]]},{"id":"6e9bd378.23487c","type":"http request","z":"3ddc05.29f503fc","name":"station=WYN","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=WYN","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1320,"wires":[["9cc540f5.dcb39"]]},{"id":"9cc540f5.dcb39","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.WYN.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":1320,"wires":[["84c8f28.bc2491","3255d1fa.3cf55e"]]},{"id":"84c8f28.bc2491","type":"debug","z":"3ddc05.29f503fc","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1140,"y":1320,"wires":[]},{"id":"6b1bf86a.7f7d68","type":"http request","z":"3ddc05.29f503fc","name":"station=GOE","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=GOE","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1460,"wires":[["625b3202.b68ebc"]]},{"id":"625b3202.b68ebc","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.GOE.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":1460,"wires":[["8174003a.08764","3255d1fa.3cf55e"]]},{"id":"8174003a.08764","type":"debug","z":"3ddc05.29f503fc","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":1460,"wires":[]},{"id":"1c54e009.db931","type":"http request","z":"3ddc05.29f503fc","name":"station=EGO","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://app-prod-ws.meteoswiss-app.ch/v1/stationOverview?station=EGO","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":1600,"wires":[["7b689079.80ce3"]]},{"id":"b1e7633b.51ceb","type":"debug","z":"3ddc05.29f503fc","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":1600,"wires":[]},{"id":"3255d1fa.3cf55e","type":"join","z":"3ddc05.29f503fc","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":930,"y":1400,"wires":[["cffd5dc2.cad0d"]]},{"id":"6c921b40.2a0964","type":"debug","z":"3ddc05.29f503fc","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1440,"y":1400,"wires":[]},{"id":"cffd5dc2.cad0d","type":"function","z":"3ddc05.29f503fc","name":"","func":"msg.payload.average=Math.round((Object.values(msg.payload).reduce((pv, cv) => pv + cv, 0)/Object.keys(msg.payload).length)*100)/100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1080,"y":1400,"wires":[["daa29728.de9038"]]},{"id":"daa29728.de9038","type":"function","z":"3ddc05.29f503fc","name":"","func":"msg.payload = {\naverage: msg.payload.average\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":1400,"wires":[["6c921b40.2a0964"]]},{"id":"7b689079.80ce3","type":"change","z":"3ddc05.29f503fc","name":"","rules":[{"t":"move","p":"payload.EGO.temperature","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":1600,"wires":[["b1e7633b.51ceb","8174003a.08764","3255d1fa.3cf55e"]]}]

```

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [8 January 2021 22:02 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/7 "2021-01-08T22:02:20Z")

</div>

i took 3 station around the area i live, because the mqtt input from 344MHz device on my balcon - don't go down enough because it is to much protected. so i got a idea what really is outside!  
just freezing to read the output 😉

and a next step will be get a Telegram Information to take care !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 March 2021 22:02 UTC](https://discourse.nodered.org/t/3-temperature-output-calculate-avg/38806/8 "2021-03-09T22:02:34Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
