EZO Pump and Sensor Calibration coming to ESPHome soon!

Home Assistant automation projects, questions, etc. go here.
Post Reply
HydroRay
LED-Curious
LED-Curious
Reactions:
Posts: 16
Joined: Tue Feb 22, 2022 5:58 pm

I have great news!

Thanks to https://github.com/gvdhoven and https://github.com/carlos-sarmiento on GitHub it looks like we're finally going to be able control the Peristaltic Pumps and calibrate everything right in HA/ESPHome.

https://github.com/esphome/esphome-docs/pull/2133 makes it so you can send any command to any EZO sensor

https://github.com/esphome/esphome-docs/pull/2115 creates an "ezo_pmp" component!! The only catch on this one (reading the ezo_pmp.rst file) is that the component will not be directly controllable via HA front end because HA doesn't have support for pumps currently. In order to control it you need to use templates... which shouldn't be too difficult to figure out.
Last edited by HydroRay on Fri Jun 17, 2022 7:54 pm, edited 1 time in total.
HydroRay
LED-Curious
LED-Curious
Reactions:
Posts: 16
Joined: Tue Feb 22, 2022 5:58 pm

All you need to do is add the external component manually instead of waiting until the next ESPHome Update

Code: Select all

external_components:
  - source: github://pr#3528
    components: [ ezo_pmp ]
I'm pretty sure you have to flash with just that code in, then open the config file again and

Code: Select all

ezo_pmp:
  - id: ezo_pmp_sr_ph_up
    address: 103
(whatever you want to name your pump and the address it's at)

Then I'm not positive if this could be a lot cleaner by putting it in the HA config.yaml (I'll try) but

Code: Select all

binary_sensor:
  - platform: ezo_pmp
    id: ezo_pmp_sr_ph_up
    pump_state:
      id: sr_ph_up_pump_state
      name: "SR pH Up Pump State"
    is_paused:
      id: sr_ph_up_is_paused
      name: "SR pH Up Is Paused"
  - platform: ezo_pmp
    id: ezo_pmp_sr_ph_down
    pump_state:
      id: sr_ph_down_pump_state
      name: "SR pH Down Pump State"
    is_paused:
      id: sr_ph_down_is_paused
      name: "SR pH Down Is Paused"
  - platform: ezo_pmp
    id: ezo_pmp_sr_nutes
    pump_state:
      id: sr_nutes_pump_state
      name: "SR Nutes Pump State"
    is_paused:
      id: sr_nutes_is_paused
      name: "SR Nutes Is Paused"
      
button:
  - platform: template
    name: "Dose Volume"
    on_press:
      - ezo_pmp.dose_volume:
          id: ezo_pmp_sr_ph_up
          volume: 10
  - platform: template
    name: "Dose Volume/Time"
    on_press:
      - ezo_pmp.dose_volume_over_time:
          id: ezo_pmp_sr_ph_up
          volume: 10
          duration: 2
  - platform: template
    name: "Dose Constant Flow Rate"
    on_press:
      - ezo_pmp.dose_with_constant_flow_rate:
          id: ezo_pmp_sr_ph_up
          volume_per_minute: 10
          duration: 2
  - platform: template
    name: "Set Calibration Volume"
    on_press:
      - ezo_pmp.set_calibration_volume:
          id: ezo_pmp_sr_ph_up
          volume: 10
  - platform: template
    name: "Find"
    on_press:
      - ezo_pmp.find: ezo_pmp_sr_ph_up
  - platform: template
    name: "Dose Continuously"
    on_press:
      - ezo_pmp.dose_continuously: ezo_pmp_sr_ph_up
  - platform: template
    name: "Clear Total Volume Closed"
    on_press:
      - ezo_pmp.clear_total_volume_dosed: ezo_pmp_sr_ph_up
  - platform: template
    name: "Clear Calibration"
    on_press:
      - ezo_pmp.clear_calibration: ezo_pmp_sr_ph_up
  - platform: template
    name: "Pause/Unpause Dosing"
    on_press:
      - ezo_pmp.pause_dosing: ezo_pmp_sr_ph_up
  - platform: template
    name: "Stop Dosing"
    on_press:
      - ezo_pmp.stop_dosing: ezo_pmp_sr_ph_up
Once that's in, flash, and check your entities and all of those will of popped up. From there you can add a card to your dashboard and button press to turn the pump on by whichever way you want, or stop dosing, etc.

A preview of the new webpage with all instructions for the new ezo_pmp component:
https://deploy-preview-2115--esphome.ne ... -ha-config

I haven't tried the sensor calibration commands yet, but this is a preview of the new EZO Sensor page
https://deploy-preview-2133--esphome.ne ... sensor/ezo
That one is

Code: Select all

external_components:
  - source: github://pr#3561
    components: [ ezo ]
Last edited by HydroRay on Fri Jun 17, 2022 7:56 pm, edited 1 time in total.
19delta
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Sun Jun 12, 2022 9:30 am

This is great! Have you tried any of the new methods?
HydroRay
LED-Curious
LED-Curious
Reactions:
Posts: 16
Joined: Tue Feb 22, 2022 5:58 pm

So far everything for the pumps are working fine. From what I can tell you do have to individually write the code for all the entities you want to use (for every pump) in your devices config file, which with a little copy/paste doesn't take long at all.

Haven't messed around with the calibration pull request yet
19delta
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Sun Jun 12, 2022 9:30 am

Just wondering would you being able to provide how the code would look for the ph sensor? Will it look like something below?
sensor:

- platform: ezo
id: ph_ezo
address: 99
unit_of_measurement: "pH"
update_interval: 10s

button:
- platform: template
name: "cal 7"
on_press:
- id(ph_ezo).set_calibration("mid", "7.00");
- platform: template
name: "cal 4"
on_press:
- id(ph_ezo).set_calibration("low", "4.00");
- platform: template
name: "cal 10"
on_press:
- id(ph_ezo).set_calibration("high", "10.00");



I'm wondering because I haven't purchased the meter yet , but I was to know It'll be easy to setup and calibrate before buying.
mike84
LED-Curious
LED-Curious
Reactions:
Posts: 16
Joined: Sun Jun 28, 2020 12:06 am
Location: Australia

finally..... i posted the first esphome integration of ezo sensors on here 2 years ago, and then ended up switching to tasmota just so i could calibrate. Back to esphome it is.
Cheers for the info
mike84
LED-Curious
LED-Curious
Reactions:
Posts: 16
Joined: Sun Jun 28, 2020 12:06 am
Location: Australia

ill set it up this weekend and ill let you know
Post Reply