# Controlling a device based on 2 inputs

**URL:** https://discourse.nodered.org/t/controlling-a-device-based-on-2-inputs/35892
**Category:** General
**Created:** [13 November 2020 20:50 UTC](https://discourse.nodered.org/t/controlling-a-device-based-on-2-inputs/35892 "2020-11-13T20:50:15Z")
**Posts on this page:** 1
**Showing post:** 33

<div class="post-metadata">

### Author: ![alex88](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alex88/32/55523_2.png) [@alex88](https://discourse.nodered.org/u/alex88)
#### Post date: [21 November 2020 10:48 UTC](https://discourse.nodered.org/t/controlling-a-device-based-on-2-inputs/35892/33 "2020-11-21T10:48:23Z")

</div>

> [@mintgroen](#):
>
> Temperatures don't fluctuate that much so I set the injects to one minute interval, more that sufficient for the heater.

I was directed to this post by @krambriw from one that I just wrote last night here:

> [@Heating panel from scratch](https://discourse.nodered.org/t/heating-panel-from-scratch/36269):
>
> I've been reading the forum but can't find anyone that has built a complete heating panel from scratch in NR. I'm going to move all my home heating from my Fibaro HC2 to Node RED and TBH I already have a plan on how to do it that will work fine. I recently built a panel to control my instant hot water which in a sense is a simple heating panel, and it works fine. I'm just interested to see if anyone else has done it before to see if I can pick up any nice ideas. I get this is a very broad qu…

I'm sure you guys have considered this already, but with the instant hot water panel that I have recently built, I have my main engine (which runs in a NR function node) also trigger every one minute, like @mintgroen suggested , this is perfectly adequate for heating IMHO, however I also added 3x more triggers to run the engine more frequently:

1. if a temp value changes
2. if a pump status changes ie. someone overrode a pump from another interface
3. if a user changes any config from the VueJS/uibuilder interface

With the above 3x triggers it means that the panel runs "instantly" from the users perspective ie.. if you change a temp setpoint or turn a zone on/off, you see the action executed within less than a second of making the change....

I have not read this entire thread, so apologies if you have covered the above off, but I thought I'd share this as it seemed like a good idea to me to implement it at the time.

---

_[View the full topic](https://discourse.nodered.org/t/controlling-a-device-based-on-2-inputs/35892)._
