Pool Sensor with ESP32

Hi, can you provide some feedback? Did it work with localtuya? Can you maybe post the config?

HI, i must wait for the Device to deliver :slight_smile:

1 Like

IT WORKED! Thank you! Thank you! Thank you!!!

This forum is the best!

2 Likes

@HG901 let us know how it works and dashboard. I might go for it

So far it is working, and all three sensors (pH, ORP, and temp) show up in home assistant so I added them to the dashboard as a gauge. I haven’t figured out yet how to calibrate the sensors, but it homeassistant showed my pH as being high and my chlorine (ORP) being low, and a test strip confirmed it so at least it’s not too far off. ORP is reported in mV, and converting to PPM seems difficult. My immediate goals will be to figure out how to calibrate and use some of the statistics functions to give me trending numbers that I can use in my next automations (i.e. turn on my chlorine generator and pH reducer).

1 Like

@HG901 you should have gotten calibration solutions with your kit. There are ways to calibrate (again, with the solutions) via esphome but I reflashed the original firmware from atlas, did the calibrate and then reflashed again w my esphome config. Ultimately I just bought a second huzzah esp and keep one with the original firmware and one with esphome.

yes, I have the calibration solutions. I did update my yaml to include the lamda buttons I found here for easy calibration. I also used their code to change my temperature readings to Fahrenheit which is nice.

So you’re good to go then? Sounded like you were having problems still.

I think I am good!

Did you calibrate ORP probe as well?

Yes the calibration “kit” has 4 pouches, 3 for the ph calibration and one of the orp.

…and if you wouldn’t mind posting your yaml as well please, I’ll add the same calibration options you did.

1 Like

Sure. here it is. I haven’t added calibration for ORP. I still need to figure that one out.



sensor:
  - platform: ezo
    id: ph_ezo
    name: "pH"
    address: 99
    accuracy_decimals: 2
    unit_of_measurement: "pH"
    state_class: "measurement"
    update_interval: 15s
  

  - platform: ezo
    id: ph_orp
    name: "Chlorine"
    address: 98
    state_class: "measurement"
    accuracy_decimals: 2
    unit_of_measurement: "mV"
    update_interval: 15s
    

  - platform: ezo
    id: rtd_ezo
    name: "Temperature"
    address: 102
    accuracy_decimals: 2
    unit_of_measurement: "°F"
    update_interval: 15s
    on_raw_value:
     then:
       lambda: |-
         id(ph_ezo).set_tempcomp_value(id(rtd_ezo).state);
    filters:
      - lambda: return x * (9.0/5.0) + 32.0;
    
     

i2c:
  sda: GPIO23 
  scl: GPIO22 
  scan: true
  
button:
  - platform: template
    name: "Clear PH Calibration" 
    id: ph_calibrate_clear
    on_press:
      then: 
        - lambda: id(ph_ezo).clear_calibration();
  - platform: template
    name: "PH 7 Calibrate" 
    id: ph_calibrate_7
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_mid(7.00);
  - platform: template
    name: "PH 10 Calibrate" 
    id: ph_calibrate_10
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_high(10.00);
  - platform: template
    name: "PH 4 Calibrate" 
    id: ph_calibrate_4
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_low(4.00); 
  - platform: template
    name: "pH verify calibration"
    id: ph_calibration_validate
    on_press:
      then:
      - lambda:   id(ph_ezo).send_custom("Cal,?");

captive_portal:

Just got this pool kit from Atlas but im LOST on how to get this into HA. I do have everything working through thingspeak but rather have direct to HA. Anyone talk a esp32 virgin through this?

Update:
so i got it into HA and wirelessly connected but how do i flash it now? I assume adding to HA flashed it back to factory so i need to re-add my sketch through HA?

Update2:
Well that was easier then i thought! I think i got it all working and never would have thought HA esphome was the flashing Program! consider my esp cherry popped.

2 Likes

all working good but i have a small issue with history graph for temperature. The scale is way to big to make sense of it…
graph

any idea how to fix this? Other sensors graph just fine

The graph scale is correct because it has to include the first data point which is about -1,800. That data point is not correct. You either wait until the data point becomes old and historic and passes out of the graph window. Or you use apex charts where you predefined your min/ max axis. Neither solves incorrect data points

well you explained that very well! thank you. makes sense.

Try looking in dev tools, statistics and you might be able to edit out the bad data

@Holdestmade nothing in statistics BUT 24 hours after first testing this the graph is now normal scale so it is looking correct now. Thank you for suggestion

@HG901 Re ORP calibration, I haven’t tried it yet but I think this is what you need to add to your config…

- platform: template
    name: "orp calibration"
    id: orp_calibration
    on_press:
      then:
      - lambda:   id(orp_ezo).send_custom("Cal,225");

Good luck!

Joni

Did you finally manage to make it work?