I'm relatively new to Node-Red and I've been coming up short trying to put together a reliable flow to notify me when the VPD in my tent is out of the range I'd like it to stay in.
Hopefully I've added my flow info correctly so it can be looked at. In this flow I'm controlling the VPD of my grow tent by reading ambient temp, leaf temp, and humidity and then adjusting humidity to get me to the correct VPD range. I'm looking to make a flow that will notify me if the VPD value is ± 0.1 kPa for longer than a certain amount of time.
You can see in the flow that I started putting something together, but it wasn't working the way I expected. I'm at a bit of a loss so hopefully some nice folks around these parts can help me out.
TIA!
[{"id":"5a0048cf9ebeacac","type":"tab","label":"Tent 1 - Environmental Control","disabled":false,"info":"","env":[]},{"id":"ce0c092359348db8","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":1060,"y":120,"wires":[["cae5c35ad67dece8"],[]]},{"id":"cae5c35ad67dece8","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier Off","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":120,"wires":[[]]},{"id":"843078303f1be4cf","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1060,"y":40,"wires":[["212dc1fcb7f85ea7"],[]]},{"id":"212dc1fcb7f85ea7","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier On","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":40,"wires":[[]]},{"id":"d8381beebe70d60b","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1060,"y":220,"wires":[["387a7c5ccb92a96f"],[]]},{"id":"bf53a40be54fd0d7","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":1060,"y":300,"wires":[["70c2b4d81426af2c"],[]]},{"id":"70c2b4d81426af2c","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier Off","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":300,"wires":[[]]},{"id":"387a7c5ccb92a96f","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier On","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":220,"wires":[[]]},{"id":"fd766b6685b43463","type":"api-current-state","z":"5a0048cf9ebeacac","name":"VPD Check (Lights On)","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"$entities(\"input_number.tent_1_vpd_target\").state","halt_if_type":"jsonata","halt_if_compare":"gt","entity_id":"sensor.t1vpdc","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":770,"y":80,"wires":[["843078303f1be4cf"],["ce0c092359348db8"]]},{"id":"05c72b06ea60b2a5","type":"api-current-state","z":"5a0048cf9ebeacac","name":"VPD Check (Lights Off)","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"$entities(\"sensor.tent1_vpdmintarget_lights_out\").state","halt_if_type":"jsonata","halt_if_compare":"gt","entity_id":"sensor.t1vpdc","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":770,"y":260,"wires":[["d8381beebe70d60b"],["bf53a40be54fd0d7"]]},{"id":"e5b1dd42ec020a8e","type":"api-current-state","z":"5a0048cf9ebeacac","name":"VPD Control (Light Check)","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_3","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":460,"y":180,"wires":[["fd766b6685b43463"],["05c72b06ea60b2a5"]]},{"id":"2fcfd48c20eabac8","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":740,"y":500,"wires":[["7362cc09e4dcaac2"],[]]},{"id":"7362cc09e4dcaac2","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier Off","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":500,"wires":[[]]},{"id":"3c56f8d33702a378","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","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":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":740,"y":420,"wires":[["0c11204cf3b5b78b"],[]]},{"id":"0c11204cf3b5b78b","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Humidifier On","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.plug_6"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":420,"wires":[[]]},{"id":"3d1df5b049140ddf","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidity Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"$entities(\"input_number.tent_1_humidity_target\").state","halt_if_type":"jsonata","halt_if_compare":"lt","entity_id":"sensor.tent1_humidity_sht3x_humidity","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":440,"y":460,"wires":[["3c56f8d33702a378"],["2fcfd48c20eabac8"]]},{"id":"23c19f1243b73336","type":"poll-state","z":"5a0048cf9ebeacac","name":"Humidity Control (Toggle Check)","server":"3bde6eec3f602257","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"input_boolean.vpd_control","state_type":"str","halt_if":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":150,"y":460,"wires":[["3d1df5b049140ddf"],[]]},{"id":"c9265c8b7dcdcf3f","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Phone Notification - VPD Too Low","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_pixel_5","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"VPD in Tent 1 is too low!.\",\"title\":\"Tent 1 - VPD\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":812,"y":1054,"wires":[[]]},{"id":"17309c36570207da","type":"poll-state","z":"5a0048cf9ebeacac","name":"VPD Notification","server":"3bde6eec3f602257","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.t1vpdc","state_type":"str","halt_if":"$entities(\"input_number.tent_1_vpd_target\").state","halt_if_type":"jsonata","halt_if_compare":"lt","outputs":2,"x":100,"y":1094,"wires":[["ed27c8ef2238537d"],["ea0ef576fd2894ce"]]},{"id":"ed27c8ef2238537d","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"5","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":1054,"wires":[["4b441179c56993dc"],[]]},{"id":"76e91ca4bffac0c9","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Phone Notification - VPD Too High","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_pixel_5","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"VPD in Tent 1 is too high.\",\"title\":\"Tent 1 - VPD\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":812,"y":1134,"wires":[[]]},{"id":"4b441179c56993dc","type":"delay","z":"5a0048cf9ebeacac","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"hour","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":550,"y":1054,"wires":[[]]},{"id":"ea0ef576fd2894ce","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Humidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_6","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"5","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":320,"y":1134,"wires":[["9e116e6dfe238906"],[]]},{"id":"9e116e6dfe238906","type":"delay","z":"5a0048cf9ebeacac","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"hour","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":550,"y":1134,"wires":[[]]},{"id":"36f2ab6b842b6e19","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Dehumidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.dehumidifier_grow_2","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":430,"y":840,"wires":[["ab3d9f9d3158397a"],[]]},{"id":"ab3d9f9d3158397a","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Dehumidifier On","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":["b92dc55a68719089c8e5580cf39aed70"],"entityId":["switch.dehumidifier_grow_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":840,"wires":[[]]},{"id":"a13f76c56ea4219f","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Dehumidifier State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.dehumidifier_grow_2","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":430,"y":920,"wires":[["ab9ffb904ba49bd3"],[]]},{"id":"ab9ffb904ba49bd3","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Dehumidifier Off","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":["b92dc55a68719089c8e5580cf39aed70"],"entityId":["switch.dehumidifier_grow_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":920,"wires":[[]]},{"id":"29ea8e7290a45d57","type":"poll-state","z":"5a0048cf9ebeacac","name":"Intake Humidity Check","server":"3bde6eec3f602257","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.tent1_intaketemprh_sht3x_humidity","state_type":"str","halt_if":"$entities(\"input_number.dehumidifier_rh_trigger\").state","halt_if_type":"jsonata","halt_if_compare":"gt","outputs":2,"x":120,"y":880,"wires":[["36f2ab6b842b6e19"],["a13f76c56ea4219f"]]},{"id":"0f5837244d9bebd4","type":"poll-state","z":"5a0048cf9ebeacac","name":"VPD Control (Toggle Check)","server":"3bde6eec3f602257","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"input_boolean.vpd_control","state_type":"str","halt_if":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":140,"y":180,"wires":[["e5b1dd42ec020a8e"],[]]},{"id":"4f7a01224874fc58","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Temp Control State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_1","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":335,"y":700,"wires":[["587cc0da11657dc6"],[]]},{"id":"587cc0da11657dc6","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Temp Control Off","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.plug_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":605,"y":700,"wires":[[]]},{"id":"bd2685e3cf640846","type":"api-current-state","z":"5a0048cf9ebeacac","name":"Temp Control State Check","server":"3bde6eec3f602257","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.plug_1","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":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":335,"y":620,"wires":[["87130e4cc4769326"],[]]},{"id":"87130e4cc4769326","type":"api-call-service","z":"5a0048cf9ebeacac","name":"Turn Temp Control On","server":"3bde6eec3f602257","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.plug_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":605,"y":620,"wires":[[]]},{"id":"6eef5675d7912d75","type":"poll-state","z":"5a0048cf9ebeacac","name":"Temp Check","server":"3bde6eec3f602257","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.tent1_temprh_sht3x_temperature","state_type":"str","halt_if":"$entities(\"input_number.tent_1_temperature_setpoint\").state","halt_if_type":"jsonata","halt_if_compare":"lt","outputs":2,"x":95,"y":660,"wires":[["bd2685e3cf640846"],["4f7a01224874fc58"]]},{"id":"3bde6eec3f602257","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]