# New to NodeRed and Hassio, need basic help

**URL:** <https://discourse.nodered.org/t/new-to-nodered-and-hassio-need-basic-help/13191>\
**Category:** General\
**Created:** [11 July 2019 19:25 UTC](https://discourse.nodered.org/t/new-to-nodered-and-hassio-need-basic-help/13191 "2019-07-11T19:25:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ancan](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ancan](https://discourse.nodered.org/u/ancan)\
**Post date:** [11 July 2019 19:25 UTC](https://discourse.nodered.org/t/new-to-nodered-and-hassio-need-basic-help/13191/1 "2019-07-11T19:25:14Z")

</div>

Anybody that can tell me how to accomplish this easy thing.

Got temperature sensor outside and inside, and a switch that is turning on and off a fan.

If outside temp is below 19 celcius and inside is over 20 celcius turn on fan if its off but only between 10:00 and 22:30 otherwise turn of fan of its on.

With this in place I think I will be able to understand a lot better how it works.

Thanks in advance  
Andreas

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [11 July 2019 19:31 UTC](https://discourse.nodered.org/t/new-to-nodered-and-hassio-need-basic-help/13191/2 "2019-07-11T19:31:35Z")

</div>

step1 is to get the data into Node-RED

When you’ve done that there’s a flow in the cookbook which will help you ….  
[https://cookbook.nodered.org/basic/route-on-context](https://cookbook.nodered.org/basic/route-on-context)

The best way to learn Node-RED is to have a go and play. Using debug nodes to understand what is happening

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [11 July 2019 21:48 UTC](https://discourse.nodered.org/t/new-to-nodered-and-hassio-need-basic-help/13191/3 "2019-07-11T21:48:20Z")

</div>

So i assume you want to handle all the logic in Node-red for information flow and just leave HassIo and Home Assistant to do the display side and data collection/retention

I would do a couple of things

1. a small flow that ran every minute - to check the current time and set a variable such as FanOnTime=yes - this flow would just check if the time was greater that 10:00 and less than 22:31 and see the variable to true - any other time it would set it to false. This flow would use the inject node to run every minute and a change node to set the variable

2. You would then have a 2nd flow that would check this variable - if true - it would then measure the outside temperature, if less than 19 then check inside temp - if greater than 20 then turn on fan

This could be written as a function node - but would be more easily done with a couple of switch nodes

Try it, post up your code and we can look
