Skip to content
Get started

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 diagnostic binary sensors, optional meter ID and software version text sensors, and an action to clear the accumulated flow stored on the meter.

The UFM-01 flow meter communicates using a specific UART protocol at 2400 baud with even parity and 1 stop bit. One-Wire is not supported; use the manufacturer Arduino library if you need that bus.

UFM-01 ultrasonic flow meter
UFM-01 flow meter. Image by ScioSense.

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 configuration
uart:
- id: uart_bus
tx_pin: GPIOXX
rx_pin: GPIOXX
baud_rate: 2400
parity: EVEN
stop_bits: 1

To use the UFM-01 component, add the following to your configuration:

# Basic UFM-01 configuration
ufm01:
- id: ufm01_component
uart_id: uart_bus # The ID of your UART bus
  • id (Optional, ID): The ID to use for the UFM-01 component.
  • uart_id (Optional, ID): The ID of the UART bus to use.

The ufm01 sensor platform allows you to read accumulated flow, current flow rate, and water temperature from the UFM-01 device.

# Sensor configuration
sensor:
- 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"
  • platform: ufm01

  • ufm01_id (Optional, ID): The ID of the ufm01 component this sensor belongs to.

  • accumulated_flow (Optional): The accumulated flow (volume) sensor.

  • flow (Optional): The current flow rate sensor.

  • temperature (Optional): The water temperature sensor.

When empty_tube is active, or when the meter stops sending valid readings long enough for the component to treat the stream as stale, flow and temperature are published as unknown (NaN). accumulated_flow continues to update while frames are still valid.

The UFM-01 component also exposes several diagnostic binary sensors to report the device’s status.

# Binary sensor configuration
binary_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"
  • platform: ufm01

  • ufm01_id (Optional, ID): The ID of the ufm01 component 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).

  • flow_direction_wrong (Optional): Reports if the flow direction is incorrect.

  • empty_tube (Optional): Reports if the tube is empty.

  • flow_rate_out_of_range (Optional): Reports if the flow rate is out of the measurable range.

The ufm01 text sensors report the meter identity and firmware version.

text_sensor:
- platform: ufm01
ufm01_id: ufm01_component
meter_id:
name: "UFM01 Meter ID"
software_version:
name: "UFM01 Software Version"
  • platform: ufm01

  • ufm01_id (Optional, ID): The ID of the ufm01 component this text sensor belongs to.

  • meter_id (Optional): The 10-digit meter ID from the device.

  • software_version (Optional): The software version reported by the meter.

Clears the accumulated flow stored on the UFM-01. The command is sent once the UART is idle and the automation continues right away; the meter’s acknowledgement, or a timeout, is logged. A request made while one is still pending joins it instead of sending a second command.

on_...:
- ufm01.clear_accumulated_flow: ufm01_component
# Equivalent long form
- ufm01.clear_accumulated_flow:
id: ufm01_component
  • id (Required, ID): The ID of the UFM-01 component.
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"
text_sensor:
- platform: ufm01
ufm01_id: ufm01_component
meter_id:
name: "UFM01 Meter ID"
software_version:
name: "UFM01 Software Version"
button:
- platform: template
name: "Clear UFM01 accumulated flow"
on_press:
- ufm01.clear_accumulated_flow: ufm01_component