Still trying to get my bearings with Node-Red and while I can achieve the functionality I am looking for, my flows feel like they are a little more cluttered than they could to be.
This is my current ventilation flow - As you can see a good portion of the complexity is just checking and changing the state of multiple entities.
[{"id":"aa825a515206191d","type":"api-current-state","z":"0edd3fd8f365fb46","name":"co2 Sensor","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.garage_co2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":390,"y":220,"wires":[["bc70f06bb4648649","67c84d330fec6e7b"]]},{"id":"5e360f580b4697c3","type":"inject","z":"0edd3fd8f365fb46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":340,"wires":[["cb3c98eafa52ae00"]]},{"id":"2ff38a6cb587f8d8","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Booster Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.booster_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":950,"y":100,"wires":[["6ac98bb2f0690e80"],[]]},{"id":"6ac98bb2f0690e80","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Booster Fan - On","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.booster_fan"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":100,"wires":[[]]},{"id":"02a653277eadab48","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Booster Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.booster_fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":950,"y":420,"wires":[["2d09337a22cbfe34"],[]]},{"id":"2d09337a22cbfe34","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Booster Fan - Off","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.booster_fan"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":420,"wires":[[]]},{"id":"3369b911346f0731","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Dehumidifier (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.dehumidifier","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":950,"y":180,"wires":[["b3e5868562c2168f","24e1d9f1069ddb8d"],[]]},{"id":"b3e5868562c2168f","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Dehumidifier - On","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.dehumidifier"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":180,"wires":[[]]},{"id":"370c86dd1b16980f","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Dehumidifier (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.dehumidifier","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":950,"y":480,"wires":[["75980cf3f910ee85"],[]]},{"id":"75980cf3f910ee85","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Dehumidifier - Off","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.dehumidifier"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":480,"wires":[[]]},{"id":"1f6ad4a194cad515","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Fresh Air - On","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.fresh_air_vent"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":40,"wires":[[]]},{"id":"35f55dcaf23df666","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Fresh Air (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fresh_air_vent","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":940,"y":360,"wires":[["2a339b23e31938a8"],[]]},{"id":"2a339b23e31938a8","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Fresh Air - Off","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.fresh_air_vent"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":360,"wires":[[]]},{"id":"1dabc7c1984cc54e","type":"ha-switch","z":"0edd3fd8f365fb46","name":"Dehumidifier","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"c3fc51b9d3fa8e3b","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":750,"y":220,"wires":[["3369b911346f0731"],["b59774de11df6d8f"]]},{"id":"10981490d010f6fa","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Fresh Air (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fresh_air_vent","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":940,"y":40,"wires":[["1f6ad4a194cad515"],[]]},{"id":"cb3c98eafa52ae00","type":"ha-switch","z":"0edd3fd8f365fb46","name":"Ventilation Flow","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"37b811a1f177d656","enableInput":true,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":360,"y":340,"wires":[["aa825a515206191d"],["35f55dcaf23df666","02a653277eadab48","370c86dd1b16980f","24e1d9f1069ddb8d"]]},{"id":"bc70f06bb4648649","type":"switch","z":"0edd3fd8f365fb46","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"800","vt":"str"},{"t":"lt","v":"600","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":220,"wires":[["10981490d010f6fa","2ff38a6cb587f8d8","1dabc7c1984cc54e"],["02a653277eadab48","370c86dd1b16980f","35f55dcaf23df666","24e1d9f1069ddb8d"]]},{"id":"b59774de11df6d8f","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":930,"y":240,"wires":[["ab8c15a1579e981a","370c86dd1b16980f"],[]]},{"id":"ab8c15a1579e981a","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Fan - On","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.fan"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1180,"y":240,"wires":[[]]},{"id":"24e1d9f1069ddb8d","type":"api-current-state","z":"0edd3fd8f365fb46","name":"Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":930,"y":540,"wires":[["6b1c58d4c5c39aa7"],[]]},{"id":"6b1c58d4c5c39aa7","type":"api-call-service","z":"0edd3fd8f365fb46","name":"Fan - Off","server":"254baff4.1ba5f","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.fan"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1180,"y":540,"wires":[[]]},{"id":"67c84d330fec6e7b","type":"debug","z":"0edd3fd8f365fb46","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":520,"y":120,"wires":[]},{"id":"254baff4.1ba5f","type":"server","name":"Home Assistant","addon":true},{"id":"c3fc51b9d3fa8e3b","type":"ha-entity-config","server":"254baff4.1ba5f","deviceConfig":"","name":"","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Dehumidifier"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"37b811a1f177d656","type":"ha-entity-config","server":"254baff4.1ba5f","deviceConfig":"","name":"","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Ventilation Flow"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false}]
I’ve been dabbling with combining the states in common a message, but I am not sure what type of node I should use to change the state of groups of entities based on specific conditions.
[{"id":"691b26730e919f6d","type":"ha-switch","z":"3322d76e29be7ecf","name":"Ventilation Flow","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"37b811a1f177d656","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":1200,"y":240,"wires":[["6ce0b407389218f9"],[]]},{"id":"a3d5b5df20fbc24b","type":"api-current-state","z":"3322d76e29be7ecf","name":"co2 Sensor","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.garage_co2","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"co2","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":770,"y":120,"wires":[["68b44bca15151249"]]},{"id":"6ce0b407389218f9","type":"ha-switch","z":"3322d76e29be7ecf","name":"Dehumidifier","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"c3fc51b9d3fa8e3b","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":1370,"y":200,"wires":[[],["9ac8d981d52018a7"]]},{"id":"fcee2d52487209a2","type":"api-current-state","z":"3322d76e29be7ecf","name":"Fresh Air (state)","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fresh_air_vent","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"Fresh Air","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":180,"wires":[["68b44bca15151249"]]},{"id":"5d7fb91a5a11e177","type":"api-current-state","z":"3322d76e29be7ecf","name":"Booster Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.booster_fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"Booster Fan","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":790,"y":240,"wires":[["68b44bca15151249"]]},{"id":"429bd1066e7c10c3","type":"api-current-state","z":"3322d76e29be7ecf","name":"Dehumidifier (state)","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.dehumidifier","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"Dehumidifier","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":790,"y":300,"wires":[["68b44bca15151249"]]},{"id":"fe902c3c76e5c3e7","type":"api-current-state","z":"3322d76e29be7ecf","name":"Fan (state)","server":"254baff4.1ba5f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"Fan","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":770,"y":360,"wires":[["68b44bca15151249"]]},{"id":"13458afee5b5618f","type":"inject","z":"3322d76e29be7ecf","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":560,"y":240,"wires":[["5d7fb91a5a11e177","fcee2d52487209a2","429bd1066e7c10c3","fe902c3c76e5c3e7","a3d5b5df20fbc24b"]]},{"id":"9ac8d981d52018a7","type":"debug","z":"3322d76e29be7ecf","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1580,"y":200,"wires":[]},{"id":"68b44bca15151249","type":"join","z":"3322d76e29be7ecf","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1030,"y":240,"wires":[["691b26730e919f6d"]]},{"id":"37b811a1f177d656","type":"ha-entity-config","server":"254baff4.1ba5f","deviceConfig":"","name":"","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Ventilation Flow"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"254baff4.1ba5f","type":"server","name":"Home Assistant","addon":true},{"id":"c3fc51b9d3fa8e3b","type":"ha-entity-config","server":"254baff4.1ba5f","deviceConfig":"","name":"","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Dehumidifier"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false}]
Any suggestions on a tidy way to go about accomplishing something like this?