Thank you for your detailed explanation, I understand more about how to compare numbers now
I will explain a little more about the function of the workflow i want to create.
I have four ventilation switches’ off, 1, 2 and 3 ‘based on different measurements such as’ dew point, temperature, humidity in the house and outside and presence of people, the ventilation will have to adjust to this. it is only about ventilation in the basement so when there is a need to ventilate in the basement or not
I now understand by your example how you should compare one entity state with another and when this is true or false you should go further in the flow or stop. Thanks for that! Next is: what if you want to check multiple states and use them to switch a ventilation position? I will give an example
EXAMPLE 1: This is when the ventilation must be turned off:
IF
'Living room dewpoint' HIGHER THAN 'basement wall temperature'
OR
'Bedroom dewpoint' HIGHER THAN 'basement wall temperature'
OR
'Absolute Humidity in Living room' HIGHER THAN 'Absolute Humidity in basement'
OR
' basement heating power' HIGHER THAN '5'
SET
Ventilation to Switch off
I have succeeded in this part, but I have the idea that it can be done more efficiently, see my flow here
[{"id":"27d0d8c6.0767f8","type":"server-state-changed","z":"215c4126.8b02ce","name":"Bedroom Dewpoint","server":"8e9ec046.8c74c","version":1,"entityidfilter":"sensor.bedroom_dewpoint","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":120,"wires":[["4ef8b426.77477c"]]},{"id":"4ef8b426.77477c","type":"api-current-state","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"payload","halt_if_type":"msg","halt_if_compare":"lt","override_topic":false,"entity_id":"sensor.keldermuur_temperature","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":120,"wires":[["d361d365.35a09"],[]]},{"id":"d361d365.35a09","type":"api-current-state","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Aan?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.mechanische_ventilatie_stand_uit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":120,"wires":[["107d5a94.ccbdb5"],[]]},{"id":"107d5a94.ccbdb5","type":"api-call-service","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Stand Uit","server":"8e9ec046.8c74c","version":1,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.mechanische_ventilatie_stand_uit","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":120,"wires":[["5cfac410.26339c"]]},{"id":"5cfac410.26339c","type":"api-call-service","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"Mechanische ventilatie is uitgeschakeld, lucht uit woonkamer condenseert tegen koudste oppervlakte in de kelder\",\"title\":\"Mechanische Ventilatie\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1420,"y":120,"wires":[[]]},{"id":"8130f308.4a238","type":"api-current-state","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Aan?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.mechanische_ventilatie_stand_uit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":60,"wires":[["6729d5b9.fd3cec"],[]]},{"id":"6729d5b9.fd3cec","type":"api-call-service","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Stand Uit","server":"8e9ec046.8c74c","version":1,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.mechanische_ventilatie_stand_uit","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":60,"wires":[["c2b86b5d.7bebc8"]]},{"id":"c2b86b5d.7bebc8","type":"api-call-service","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"Mechanische ventilatie is uitgeschakeld, lucht van boven condenseert tegen koudste kelder oppervlakte\",\"title\":\"Mechanische Ventilatie\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1420,"y":60,"wires":[[]]},{"id":"894c4257.d25","type":"server-state-changed","z":"215c4126.8b02ce","name":"Basement Heating Power > 5%","server":"8e9ec046.8c74c","version":1,"entityidfilter":"sensor.basement_heating","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"5","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":true,"x":190,"y":240,"wires":[["e1432816.8c5618"],[]]},{"id":"7e39c9c3.e66d38","type":"server-state-changed","z":"215c4126.8b02ce","name":"Living Room Dewpoint","server":"8e9ec046.8c74c","version":1,"entityidfilter":"sensor.livingroom_dewpoint","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":160,"y":60,"wires":[["a8ffef3f.761ee"]]},{"id":"a8ffef3f.761ee","type":"api-current-state","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"payload","halt_if_type":"msg","halt_if_compare":"lt","override_topic":false,"entity_id":"sensor.keldermuur_temperature","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":60,"wires":[["8130f308.4a238"],[]]},{"id":"20d0d8d9.8def48","type":"server-state-changed","z":"215c4126.8b02ce","name":"Absolute Humidity Livingroom","server":"8e9ec046.8c74c","version":1,"entityidfilter":"sensor.livingroom_absolutehumidity","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":180,"y":180,"wires":[["5aab7d7b.aac0e4"]]},{"id":"5aab7d7b.aac0e4","type":"api-current-state","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"payload","halt_if_type":"msg","halt_if_compare":"lt","override_topic":false,"entity_id":"sensor.basement_absolutehumidity","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":510,"y":180,"wires":[["b15e8057.cf522"],[]]},{"id":"b15e8057.cf522","type":"api-current-state","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Aan?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.mechanische_ventilatie_stand_uit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":180,"wires":[["2fc23fa0.930c4"],[]]},{"id":"2fc23fa0.930c4","type":"api-call-service","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Stand Uit","server":"8e9ec046.8c74c","version":1,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.mechanische_ventilatie_stand_uit","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":180,"wires":[["11a5eb1f.609135"]]},{"id":"11a5eb1f.609135","type":"api-call-service","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"Mechanische ventilatie is uit. De absolute vochtinhoud in de woonkamer is hoger dan in de kelder.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1420,"y":180,"wires":[[]]},{"id":"e1432816.8c5618","type":"api-current-state","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Aan?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.mechanische_ventilatie_stand_uit","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":240,"wires":[["22fba9fe.46f2a6"],[]]},{"id":"22fba9fe.46f2a6","type":"api-call-service","z":"215c4126.8b02ce","name":"Mechanische Ventilatie Stand Uit","server":"8e9ec046.8c74c","version":1,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.mechanische_ventilatie_stand_uit","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":240,"wires":[["480da3a8.c601fc"]]},{"id":"480da3a8.c601fc","type":"api-call-service","z":"215c4126.8b02ce","name":"","server":"8e9ec046.8c74c","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"Mechanische ventilatie is uit. De verwarming in de kelder staat aan.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1420,"y":240,"wires":[[]]},{"id":"8e9ec046.8c74c","type":"server","z":"","name":"Home Assistant"}]
Because the OFF position only works with OR conditions, it is easy.
EXAMPLE 2: Now an example of when the ventilation should switch to position 1, the AND conditions are used here and I don’t know how to use this in NodeRed
IF
'basement humidty' IS HIGHER THAN '60%'
AND
'Bedroom dewpoint' LOWER THAN 'basement wall temperature'
AND
'Living room dewpoint' LOWER THAN 'basement wall temperature'
AND
'Absolute Humidity in Living room' LOWER THAN 'Absolute Humidity in basement'
SET
Ventilation to Switch 1
How do I get this working in NodeRed?