# Fan control with condition

**URL:** <https://discourse.nodered.org/t/fan-control-with-condition/38141>\
**Category:** Developing Nodes\
**Created:** [28 December 2020 15:45 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141 "2020-12-28T15:45:35Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 December 2020 21:08 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/21 "2020-12-29T21:08:42Z")

</div>

import again as i updated the function the edit was to tell you i edited it.

My input in the inject nodes are set to json and the values are Intergers not strings, i copied and pasted your json.

also if you say something is not working after you edited it, it would be best to post the changed code. Then we could see what you did, rather than guess.

---

<div class="post-metadata">

**Author:** ![Deathsoul](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@Deathsoul](https://discourse.nodered.org/u/Deathsoul)\
**Post date:** [29 December 2020 22:10 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/22 "2020-12-29T22:10:11Z")

</div>

Ok, it works if when I it ''Deploy''  
If I change something in my input from Lovelace, I saw the value of my even state changing, but it seem the data doesn't updated in the function, I presume I have to do something in my joint node...

---

<div class="post-metadata">

**Author:** ![Deathsoul](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@Deathsoul](https://discourse.nodered.org/u/Deathsoul)\
**Post date:** [29 December 2020 22:14 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/23 "2020-12-29T22:14:04Z")

</div>

it look to be ''and every subsequent message.'' the have a 20 secondes of delay but seems to works now...

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 December 2020 22:20 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/24 "2020-12-29T22:20:34Z")

</div>

Join nodes can be tricky as the messges may not come in the sequence you think, I find it better to store the values in context when they update, then when a trigger (value or time) updates you just read all current values from context.

---

<div class="post-metadata">

**Author:** ![Deathsoul](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@Deathsoul](https://discourse.nodered.org/u/Deathsoul)\
**Post date:** [29 December 2020 22:27 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/25 "2020-12-29T22:27:49Z")

</div>

I had in mind to add a LOOPTIMER to have the data validated at regular intervals, but this may not be the best way to do it ...

---

<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:** [27 February 2021 22:27 UTC](https://discourse.nodered.org/t/fan-control-with-condition/38141/26 "2021-02-27T22:27:53Z")

</div>

Closed on 27 February 2021 22:27 UTC

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

[Previous page](https://discourse.nodered.org/t/fan-control-with-condition/38141.md?page=1)
