Skip to main content Microfireย 

Mod-ORP for Home Assistant



๐Ÿ“’ Datasheet

Datasheet

PDF DOC HTML

In this write-up, we will install ESPHome to get ORP measurements into Home Assistant.

  • We will be working in a terminal and using a few commands
  • You'll need a Home Assistant installation running
  • An ESP-device
  • A Mod-ORP module and preferably a carrier board


These instructions are for the CLI version of ESPHome. You can also copy and paste the YAML into the ESPHome addon within Home Assistant and avoid the CLI completely.



1.

๐Ÿ“ฆ Install ESPHome

Follow the instructions on the ESPHome website.

2.

๐Ÿ Start a project

Type in the terminal. Make sure the path on the terminal is where you want the project to be. Follow the steps, and there should be a .yaml file in the directory you ran the command in. For this write-up, it will be mod-orp.yaml. If you type you should see the project compile.

3.

๐Ÿ”Œ Connections

  • Wiring for ESP32 and the carrier board
    Module
    Controller
    GND ground
    VCC 3.3 - 5 volt power supply
    SCL SCL
    SDA SDA
    PROBE_1 input probe wire
    PROBE_2 reference probe wire
  • Wiring for ESP32 and the carrier board
    Carrier Board
    Controller
    GND ground
    VIN 3.3 - 5 volt power supply
    SCL SCL
    SDA SDA
    1W optional 1-wire device signal line
    EN optional EN wire, drive HIGH to disable both power modules
    Carrier 1W Header
    1-Wire Sensor
    GND ground
    VCC 3.3 - 5 volt power supply
    SIG signal data line for 1-Wire sensor

    Probe connection is made with the SMA connector, using a SMA-BNC Bulkhead or similar.


4.

๐Ÿ”ข Code

We'll use an external sensor component to get the Mod-ORP module working. This is done by adding some lines to the YAML.


The YAML file should be changed to the following:

1
substitutions:
2
  friendly_name: Microfire Mod-ORP
3
  device_name: microfire-mod-orp
4
esphome:
5
  name: $device_name
6
esp32:
7
  board: esp32dev
8
  framework:
9
    type: arduino
10
logger:
11
api:
12
ota:
13
wifi:
14
  ssid: !secret wifi_ssid
15
  password: !secret wifi_password
16
  ap:
17
    ssid: $device_name
18
    password: !secret wifi_failover
19
captive_portal:
20

21
# import the mod-orp component
22
external_components:
23
  - source:
24
      type: git
25
      url: https://github.com/u-fire/ESPHomeComponents/
26

27
# https://esphome.io/components/i2c.html
28
i2c:
29
  sda: 21
30
  scl: 22
31

32
sensor:
33
  - platform: mod_orp
34
    id: orp
35
    name: ORP
36

37
button:
38
  - platform: template
39
    id: orp_calibrate_low
40
    name: ORP Calibrate Single 400 mV
41
    icon: mdi:format-vertical-align-center
42
    on_press:
43
        lambda: |-
44
          id(orp).calibrateSingle(400);
45
  
46
  - platform: template
47
    id: orp_calibrate_reset
48
    name: ORP Calibrate Reset
49
    icon: mdi:restore
50
    on_press:
51
        lambda: |-
52
          id(orp).calibrateReset();
53
54
  - platform: factory_reset
55
    name: Restart with Factory Default Settings

Make sure you change the wifi section to your network and password if you aren't using a secrets.yaml. Check that the i2c section is using the correct pins.



5.

โžก๏ธ Upload

Type . It will compile the project and ask you which serial device to upload the code to. After that, you'll see the ESP debug output. If everything goes to plan, you should see a device has been discovered in Home Assistant.



6.

๐Ÿ  Home Assistant

From within Home Assistant, press Settings > Devices & Services and find the device in the ESPHome integration box. Click it and then click where it says 1 Device. You should see a screen with all the information, Mod-ORP measurement, and some buttons to calibrate and reset the device. You can create dashboards, scripts, and anything else Home Assistant can do from here.

There is more documentation and examples for various combinations of sensors/modules on our ESPHomeComponents GitHub repo

.




Related items