Node-Red Fan control schedule and Temp?

Hi All

I have this schedule for different Fan in the garage:

I also have a temperature senor on a sonoff: sensor.garagetemperatur

image

I have also installed the Nodered HA integration:
image

So what is the easiest way to create a “rule” that bypass the schedule if the temperature is higher than 28 C ?

Sofar this have eluded me and my google search have not found a solutions
Hope someone can guide me to create this before we get a warm summer

Thanks

You could start by just building this automation. Once temp. threshold is reached turn on, if its under again, turn off. Then you could implement a traffic node that once turned on via the temp. automation, stops it from getting turned off by the scheduler.

@AlmostSerious Thanks I tried creating a seperate flow for the Temperature

(For some reason I couldn’t use the Sonoff ON/OFF for this flow?)

  1. Once temp. threshold is reached > 28C turn FAN on
  2. if its under 28C again, turn FAN off.
  3. implement a traffic node that once turned on via the temp. automation, stops it from getting turned off by the scheduler.

It’s the last step 3 that I am not sure of

Looks great. How the Traffic Light works is that you can send a message to it to turn it red and another message that turns it green. So you can stop any message going through it when its red, and allow them again when its green. So if you put the traffic light between your scheduler and the service call and then turn it green or red after turning on/off via the temp automation it should work fine.

I think I might be making this to complicated :slight_smile:

I have changed the Sonoff switch to a “Call service” and added a “Switch Node” to get the ON/OFF on both temperature and Schedule.

But one is ON/OFF and the other is sending a temperature to the ON/OFF
So I can’t see how I can do the traffic lights value?

So Stop: OFF and Allow would be a Value? (>20C)

Following. this thread for ideas that anyone might have as I have a hugely over done setup for my climate and fans…

But,. you can use a change node to set the payload to on/off…

My working mess:

1 Like

I hope you have notes… :slight_smile:

image

So how does this change node work? (Sorry new to Node-red) like this?
image

yeah and you can add another rule in that node for off… and it will give you 2 outputs.

edit: click the SET dropdown and make it Change…

Nice would I be able to change any Numeric value to a value like this?
image

I would need to change the “x Temperature” to a OFF on a specific output

does not appear that will work… – see this is why im here too… far from a node-red pro.

could try this… change all the settings to your own…

[{"id":"1596ad54.bf2da3","type":"tab","label":"Flow 13","disabled":false,"info":""},{"id":"81c5502b.40a62","type":"switch","z":"1596ad54.bf2da3","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"30","vt":"num","v2":"81","v2t":"num"},{"t":"gte","v":"82","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1140,"y":490,"wires":[["fc30a91b.8afdc8"],["ea8bedb2.65eda"]]},{"id":"f03656c8.db8d18","type":"light-scheduler","z":"1596ad54.bf2da3","settings":"242e00e3.8738b","events":"[]","topic":"","name":"scheduler","onPayload":"ON","onPayloadType":"str","offPayload":"OFF","offPayloadType":"str","onlyWhenDark":true,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange.startup","x":1470,"y":430,"wires":[["ea8bedb2.65eda"]]},{"id":"fc30a91b.8afdc8","type":"api-current-state","z":"1596ad54.bf2da3","name":"Schedule on?","server":"663af70e.88b558","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.schedule","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1280,"y":430,"wires":[["f03656c8.db8d18"],[]]},{"id":"cf936187.5b9d7","type":"inject","z":"1596ad54.bf2da3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":840,"y":470,"wires":[["9f5b2774.e818b8"]]},{"id":"ea8bedb2.65eda","type":"api-call-service","z":"1596ad54.bf2da3","name":"Fan on","server":"663af70e.88b558","version":1,"debugenabled":false,"service_domain":"fan","service":"turn_on","entityId":"fan.garage","data":"{\"speed\":\"low\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1600,"y":500,"wires":[[]]},{"id":"9f5b2774.e818b8","type":"api-current-state","z":"1596ad54.bf2da3","name":"temperature","server":"663af70e.88b558","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.thermostat_temperature","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":1000,"y":470,"wires":[["81c5502b.40a62"]]},{"id":"242e00e3.8738b","type":"light-scheduler-settings","z":"","name":"my settings","latitude":"33.557891","longitude":"-112.2782237"},{"id":"663af70e.88b558","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Screenshot_20200709_122542

You could then add some automation to turning the inputboolean on/off in the ‘schedule on?’ node… or you could also right after the switch node (which is checking if temp is between 30 and 81 send to top output… otherwise if its above 82F send to bottom to avoid the schedule…

Thanks!

I added your example and changed the sensors and switches and I think it works!

For some reason Node-red keeps saying “No connection”? but it works

  1. If the temperature is > 20C then go and run Fans and don’t stop until temp is below 20
  2. If the temperature is less than < 20C run Schedule and stop according to schedule

I can’t find the input_boolean_scheduler (I am using the Nodered Light scheduler in many Node-red flows but I can’t see any of them in the dropdown list)

But shouldn’t there be a FAN - OFF after the scheduler?

BTW: Seem to be a problem with the light scheduler after the latest update LINK

Again thanks for your help much appreciated :+1:

yes you will have to add the fan off and other functions. I just tossed tthose together for you real quick. you would also have to make the input_boolean. I rthink you can make that in the helpers section of the UI. I still use yaml files mostly so for me its just

in input_boolean.yaml:

scheduler:
  name: Fan Scheduler

of course if you use this method you must include the .yaml file in configuration.yaml

input_boolean: !include input_boolean.yaml

i also didnt implement any automations to turn that inputboolean on and off… you could mainly use it as on and off switch on the GUI… or automate it. your choice how you would like to do that

I also use the configuration.yaml !!! :slight_smile:
Using the Sonof ON/OF for the schedule does mean I don’t need the OFF call service

And only the “Call service node ON” for the to high temperature then I don’t think I need a OFF that is done by the schedule, also I don’t see why I need the "Input Boolean for scheduler?
The temperature is the deciding factor for Schedule or Max Fan outside schedule

Or am I missing something

Again thanks I will have to run some test but it looks promising and “clean” LOL

Hi @fiftys

I tried to add this to the others…

#############################
###     INPUT BOOLEAN     ###
#############################
 
input_boolean:
# Fake heater to hide under customize for google assistant temperature readout
  fake_heater1:
    name: Fake Heater1
    icon: mdi:toggle-switch-off
    initial: off

# Fake heater to hide under customize for google assistant temperature readout
  fake_heater2:
    name: Fake Heater2
    icon: mdi:toggle-switch-off
    initial: off

# Fan scheduler for Node-red
  fan_scheduler:
    name: Fan Scheduler
    icon: mdi:toggle-switch-off
    initial: off

but for some reason the input dosent show up in the Node red like the others?
Any idea why?

Update this might be a HA problem because I can see that it is created under Helpers

But for some reason its not loaded into Node-red?

Ok total reboot didnt work but updating node-red did :slight_smile:

Could you explain the difference between having the Schedule input boolean in the loop?

so the schedule node, or rather inputboolean acts like a normal switch, so if you have the ‘schedule’ on it would send the flow out of the top output,… and if you turned it off,… it would flow through the bottom on…you didnt need it, but it gives you the option to bypass the schedule for whatever reason.