I have created an example to give you some hints, how you can do this in node-red.
The idea is: every 10 minutes, store the netatmo data into a flow variable called weather
.
Once a week (or how often you want to mow) the mowing flow starts; it reads a variable: isMowing
, if it does not exist, check the humidity, check temperature (both from the weather
variable), if they are all within the set range, then isMowing
is set to true. So whenever you execute the mowing flow it will not execute again because the variable is still set.
The start mowing
node should be followed with http request node that actually calls your mower to start.
When it finishes or stops, delete the isMowing
variable.
This should work. One element is not covered and that is, when the parameters are not met, it will wait for a week (as it is scheduled for once a week), that part can be tweaked as well. I can help if needed.
[{"id":"4e050629.42e69","type":"get stations data","z":"105aec4b.40c1dc","name":"","creds":"e4672ecc.8be048","x":330,"y":96,"wires":[["79ee6615.1f8dd"]]},{"id":"d3473ea6.1c3c78","type":"inject","z":"105aec4b.40c1dc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":142,"y":96,"wires":[["4e050629.42e69"]]},{"id":"79ee6615.1f8dd","type":"change","z":"105aec4b.40c1dc","name":"","rules":[{"t":"set","p":"weather","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":536,"y":96,"wires":[[]]},{"id":"12df6adc.ecc82d","type":"inject","z":"105aec4b.40c1dc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * 1","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":142,"y":168,"wires":[["cd3472c5.38cef8"]]},{"id":"cd3472c5.38cef8","type":"switch","z":"105aec4b.40c1dc","name":"Is Mowing ?","property":"isMowing","propertyType":"flow","rules":[{"t":"null"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":168,"wires":[["c1141b52.d59738"]]},{"id":"11592b8e.ea0b1c","type":"debug","z":"105aec4b.40c1dc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1198,"y":168,"wires":[]},{"id":"c1141b52.d59738","type":"switch","z":"105aec4b.40c1dc","name":"Humidity <85% ?","property":"weather.devices[0].modules[0].dashboard_data.Humidity","propertyType":"flow","rules":[{"t":"lt","v":"85","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":498,"y":168,"wires":[["a06e9e91.e7b9b8"]]},{"id":"a06e9e91.e7b9b8","type":"switch","z":"105aec4b.40c1dc","name":"Temperature > 10°C and < 26°C?","property":"weather.devices[0].modules[0].dashboard_data.min_temp","propertyType":"flow","rules":[{"t":"btwn","v":"10","vt":"num","v2":"26","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":764,"y":168,"wires":[["943e52e.5dc9bb"]]},{"id":"943e52e.5dc9bb","type":"change","z":"105aec4b.40c1dc","name":"Start mowing","rules":[{"t":"set","p":"payload","pt":"msg","to":"Mowing Started","tot":"str"},{"t":"set","p":"isMowing","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1006,"y":168,"wires":[["11592b8e.ea0b1c"]]},{"id":"e4672ecc.8be048","type":"configNode","z":"","client_id":"5d50f741affea00015220661","client_secret":"PG2kN7CYYNF5stStc7xw0Nd4RAB9pXB01Zdknoz66FVN6","username":"richardbakker@me.com","password":"Swhqnl51va","device_id":"70:ee:50:13:50:28"}]
Note that I used the data from my own netatmo, i dont have a rain module, you should match the object details with your own data.
This is just an idea how you can solve these types of flows.