apex-ha icon indicating copy to clipboard operation
apex-ha copied to clipboard

Discussion: Controlling DOS Pumps

Open brettonw opened this issue 1 year ago • 7 comments

I have been trying to figure out how to control my DOS pump through the HA integration, and I've arrived at an intermediate hack solution that works for now, but I wonder if there's a better way.

You have two choices with the DOS. You can set it to OFF/ON, which will give you 0 or 25ml/min dosing rates. Or you can set a profile.

Unfortunately the Neptune profiles are over-constrained, so while there is some ability to set the DOS pump speed, you can't just set it to that speed and let it go. Apex will always try to manage a dose, instead of a rate. The actual dose appears to be limited to 1/3rd of the rate. I don't understand what the reasoning behind this might be. I'm curious if it's enforced at the Apex, or just in the ApexFusion UI.

In order to try to get a controlled rate, I meticulously went into ApexFusion and created 10 profiles corresponding to 1ml/min up to 10ml//min.

Screen Shot 2022-09-11 at 11 50 33 AM Screen Shot 2022-09-11 at 11 50 16 AM

I created an input_number with a range from 0..10, and I update the profile on the Apex device with an automation like this:

input_number:
  dos_rate:
    name: "DOS rate"
    min: 0
    max: 10
    step: 1
    icon: mdi:speedometer

automation:
  - id: update_dos_rate
    alias: Update DOS Rate
    trigger:
      - platform: state
        entity_id: input_number.dos_rate
    action:
      - service: apex.set_variable
        data:
          did: "4_1"
          code: >
            {% if (trigger.to_state.state | int) == 0 %} 
            Set OFF 
            {% else %} 
            Set Dose{{ (trigger.to_state.state | int) }} 
            {% endif %}
    mode: single

I expose this on lovelace, so I have a slider: Screen Shot 2022-09-11 at 11 53 20 AM

brettonw avatar Sep 11 '22 15:09 brettonw