Skip to content

Stop Pump When Input Dry Logic is inverted #18

@nofuturekid

Description

@nofuturekid

The logic for the prevention of dry-running is not working correctly.

If there is water in the bottle, the sensor for "fluid_input_sensor" is "on" and so the pump will not even start because of the last
"if" condition.

  - id: pump_safety_check
    mode: restart
    then:
      - while:
          condition:
            - switch.is_on: pump_control
          then:
            - if:
                condition:
                  - and:
                      - switch.is_on: stop_pump_when_full
                      - binary_sensor.is_on: fulid_output_sensor
                then:
                  - logger.log: "Pump stopping - tank full"
                  - switch.turn_off: pump_control
            - if:
                condition:
                  - lambda: |-
                      if (id(pump_start_time) == 0) return false;
                      uint32_t runtime = (millis() - id(pump_start_time)) / 1000;
                      return runtime > id(max_safe_run_time).state && !id(pump_safety_override).state;
                then:
                  - logger.log: "Pump stopping - safety"
                  - switch.turn_off: pump_control
            - if:
                condition:
                  - and:
                      - switch.is_on: stop_pump_when_dry
                      - binary_sensor.is_on: fluid_input_sensor
                then:
                  - logger.log: "Pump stopping - input dry"
                  - switch.turn_off: pump_control
            - delay: 1s

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions