# Usage of buienradar rain prediction

**URL:** https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218
**Category:** General
**Created:** [1 September 2022 13:39 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218 "2022-09-01T13:39:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jos-77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jos-77/32/67190_2.png) [@Jos-77](https://discourse.nodered.org/u/Jos-77)
#### Post date: [1 September 2022 13:39 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/1 "2022-09-01T13:39:38Z")

</div>

I would like to use the Home Assistant Buienradar intergration to calculate the rainfall for 5 days.  
In HA there are rain 1d to rain 5d. if average is \<10 I want my irrigation to run on some days.

And then I run into a problem, what shoud i use? and how to set calculator node

please some help

outputProperties array[3]

0: object  
property: "payload"  
propertyType: "msg"  
value: ""  
valueType: "entityState"

1: object  
property: "data"  
propertyType: "msg"  
value: ""  
valueType: "eventData"

2: object  
property: "topic"  
propertyType: "msg"  
value: ""  
valueType: "triggerId"

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [1 September 2022 14:07 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/2 "2022-09-01T14:07:18Z")

</div>

Hi. As I am sure you can see, that data you posted has nothing useful for us to try and help you.

Could you capture the output data once more but use the built in "Copy Value" button so that usable JSON is copied. You can find this "Copy Value" button by hovering your mouse over the payload.

PS, please always press the `</>` code button in the forum post toolbar BEFORE pasting code - to ensure the code is not corrupted/formatted by the forum.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [1 September 2022 16:24 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/3 "2022-09-01T16:24:29Z")

</div>

I would install the buienradar node in node-red.  
You can get the values, run it through a change node with jsonata to average the data

 ![Screenshot 2022-09-01 at 18.21.41](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1dfad8ac4bd4503653b3841ceeeae9d537017b5.jpeg)

example flow (requires [this node](https://flows.nodered.org/node/node-red-contrib-buienradar) to be installed)

```auto
[{"id":"7cba216f9bea0f5d","type":"buienradar","z":"f8b839d1b6352dff","name":"","station":"6215","interval":"60000","forecast":true,"x":314,"y":96,"wires":[["3f42dc5d8b3da22e","daf8e598e8677e04"]]},{"id":"3f42dc5d8b3da22e","type":"change","z":"f8b839d1b6352dff","name":"get average","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.$average(**.kansregen)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":502,"y":96,"wires":[["0873602b9d3d8a09"]]},{"id":"7a52cd85ee1cfb8e","type":"debug","z":"f8b839d1b6352dff","name":"yes","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":786,"y":72,"wires":[]},{"id":"0873602b9d3d8a09","type":"switch","z":"f8b839d1b6352dff","name":"<10 ?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"10","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":642,"y":96,"wires":[["7a52cd85ee1cfb8e"],["a6cd85a8efca5712"]]},{"id":"a6cd85a8efca5712","type":"debug","z":"f8b839d1b6352dff","name":"no","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":786,"y":120,"wires":[]},{"id":"4398cdd8acb0f2ed","type":"inject","z":"f8b839d1b6352dff","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":156,"y":96,"wires":[["7cba216f9bea0f5d"]]},{"id":"daf8e598e8677e04","type":"debug","z":"f8b839d1b6352dff","name":"yes","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":478,"y":192,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![Jos-77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jos-77/32/67190_2.png) [@Jos-77](https://discourse.nodered.org/u/Jos-77)
#### Post date: [1 September 2022 18:55 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/4 "2022-09-01T18:55:19Z")

</div>

for the buienradar rain 1d to 5d :[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}]

for the calculator these settings.  
|Node|"c4a193f038f5a9ff"|  
|Type|calculator|  
|Module|node-red-contrib-calc|  
|inputMsgField|"eventData"|  
|outputMsgField|"payload"|  
|operation|"avg"|  
|constant|"5"|  
|round|true|  
|decimals|0|

I hope this is what you mean, i cannot find anything else as an output.

---

<div class="post-metadata">

### Author: ![Jos-77](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jos-77/32/67190_2.png) [@Jos-77](https://discourse.nodered.org/u/Jos-77)
#### Post date: [2 September 2022 11:26 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/5 "2022-09-02T11:26:57Z")

</div>

bakman 2

thank you for your help, I've got it working. I also want to use a switch with a if not rule.

Would you be able to help?

rule should be:  
if not switched on by Pomp is ingeschakeld getriggerd door service switch.turn\_on should have an yes and no output

---

<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: [16 September 2022 11:27 UTC](https://discourse.nodered.org/t/usage-of-buienradar-rain-prediction/67218/6 "2022-09-16T11:27:02Z")

</div>

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