Fan control with condition

I try to create a node with 7 condition if all condition it activate my blower, if it not it turn off...
The blower take hot air in my basement fire place(sensor1), and transfer it in my living-room(sensor2)
My others condition are slider in my lovelace who let my choose the temp Min(3) end Max(4) of my basement, and the temp we will reach in te living-room (5). I have also had a adjustable tolerance (6) to limit the trigger, and a Automation on/off(7).
My Input are group in a Joint node and output are set up, but I have trouble to figure how to set up function...
What I try to do is
IF switch (7) is ON
AND my temp (sensor1) is between the preset temp (3) and (4) (+/- tolerance (6))
AND my temp (sensor2) is lower then the preset temp (5) (+/- tolerance (6))
Then start my blower

Hard to say for sure as i dont know your variable names and msg structure, You need to add a output from a debug, after the node that creates your msg.

The structure of such a if statement would be something like below.

if (switch7 === "ON" && 
  mytempsensor1 > (temp3 - tolerance) &&
  mytempsensor1 < (temp4 + tolerance) &&
  mytempsensor2 < (temp5 - tolerance) ) {
    // do somthing when true
    msg.payload = true;
}else{
    // do something when false
    msg.payload = false;
}
return msg;

I try to adapt to my need, could you see what I do wrong?
I always have false at the top exit instead true or nothing, and nothing on the bottom exit...

!

Capture d’écran 2020-12-28 122625

Capture d’écran 2020-12-28 122659

if ("input_boolean.souffleur_automatique" === "1" &&
"multi_sensor1/sensor/temperature_coin_a_bois/state" > ("input_number.temperature_poele_min" - "input_number.temperature_tolerence") &&
"multi_sensor1/sensor/temperature_coin_a_bois/state" < ("input_number.temperature_poele" + "input_number.temperature_tolerence") &&
"cam3/sensor/garage_temperature/state" < ("input_number.temperature_salon" - "input_number.temperature_tolerence") ) {
// do somthing when true
msg.payload = true;
return (msg, null );
}else{
// do something when false
msg.payload = false;
}
return (null, msg );

Correct will be return [null, msg]

I can not help with images. If you want more help create a test flow, consisting of an inject with object set in msg.payload , a function node with your code and a debug node. Then we will have the info to help.

Sorry, I am a new user of node red maybe 6-7 days, what is a test flow?

A shorter version of your flow with less junk.

an inject containing the debug output from after the join node. In the debug window to the right of the object name , when you hoover mouse you get options , one is to copy value. you can then paste that value in the inject node and select json.

a copy of your function node.

and a debug/s nodes to show values.

select the nodes by holding Ctrl and selecting them with the mouse. Then press Ctrl/e and copy text.

Then paste text here by pressing </> aat top of reply window, and pasting the code between the backticks, like below.
```
code
```

Looking here the values are in msg.payload.
so add msg.payload to the front of all your variables.

Input

input_number.temperature_tolerence : msg.payload : Object
object
multi_sensor1/sensor/temperature_coin_a_bois/state: 46
cam3/sensor/garage_temperature/state: 26
input_number.souffleur_automatique: 1
input_number.temperature_poele: 65
input_number.temperature_poele_min: 24.5
input_number.temperature_salon: 25
input_number.temperature_tolerence: 1

function

if ("input_boolean.souffleur_automatique" === "1" && 
  "multi_sensor1/sensor/temperature_coin_a_bois/state" > ("input_number.temperature_poele_min" - "input_number.temperature_tolerence") &&
  "multi_sensor1/sensor/temperature_coin_a_bois/state" < ("input_number.temperature_poele" + "input_number.temperature_tolerence") &&
  "cam3/sensor/garage_temperature/state" < ("input_number.temperature_salon" - "input_number.temperature_tolerence") ) {
    // do somthing when true
    msg.payload = true;
return (msg, null);
}else{
    // do something when false
    msg.payload = false;
}
return (null, msg);

I still do not have a copy of the object, that i can just copy and paste. If you copy value correctly using copy value icon to right of msg.payload, then i can work with it, but what you have pasted is not a valid json.

[{"id":"c66fb972.1c42f8","type":"server-state-changed","z":"756107df.057b38","name":"Switch Automation","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.souffleur_automatique","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":90,"y":400,"wires":[["6fc0025a.1ef98c"]]},{"id":"b5554eb2.fbcce","type":"server-state-changed","z":"756107df.057b38","name":"Temp_max poèle","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperature_poele","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":80,"y":40,"wires":[["6fc0025a.1ef98c"]]},{"id":"eec2f33c.01b7a","type":"server-state-changed","z":"756107df.057b38","name":"Temp_min poèle","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperature_poele_min","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":80,"y":100,"wires":[["6fc0025a.1ef98c"]]},{"id":"b122bc0a.d2af6","type":"server-state-changed","z":"756107df.057b38","name":"Temp_salon","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperature_salon","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":70,"y":280,"wires":[["6fc0025a.1ef98c"]]},{"id":"c9bb1e44.a69c2","type":"server-state-changed","z":"756107df.057b38","name":"tolérence temp","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperature_tolerence","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":80,"y":220,"wires":[["6fc0025a.1ef98c"]]},{"id":"c9f5b654.4a0198","type":"mqtt in","z":"756107df.057b38","name":"Temp","topic":"multi_sensor1/sensor/temperature_coin_a_bois/state","qos":"0","datatype":"json","broker":"f31ab881.110a68","x":50,"y":160,"wires":[["6fc0025a.1ef98c"]]},{"id":"eaeb8177.228ef","type":"mqtt in","z":"756107df.057b38","name":"Temp","topic":"cam3/sensor/garage_temperature/state","qos":"0","datatype":"json","broker":"f31ab881.110a68","x":50,"y":340,"wires":[["6fc0025a.1ef98c"]]},{"id":"f31ab881.110a68","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.26","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Ok and what is wrong?

This is not a test flow and does not contain any functon or inject node
This is an example of a correctly formated json notice the { } and the " " and the :

{"topic":"Mypi/2/KW","payload":{"KW_Total":434},"qos":0,"retain":false,"_msgid":"ef0287b6.34ca08"}

if you look at image you can see my cursor over the copy value icon.

{"multi_sensor1/sensor/temperature_coin_a_bois/state":42.4,"cam3/sensor/garage_temperature/state":25.8,"input_number.souffleur_automatique":1,"input_number.temperature_poele":65,"input_number.temperature_poele_min":24.5,"input_number.temperature_salon":25,"input_number.temperature_tolerence":1}

Here is a test flow

[{"id":"b95ccd5.63ef1b","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"multi_sensor1/sensor/temperature_coin_a_bois/state\":42.4,\"cam3/sensor/garage_temperature/state\":25.8,\"input_number.souffleur_automatique\":1,\"input_number.temperature_poele\":65,\"input_number.temperature_poele_min\":24.5,\"input_number.temperature_salon\":25,\"input_number.temperature_tolerence\":1}","payloadType":"json","x":140,"y":1940,"wires":[["31a96c2c.4f8c9c"]]},{"id":"31a96c2c.4f8c9c","type":"function","z":"8d22ae29.7df6d","name":"","func":"if (msg.payload[\"input_number.souffleur_automatique\"] === 1 && \n  msg.payload[\"multi_sensor1/sensor/temperature_coin_a_bois/state\"] > (msg.payload[\"input_number.temperature_poele_min\"] - msg.payload[\"input_number.temperature_tolerence\"]) &&\n  msg.payload[\"multi_sensor1/sensor/temperature_coin_a_bois/state\"] < (msg.payload[\"input_number.temperature_poele\"] + msg.payload[\"input_number.temperature_tolerence\"]) &&\n  msg.payload[\"cam3/sensor/garage_temperature/state\"] < (msg.payload[\"input_number.temperature_salon\"] - msg.payload[\"input_number.temperature_tolerence\"]) ) {\n    // do somthing when true\n    msg.payload = true;\nreturn [msg, null];\n}else{\n    // do something when false\n    msg.payload = false;\n    return [null, msg];\n\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":330,"y":1960,"wires":[["be48273.628c958"],["be48273.628c958"]]},{"id":"be48273.628c958","type":"debug","z":"8d22ae29.7df6d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":1940,"wires":[]},{"id":"5f8cb3d4.47db5c","type":"inject","z":"8d22ae29.7df6d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"multi_sensor1/sensor/temperature_coin_a_bois/state\":42.4,\"cam3/sensor/garage_temperature/state\":23.8,\"input_number.souffleur_automatique\":1,\"input_number.temperature_poele\":65,\"input_number.temperature_poele_min\":24.5,\"input_number.temperature_salon\":25,\"input_number.temperature_tolerence\":1}","payloadType":"json","x":130,"y":2000,"wires":[["31a96c2c.4f8c9c"]]}]

you will see i put the json in the inject node for testing

if you create a json that should return true in a seperate inject node you can the test the function.

edit/ changed === "1" to === 1

Before that change, always false at te bottom output
After remove " " I have nothing at the output...

I saw your input are set to string, mine are set to number, it is made a difference?