Poll Wasserwerte Überwachung

Hallo,

Ich wollte nur mein Projekt hier veröffentlichen. Vielleicht hilft es dem einen oder anderen.

Es geht um Poolüberwachung/Wasserqualität.
Die Anzeige erfolgt im HomeAssistant.
Das Ganze läuft auf ESP-Home und das wurde wiederum im HomeAssistant genutzt/gespielt.

Eigentlich habe ich alle Sensoren über die ESOHome Anleitung neu erstellt . Ich habe mir genau angeschaut, wie ein analoger Sensor aussieht UND welche Filter es gibt.

Hardware:
ESP32-WROVER-E

Drucksensor https://www.amazon.de/dp/B07T5CSWHL?ref=ppx_yo2ov_dt_b_product_details&th=1

PH-Sensor https://www.amazon.de/dp/B07QKK1XB6?psc=1&ref=ppx_yo2ov_dt_b_product_details

Kalibrierungslösung

TDS-Sendor Verschmutzung

Temperatur DS18B20

Code

esphome:
  name: esphome-xxxxxxxxx
  friendly_name: ESPHomePool

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "xxxxx"
    password: "xxxxx"

captive_portal:

dallas:
  - pin: GPIO25
    update_interval: 60s

sensor:

#TDS Sensor
# Temperature In °C
  - platform: dallas
    address: xxxxxxxx
    name: "Pool Temperatur"
    id: probe01

# Raw TDS Reading
  - platform: adc
    pin: GPIO36
    name: "TDS 01 Raw"
    attenuation: 6db # only for ESP32
    id: tds01_raw
    update_interval: 60s
    unit_of_measurement: "v"
    accuracy_decimals: 3
    internal: true
  
# Temperature Compensated Voltage
  - platform: template
    name: "TDS 01 TCV"
    id: temp01_comp_v
    unit_of_measurement: 'v'
    accuracy_decimals: 3
    lambda: 'return ((id(tds01_raw).state) / (1 + (0.02 * ((id(probe01).state) - 25.0))));'
    update_interval: 60s
    internal: true

# Temperature Compensated TDS
  - platform: template
    name: "TDS-01"
    unit_of_measurement: "PPM"
    state_class: "measurement"   
    accuracy_decimals: 0
    update_interval: 60s    
    lambda: return (133.42*(id(temp01_comp_v).state)*(id(temp01_comp_v).state)*(id(temp01_comp_v).state) - 255.86*(id(temp01_comp_v).state)*(id(temp01_comp_v).state) + 857.39*(id(temp01_comp_v).state))*0.5;

#PH Sensor
  - platform: adc
    pin: GPIO35
    name: "pH Sensor"
    update_interval: 60s
    attenuation: auto
    device_class: ""
    unit_of_measurement: "pH"
    filters:
      - calibrate_linear:
          - 1.145 -> 6.88
          - 1.319 -> 9.22

#Druck Sensor
  - platform: adc
    pin: GPIO34
    name: "Pumpe Druck"
    update_interval: 60s
    attenuation: auto
    device_class: ATMOSPHERIC_PRESSURE
    state_class: "measurement"
    unit_of_measurement: "bar"
    filters:
      - calibrate_linear:
          - 0.4 -> 0
          - 0.85 -> 0.5
          - 1.45 -> 1 
          - 2.1 -> 1.5
          - 2.9 -> 2    



#Voltlesen
#  - platform: adc
#    pin: GPIO35
#    name: "Flex 0"
#    update_interval: 1s
#    attenuation: auto

Vielleicht hilft das ja jemanden.

1 „Gefällt mir“

Hallo Bluhminga,

vielen Dank für das teilen deines Projektes.
Ich habe auch eine PH-Sonde für den Pool. Wenn ich sie am Schreibtisch kalibriere funktioniert sie ohne Probleme, doch wenn ich sie in den Pool hänge, zeigt sie immer falsche Werte an. War das bei dir auch so?

Viele Grüße
Stefan

@Bluhminga
Servus wie genau hast du den Sensor bitte am ESP32 angeschlossen
Danke
Gruß
Helmut

1 „Gefällt mir“

Hallo,

gar nicht, ich verwende einen Wemos D1 mini, der mit einem ADS1115 verbunden ist.

Gruß
Stefan

1 „Gefällt mir“

@UnuxX1
Servus nochmals aber oben im Code steht doch esp32?

Ja, das stimmt wohl…oder ist es besser, man nimmt nen ESP32?

Hier einmal mein Code…

esphome:
  name: wemos-thomas
  friendly_name: wemos-thomas

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "xxxx"

wifi:
  ssid: !secret xxx
  password: !xxx

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Wemos-Thomas Fallback Hotspot"
    password: "xxxx"

web_server:
  port: 80
  
captive_portal:
    
# i2c Bus auf D1 und D2 konfigurieren
i2c:
  id: bus_a
  sda: D2
  scl: D1
  scan: True


# ADC einrichten, ADDR-Pin ist auf VCC gelegt, daher Adresse 0x49
ads1115:
  - address: 0x49
    id: ads1115_49

# ADC Kanal A0 zur Messwerterfassung 
sensor:
  - platform: ads1115
    multiplexer: 'A1_GND'
    gain: 6.144
    name: "pH Wert"
    id: levelraw
    resolution: 12_BITS
    update_interval: 1s
    unit_of_measurement: ph
    accuracy_decimals: 2
    icon: "mdi:car-coolant-level"
# Messwerte glätten:
    filters:
      - sliding_window_moving_average:
          window_size: 7 #20
          send_every: 4 #20
          send_first_at: 3
# Spannungen nach Messreihe in PH-Wert umrechnen          
      - calibrate_linear:
          - 3.56 -> 4.00
          - 3.30 -> 6.86
          - 3.03 -> 9.18
          #- 4.29 -> 4.00
          #- 3.63 -> 6.86
          #- 3.35 -> 9.18
    
1 „Gefällt mir“