apex-ha
apex-ha copied to clipboard
Discussion: Controlling DOS Pumps
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](https://user-images.githubusercontent.com/2028973/189536917-c45c3334-1b02-4823-8632-add0130eb5a2.png)
![Screen Shot 2022-09-11 at 11 50 16 AM](https://user-images.githubusercontent.com/2028973/189536938-77127aef-7afa-4079-a575-96672c657e6b.png)
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: