UFM-01 Flow Meter
The ufm01 component allows you to integrate the UFM-01 flow meter
(datasheet,
manufacturer page)
into your ESPHome device. This component reads accumulated flow (volume), current flow rate, and water temperature
from the UFM-01 device via UART. It also provides several diagnostic binary sensors to monitor the device's status.
The UFM-01 flow meter communicates using a specific UART protocol at 2400 baud with even parity and 1 stop bit.
Configuration
Section titled “Configuration”The ufm01 component requires a UART bus to be configured. Ensure your UART bus is set up with baud_rate: 2400,
parity: EVEN, and stop_bits: 1.
# Example UART configurationuart: - id: uart_bus tx_pin: GPIOXX rx_pin: GPIOXX baud_rate: 2400 parity: EVEN stop_bits: 1Component/Hub
Section titled “Component/Hub”To use the UFM-01 component, add the following to your configuration:
# Basic UFM-01 configurationufm01: - id: ufm01_component uart_id: uart_bus # The ID of your UART busConfiguration variables
Section titled “Configuration variables”- id (Optional, ID): The ID to use for the UFM-01 component.
- uart_id (Optional, ID): The ID of the UART bus to use.
Sensor
Section titled “Sensor”The ufm01 sensor platform allows you to read accumulated flow, current flow rate, and water temperature from the
UFM-01 device.
# Sensor configurationsensor: - platform: ufm01 ufm01_id: ufm01_component # The ID of your UFM-01 component accumulated_flow: name: "UFM01 Accumulated Flow" flow: name: "UFM01 Flow Rate" temperature: name: "UFM01 Water Temperature"Configuration variables
Section titled “Configuration variables”-
platform:
ufm01 -
ufm01_id (Optional, ID): The ID of the
ufm01component this sensor belongs to. -
accumulated_flow (Optional): The accumulated flow (volume) sensor.
- All options from Sensor.
-
flow (Optional): The current flow rate sensor.
- All options from Sensor.
-
temperature (Optional): The water temperature sensor.
- All options from Sensor.
When empty_tube is active, flow and temperature are published as unknown (NaN). accumulated_flow continues
to update.
Binary Sensor
Section titled “Binary Sensor”The UFM-01 component also exposes several diagnostic binary sensors to report the device's status.
# Binary sensor configurationbinary_sensor: - platform: ufm01 ufm01_id: ufm01_component # The ID of your UFM-01 component ufc_chip_error: name: "UFM01 UFC Chip Error" flow_direction_wrong: name: "UFM01 Flow Direction Wrong" empty_tube: name: "UFM01 Empty Tube" flow_rate_out_of_range: name: "UFM01 Flow Rate Out of Range"Configuration variables
Section titled “Configuration variables”-
platform:
ufm01 -
ufm01_id (Optional, ID): The ID of the
ufm01component this binary sensor belongs to. -
ufc_chip_error (Optional): Reports if there is an error with the UFC chip (ultrasonic flow converter; datasheet ST2 bit 5).
- All options from Binary Sensor.
-
flow_direction_wrong (Optional): Reports if the flow direction is incorrect.
- All options from Binary Sensor.
-
empty_tube (Optional): Reports if the tube is empty.
- All options from Binary Sensor.
-
flow_rate_out_of_range (Optional): Reports if the flow rate is out of the measurable range.
- All options from Binary Sensor.
Full Example Configuration
Section titled “Full Example Configuration”uart: - id: uart_bus tx_pin: GPIOXX rx_pin: GPIOXX baud_rate: 2400 parity: EVEN stop_bits: 1
ufm01: - id: ufm01_component uart_id: uart_bus
sensor: - platform: ufm01 ufm01_id: ufm01_component accumulated_flow: name: "UFM01 Accumulated Flow" flow: name: "UFM01 Flow Rate" temperature: name: "UFM01 Water Temperature"
binary_sensor: - platform: ufm01 ufm01_id: ufm01_component ufc_chip_error: name: "UFM01 UFC Chip Error" flow_direction_wrong: name: "UFM01 Flow Direction Wrong" empty_tube: name: "UFM01 Empty Tube" flow_rate_out_of_range: name: "UFM01 Flow Rate Out of Range"