New to NodeRed and Hassio, need basic help

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

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 ….

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

1 Like

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