# Smart irrigation - Miflora plus 12v relay -

**URL:** <https://discourse.nodered.org/t/smart-irrigation-miflora-plus-12v-relay/35636>\
**Category:** General\
**Created:** [9 November 2020 22:43 UTC](https://discourse.nodered.org/t/smart-irrigation-miflora-plus-12v-relay/35636 "2020-11-09T22:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_uk](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Sam\_uk](https://discourse.nodered.org/u/Sam_uk)\
**Post date:** [9 November 2020 22:43 UTC](https://discourse.nodered.org/t/smart-irrigation-miflora-plus-12v-relay/35636/1 "2020-11-09T22:43:26Z")

</div>

So I'm building an irrigation system which turns on when the value received from a Miflora is \<20

So far I have:  
Pi connected to a relay and a Node-red flow that opens or closes the relays  
Miflora readings coming in from [https://flows.nodered.org/node/node-red-contrib-xiaomi-ble](https://flows.nodered.org/node/node-red-contrib-xiaomi-ble)  
I've set up a dashboard and have gauges showing {{payload.moisture}}

What I want to do next is turn on the relay when {{payload.moisture}} \<20 I guess I need a 'function'? How would you do this?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 November 2020 23:48 UTC](https://discourse.nodered.org/t/smart-irrigation-miflora-plus-12v-relay/35636/2 "2020-11-09T23:48:59Z")

</div>

probably start by looking at the change function, and maybe the RBE node to stop repeatedly sending the same message.  
And the [Node-RED Essential channel](https://www.youtube.com/watch?v=ksGeUD26Mw0&ab_channel=Node-RED) is probably 30 minutes well spent.

---

<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:** [8 January 2021 23:49 UTC](https://discourse.nodered.org/t/smart-irrigation-miflora-plus-12v-relay/35636/3 "2021-01-08T23:49:02Z")

</div>

Closed on 8 January 2021 23:49 UTC

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