# Payload Timer preferably with UI

**URL:** <https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733>\
**Category:** General\
**Created:** [31 May 2019 16:55 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733 "2019-05-31T16:55:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ianszh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ianszh/32/8897_2.png) [@Ianszh](https://discourse.nodered.org/u/Ianszh)\
**Post date:** [31 May 2019 16:55 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/1 "2019-05-31T16:55:03Z")

</div>

Hello,

I have built yet another watering system which has 4 capacitive moisture sensors, 4 water solenoids, 1 pump, and 5 relays.

Everything's working fine, the "brains" is Node Red and I'm sending the sensor readings and relay "triggers" via MQTT to a ESP32. I now would like to add a timer to each relay channel so I keep the sensor readings, but "block" the MQTT messages to the relays via the timer.

So, the message only gets sent between say 07:00 and 08:00. I've looked into BigTimer but that can only output a msg. I would like to pass on a payload msg. where necessary between the "on" times.

Preferably there could be 2 timers and a UI interface.

Does anyone know such a timer exists or would this need function?

Regards  
Ian

---

<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:** [31 May 2019 17:37 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/2 "2019-05-31T17:37:04Z")

</div>

If I'm reading this right, you want to inhibit messages between certain times?

Off the top of my head you could use a function node and return null if the current time is \< 7am or \> 8am otherwise return the msg.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [31 May 2019 17:54 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/3 "2019-05-31T17:54:19Z")

</div>

Perhaps the within-time node?

> **[node-red-contrib-sun-position](https://flows.nodered.org/node/node-red-contrib-sun-position#within-time)**
>
> NodeRED nodes to get sun and moon position

---

<div class="post-metadata">

**Author:** ![Ianszh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ianszh/32/8897_2.png) [@Ianszh](https://discourse.nodered.org/u/Ianszh)\
**Post date:** [31 May 2019 17:56 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/4 "2019-05-31T17:56:08Z")

</div>

Yes that's correct.

I take it it would be possible to enter the given times through a numeric Ui input?

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [31 May 2019 17:57 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/5 "2019-05-31T17:57:55Z")

</div>

Plenty of ideas here:

> [@Switch Node with time](https://discourse.nodered.org/t/switch-node-with-time/4185):
>
> Hi I am looking for a node that can pass or block depending on the day of week and between two times and if the week is odd or even. A switch Node would work if it had selections for odd or even week numbers and select a time frame for example from 11Am to 1Pm.

---

<div class="post-metadata">

**Author:** ![Ianszh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ianszh/32/8897_2.png) [@Ianszh](https://discourse.nodered.org/u/Ianszh)\
**Post date:** [31 May 2019 18:08 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/6 "2019-05-31T18:08:46Z")

</div>

Thanks I already have the within time node, I'll try it out.

As with your other suggestion I would still like to have a UI interface for it though.

---

<div class="post-metadata">

**Author:** ![Ianszh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ianszh/32/8897_2.png) [@Ianszh](https://discourse.nodered.org/u/Ianszh)\
**Post date:** [31 May 2019 18:58 UTC](https://discourse.nodered.org/t/payload-timer-preferably-with-ui/11733/7 "2019-05-31T18:58:29Z")

</div>

The within time node works great!
