Water Meter via a Tuya Flow Meter

Hi! I have been looking around for a smart water meter, I know about flume and other strap on meters, but unfortunately they would not work where i’m from, so i’ve been looking for a connected flow meter that i can use as a water meter and i found one in tuya!

Tuya Flow Meter / Sprinkler Timer (Alibaba Link)

Tuya Flow Meter / Sprinkler Timer (Amazon Link)

The Flow Meter / marketed as sprinkler or valve controller has a unit that connects to your water pipe and connects via hub. Pretty straightforward, aside from being able turn on and off the valve and to set times, volumes, it’s pretty useful as a water meter. I’m planning to install this on my main water tank, and another after my rain water system so I can get a read on how much water i’m using from each source.

This unit however, is still unsupported on the official tuya integration. Hoping that home assistant might be able to support this. As I understand, i would have to post the details of the product from the tuya iot platform so it would have a chance to get included in the next releases. Hope this is ok? @frenck

Hub Information:

Product Name: 智能_网关
Product Category: wg2
Instruction Set:
alarm_time	Integer	
{
  "unit": "min",
  "min": 1,
  "max": 60,
  "scale": 0,
  "step": 1
}
switch_alarm_sound	Boolean	
"{true,false}"
alarm_volume	Enum	
{
  "range": [
    "low",
    "middle",
    "high",
    "mute"
  ]
}
master_state	Enum	
{
  "range": [
    "normal",
    "alarm"
  ]
}
factory_reset	Boolean	
"{true,false}"
alarm_active	String	
{
  "maxlen": 255
}

Valve Controller Information:

Product Name: 智能水阀(二代)
Product Category: sfkzq

Status Set:

switch	Boolean	
"{true,false}"
percent_control	Integer	
{
  "unit": "%",
  "min": 0,
  "max": 100,
  "scale": 0,
  "step": 5
}
percent_state	Integer	
{
  "unit": "%",
  "min": 0,
  "max": 100,
  "scale": 0,
  "step": 1
}
water_once	Integer	
{
  "unit": "L",
  "min": 0,
  "max": 1000,
  "scale": 1,
  "step": 1
}
water_total	Integer	
{
  "unit": "L",
  "min": 1,
  "max": 9999,
  "scale": 0,
  "step": 1
}
battery_percentage	Integer	
{
  "unit": "%",
  "min": 0,
  "max": 100,
  "scale": 0,
  "step": 1
}
weather_delay	Enum	
{
  "range": [
    "cancel",
    "24h",
    "48h",
    "72h"
  ]
}
countdown	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}
use_time_one	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}

Standard Instruction Set:

switch	Boolean	
"{true,false}"
percent_control	Integer	
{
  "unit": "%",
  "min": 0,
  "max": 100,
  "scale": 0,
  "step": 5
}
weather_delay	Enum	
{
  "range": [
    "cancel",
    "24h",
    "48h",
    "72h"
  ]
}
countdown	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}

After buying and testing a few other stuff, i found this to be my best option. Does anyone have other suggestions?

1 Like

Are you able to open it up enough to see if it has an ESP8266 in it?

Hi Marc! @mrand

I’ll see if i can open the cover over the weekend, although, i have 0 experience with flashing and soldering. But if it can work, i’m open to trying.

Thanks! Will update after I open it up

How is this project going?

Hi! Sorry, been busy with work. I tried another way by ordering a dumb item on amazon.

Digiten Flow Meter

Hopefully this can achieve what i need. Dumb solution but whatever works.

Will post a picture of the Tuya flow meter once I open it up. Maybe you can guide me through the process if there is an ESP inside.

Grand unboxing: (Although I would prefer an out of the box solution to this as it would be easier to scale).

If anyone would like to test a solution though, I would like to contribute by donating or buying a test unit. We already have an abundance of energy meters and I hope that more water meters come out, it would really help to get a grasp on consumption and boost conservation of clean water.

1 Like

theres no way you could use this in house water mains??

Hi! How do you mean? I can use this via the tuya app but it is not supported in home assistant.

Sorry, I missed your reply on this. Nice of them to mark RX, TX, and GND. What does the other side of the PCB have on it?

Try this local Tuya by “make-all”.

(Remove other local Tuya first)
*I set up WiFi hub & water valve(sub device) by ccid number, then my water valve was recognized as a switch & other relevant functions were generated.
*Important: Irrigation time must be set before switch on water valve.

Hi @ado24313 how did you get your sfkzq to fully integrate with Make-All’s Local Tuya? I can’t get mine to return the status of the switch. I can only get about 6 of the entities to detect.

The main one I’m having trouble with is Work_state, which I have removed from the configuration but which uses DP: 12

Instruction Set

switch	Boolean	
"{true,false}"
weather_delay	Enum	
{
  "range": [
    "cancel",
    "24h",
    "48h",
    "72h"
  ]
}
countdown	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}`

Status Set

switch	Boolean	
"{true,false}"
battery_percentage	Integer	
{
  "unit": "%",
  "min": 0,
  "max": 100,
  "scale": 0,
  "step": 1
}
battery_state	Enum	
{
  "range": [
    "low",
    "middle",
    "high"
  ]
}
use_time	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 2592000,
  "scale": 0,
  "step": 1
}
weather_delay	Enum	
{
  "range": [
    "cancel",
    "24h",
    "48h",
    "72h"
  ]
}
countdown	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}
work_state	Enum	
{
  "range": [
    "auto",
    "manual",
    "idle"
  ]
}
use_time_one	Integer	
{
  "unit": "s",
  "min": 0,
  "max": 86400,
  "scale": 0,
  "step": 1
}

My Specific “MoistenLand” device YAML

name: Moistenland Irrigation
products:
  - id: 8t5hebn0
    name: MoistenLand Timer
primary_entity:
  entity: switch
  dps:
    - id: 1
      name: switch
      type: boolean

secondary_entities:
  - entity: sensor
    name: Fault reporting
    category: diagnostic
    dps:
      - id: 4
        type: integer
        name: sensor
  - entity: sensor
    name: Battery
    class: battery
    category: diagnostic
    dps:
      - id: 7
        type: integer
        name: sensor
        unit: "%"
  - entity: select
    name: Weather delay
    icon: "mdi:weather-cloudy-clock"
    category: config
    dps:
      - id: 10
        type: string
        name: option
        mapping:
          - dps_val: "cancel"
            value: "Off"
          - dps_val: "24h"
            value: "1 day"
          - dps_val: "48h"
            value: "2 days"
          - dps_val: "72h"
            value: "3 days"
  - entity: number
    category: config
    name: Timer
    icon: "mdi:timer"
    dps:
      - id: 11
        name: value
        type: integer
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    name: use_time_one
    category: diagnostic
    dps:
      - id: 15
        type: integer
        name: sensor
        range:
          min: 0
          max: 86400
        unit: min
        mapping:
          - scale: 0
            step: 1

When I try to add DP:12 I’m breaking my config and it doesn’t detect anything.
Log is

Device matches asc_wifi_circuit_breaker with quality of 29%. DPS: {"updated_at": 1694531895.904082, "1": true, "4": 0, "7": 100, "8": "high", "10": "cancel", "11": 3600, "12": "manual"}

I added

  - entity: sensor
    name: Mode
    category: diagnostic
    dps:
      - id: 12
        type: string
        name: option
        mapping:
          - dps_val: "manual"
            value: "Manual"
          - dps_val: "auto"
            value: "Auto"
          - dps_val: "idle"
            value: "Idle"

Okay I’m just a bonehead. I think I have it all sorted out. Leaving this here for anyone with a Moistenland Bluetooth Irrigation Timer. The entities look to work, however the statuses and Work_state doesn’t seem to be updating. Not sure if there is some kind of issue with subdevices through this bluetooth gateway.

name: Moistenland Irrigation
products:
  - id: 8t5hebn0
    name: MoistenLand Timer
primary_entity:
  entity: switch
  dps:
    - id: 1
      name: switch
      type: boolean

secondary_entities:
  - entity: sensor
    name: Fault reporting
    category: diagnostic
    dps:
      - id: 4
        type: integer
        name: sensor
  - entity: sensor
    name: Battery
    class: battery
    category: diagnostic
    dps:
      - id: 7
        type: integer
        name: sensor
        unit: "%"
  - entity: select
    name: Weather delay
    icon: "mdi:weather-cloudy-clock"
    category: config
    dps:
      - id: 10
        type: string
        name: option
        mapping:
          - dps_val: "cancel"
            value: "Off"
          - dps_val: "24h"
            value: "1 day"
          - dps_val: "48h"
            value: "2 days"
          - dps_val: "72h"
            value: "3 days"
  - entity: number
    category: config
    name: Timer
    icon: "mdi:timer"
    dps:
      - id: 11
        name: value
        type: integer
        unit: min
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    name: use_time_one
    category: diagnostic
    dps:
      - id: 15
        type: integer
        name: sensor
        range:
          min: 0
          max: 86400
        unit: min
        mapping:
          - scale: 60
            step: 60
  - entity: sensor
    name: Work Mode
    class: enum
    category: diagnostic
    dps:
      - id: 12
        type: string
        name: sensor
        mapping:
          - dps_val: "manual"
            value: "Manual"
          - dps_val: "auto"
            value: "Auto"
          - dps_val: "idle"
            value: "Idle"