esphome-docs icon indicating copy to clipboard operation
esphome-docs copied to clipboard

Documentation for Atlas Scientific Peristaltic Pump

Open carlos-sarmiento opened this issue 2 years ago • 13 comments

Description:

Initial Documentation for the EZO-PMP peristaltic pump.

Pull request in esphome with YAML changes (if applicable): esphome/esphome#3528

Checklist:

  • [x] Branch: next is for changes and new documentation that will go public with the next ESPHome release. Fixes, changes and adjustments for the current release should be created against current.
  • [x] Link added in /index.rst when creating new documents for new components or cookbook.

carlos-sarmiento avatar Jun 05 '22 17:06 carlos-sarmiento

Deploy Preview for esphome ready!

Name Link
Latest commit 63055fff739d002ca89a63c547f93d124af7a2b9
Latest deploy log https://app.netlify.com/sites/esphome/deploys/631589a6b7f3630008bbe721
Deploy Preview https://deploy-preview-2115--esphome.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 11 '22 02:06 netlify[bot]

I've been using this for a few days now and am so so happy you've been able to write this, it's a game changer for my farm :)

Just one quick question/request: Is it possible to include the ability to change the i2c addresses of the pumps or is that something that can already be done via lambdas? If so, what would the code be to do it?

Thank you so much for creating this successful component!

Assunto avatar Jun 19 '22 18:06 Assunto

It looks like it's already possible if you pass the device address / alternative device address to the component:

ezo_pmp:
  id: hcl_pump
  update_interval: 1s
  address: 103

If you have multiple pumps you can instantiate the component multiple times:

ezo_pmp:
  - id: hcl_pump0
    update_interval: 1s
    address: 103
  - id: hcl_pump1
    update_interval: 1s
    address: 109

syssi avatar Jun 19 '22 18:06 syssi

I don't think that's quite what I'm asking but maybe it is...

If you are trying to set up multiple pumps they all start off at i2c address 103. In Tasmota (or Arduino I bet) you plug in the first pump and send a command to change the address to something else, then plug in the second pump and repeat the process until all the pumps have an unique i2c address. I don't know if the ezo_pmp component has that capability... possibly through a lambda code?

I'm guessing it's similar to PR #2133 which enables the ability to send commands and receive information for EZO sensors.

Assunto avatar Jun 19 '22 18:06 Assunto

I can add support for the i2c address command

On Sun, Jun 19, 2022, 1:53 PM Assunto @.***> wrote:

I don't think that's quite what I'm asking but maybe it is...

If you are trying to set up multiple pumps they all start off at i2c address 103. In Tasmota (or Arduino I bet) you plug in the first pump and send a command to change the address to something else, then plug in the second pump and repeat the process until all the pumps have an unique i2c address. I don't know if the ezo_pmp component has that capability... possibly through a lambda code?

— Reply to this email directly, view it on GitHub https://github.com/esphome/esphome-docs/pull/2115#issuecomment-1159792221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOQRMNQDBTICNYDLJIZAMTVP5UB5ANCNFSM5X5L2I4Q . You are receiving this because you authored the thread.Message ID: @.***>

carlos-sarmiento avatar Jun 19 '22 18:06 carlos-sarmiento

Oh, you are right. I didn't understand your question. The command from page 46 is what you are looking for (an alternative address between 1 and 127). Thanks Carlos for your engagement!

syssi avatar Jun 19 '22 19:06 syssi

Terrific!!

Now I was wondering if you could clarify/confirm how to properly use the number: part you included.

Let's say I want to use ezo_pmp.dose_volume: but sometimes I want to dispense 2ml and other times I want to dispense 10ml. For that I should set up the button with lambdas

button:
  - platform: template
    name: "SR pH Up Dose Volume"
    on_press:
      - ezo_pmp.dose_volume:
          id: ezo_pmp_sr_ph_up
          volume: !lambda |-
                  return id(volume).state;

and

number:
  - platform: template
    id: volume
    name: "Volume"
    optimistic: true
    min_value: 0
    max_value: 100
    step: 0.01

so I can adjust the volume from the dashboard instead of having to go in and rewrite the code every time. Is that right or am I missing something?

Or is there a way to have the button with a slider right inside the entity?

Assunto avatar Jun 19 '22 19:06 Assunto

@Assunto I've added the code for I2C address change to the PR and the documentation.

On your second question, you need two separate components, like the example provided. There is no way to have a button that takes parameters directly in Home Assistant (and by extension ESPHome)

carlos-sarmiento avatar Jun 19 '22 19:06 carlos-sarmiento

Makes sense, thank you very much for the update and help :)

Assunto avatar Jun 19 '22 21:06 Assunto

Sorry for the noob question.

(UPDATE)

So i downloaded manually the files from here:

https://github.com/esphome/esphome/tree/4cdc36ac56d7cdaca85f824b3fbbc148451d78aa/esphome/components/ezo_pmp

and stored them in config/esphome/custom components, now I'm getting this error while compiling and I just cant figure out what the hell

` src/esphome/components/ezo_pmp/ezo_pmp.cpp: In member function 'virtual void esphome::ezo_pmp::EzoPMP::update()':

src/esphome/components/ezo_pmp/ezo_pmp.cpp:54:86: error: 'class esphome::ezo_pmp::EzoPMP' has no member named 'calibration_status_' this->queue_command_(EZO_PMP_COMMAND_READ_CALIBRATION_STATUS, 0, 0, (bool) this->calibration_status_); ^ src/esphome/components/ezo_pmp/ezo_pmp.cpp: In member function 'void esphome::ezo_pmp::EzoPMP::read_command_result_()': src/esphome/components/ezo_pmp/ezo_pmp.cpp:201:19: error: 'class esphome::ezo_pmp::EzoPMP' has no member named 'dosing_mode_' if (this->dosing_mode_ && this->dosing_mode_->state != DOSING_MODE_NONE) ^

.

repeats with a lot of variables...

. ^ src/esphome/components/ezo_pmp/ezo_pmp.cpp:282:15: error: 'class esphome::ezo_pmp::EzoPMP' has no member named 'dosing_mode_' this->dosing_mode_->publish_state(DOSING_MODE_NONE); ^ *** [/data/atlas-wifi-hydroponics/.pioenvs/atlas-wifi-hydroponics/src/esphome/components/ezo_pmp/ezo_pmp.cpp.o] Error 1 ========================== [FAILED] Took 3.97 seconds ==========================`

thanks a lot for the help! I need this badly for work :D


I just cannot make the ezo_pmp work. when I try to add this to the Esphome:

ezo_pmp:

  • id: ezo_pmp_sr_ph_up address: 103

I get a "Component not found: ezo_pmp" error in red letters at the start of the compiling.

Things I've tried:

  1. Adding to the sensor config file

external_components:

  • source: github://pr#3528 components: [ ezo_pmp ]
  1. Creating manually a folder in Home Assistant and downloading the files from github. /config/esphome/.esphome/external_components/8ff3b345/esphome/components/ezo_pmp

  2. updating everything

any ideas? thanks in advance :D

jnrivra avatar Aug 19 '22 18:08 jnrivra

@jnrivra I'm not sure if you're still having trouble but here's my sample code to get everything working.

Make sure to add this first and install, then go back in and add the rest.

external_components:
  - source: github://pr#3528
    components: [ ezo_pmp ]

During the install look at the logs to find out which i2c address the pump is located at, then go back in the config file and add the following:

ezo_pmp:
  - id: ezo_pmp_nr_ph_up
    address: 103 #or whatever yours is
    update_interval: 60s

To get information about your pump:

binary_sensor:
  - platform: ezo_pmp
    id: ezo_pmp_nr_ph_up
    pump_state:
      id: nr_ph_up_pump_state
      name: "NR pH Up Pump State"
    is_paused:
      id: nr_ph_up_is_paused
      name: "NR pH Up Is Paused"

sensor:
  - platform: ezo_pmp
    id: ezo_pmp_nr_ph_up
    total_volume_dosed:
      name: "NR pH Up Total Volume Dosed"
    absolute_total_volume_dosed:
      name: "NR pH Up Absolute Total Volume Dosed"

text_sensor:
  - platform: ezo_pmp
    id: ezo_pmp_nr_ph_up
    dosing_mode:
      name: "NR pH Up Dosing Mode"
    calibration_status:
      name: "NR pH Up Calibration Status"

In order to actually use the pump you'll need a button:

button:
  - platform: template
    name: "NR pH Up Dose Volume"
    on_press:
      - ezo_pmp.dose_volume:
          id: ezo_pmp_nr_ph_up
          volume: !lambda |-
                  return id(nr_dose_volume).state;

But a button is no good if there's no volume specified, so to be able to define it:

number:
  - platform: template
    id: nr_dose_volume
    name: "NR Dose Volume"
    optimistic: true
    min_value: 0
    max_value: 50
    step: 0.5

Of course @carlos-sarmiento added a lot more functionality but this should get you up and running.

Assunto avatar Sep 21 '22 20:09 Assunto

What I'm wondering is why this wasn't included in this month's update if it's passed everything and has the "next" label...

Assunto avatar Sep 21 '22 20:09 Assunto

It's not actually merged to next yet because the related code hasn't been merged to dev yet.

ssieb avatar Sep 21 '22 20:09 ssieb