📦 ESPHome Components

📦 ESPHome Components

We've released ESPHome components for all of our sensor modules. Have a look at them on GitHub. There are lots of example YAMLs to go through there as well. It makes it incredibly easy to get a fully working device, from hardware all the way to automations, stored metrics, and nice graphs on your desktop.

For our 🌱 EC+pH Kit, take a look at the example_ec_ph_dallas YAML.

substitutions:
  friendly_name: Microfire pH+EC
  device_name: microfire-ph-ec
esphome:
  name: $device_name
esp32:
  board: esp32dev
  framework:
    type: arduino
logger:
api:
ota:
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: $device_name
    password: !secret wifi_failover
captive_portal:

# import the components
external_components:
  - source:
      type: git
      url: https://github.com/u-fire/ESPHomeComponents/

# https://esphome.io/components/i2c.html
i2c:
  sda: 21
  scl: 22

# https://esphome.io/components/sensor/dallas.html
dallas:
  - pin: 23
    id: dallas_temp

sensor:
  - platform: dallas
    index: 0
    name: "Temperature"
    id: water_temp
    on_value:
      then:
        - component.update: ec
        - component.update: ph

  - platform: mod_ec
    id: ec
    update_interval: never
    name: EC
    temperature_sensor: water_temp

  - platform: mod_ph
    id: ph
    update_interval: never
    name: pH
    temperature_sensor: water_temp

button:
  - platform: template
    id: ec_calibrate_low
    name: EC Calibrate Low 0.1
    icon: mdi:format-vertical-align-bottom
    on_press:
        lambda: |-
          id(ec).calibrateLow(0.1);

  - platform: template
    id: ec_calibrate_mid
    name: EC Calibrate Mid 1.0
    icon: mdi:format-vertical-align-center
    on_press:
        lambda: |-
          id(ec).calibrateMid(1.0);

  - platform: template
    id: ec_calibrate_high
    name: EC Calibrate High 10.0
    icon: mdi:format-vertical-align-top
    on_press:
        lambda: |-
          id(ec).calibrateHigh(10.0);

  - platform: template
    id: ec_calibrate_reset
    name: EC Calibrate Reset
    icon: mdi:restore
    on_press:
        lambda: |-
          id(ec).calibrateReset();

  - platform: template
    id: ph_calibrate_low
    name: pH Calibrate Low 4.0
    icon: mdi:format-vertical-align-bottom
    on_press:
        lambda: |-
          id(ph).calibrateLow(4.0);

  - platform: template
    id: ph_calibrate_mid
    name: pH Calibrate Mid 7.0
    icon: mdi:format-vertical-align-center
    on_press:
        lambda: |-
          id(ph).calibrateMid(7.0);

  - platform: template
    id: ph_calibrate_high
    name: pH Calibrate High 10.0
    icon: mdi:format-vertical-align-top
    on_press:
        lambda: |-
          id(ph).calibrateHigh(10.0);

  - platform: template
    id: ph_calibrate_reset
    name: pH Calibrate Reset
    icon: mdi:restore
    on_press:
        lambda: |-
          id(ph).calibrateReset();

  - platform: factory_reset
    name: Restart with Factory Default Settings

Change the pin for the DS18B20 probe and your I2C pins and that's it. With that, you get water temperature, conductivity, and pH measurements. You can also calibrate so everything can be done through Home Assistant.

A big thanks to Pascal Vizeli and Jesse Hills for porting our older sensors to ESPHome. They were a great starting point for these components.