Koenkk / Koenkk/zigbee2mqtt

SONOFF SWV-ZFE: irrigation volume is reported in deciliters but exposed as liters (10x too high)

Open Beginner friendly
#32,768 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.7k
Forks
2k
Avg merge
18h 55m
Merged PRs (30d)
35

Description

What happened?

The irrigation volume attributes of the SONOFF SWV-ZFE are exposed with unit: "L", but the reported values are 10x higher than the real volume. The device appears to report in deciliters (0.1 L steps) and the converter passes the raw value through without scaling.

Affected exposes:

  • real_time_irrigation_volume
  • hour_irrigation_volume
What did you expect to happen?

Values in liters, matching the actual water delivered.

How to reproduce it (minimal and precise)

Measured on two valves on the same installation, both with a known number of 4 L/h drippers:

Valve Drippers × 4 L/h Expected Reported by hour_irrigation_volume
Front 8 → 32 L/h ~32 320
Back 14 → 57 L/h ~57 570

A full ~1 h irrigation session reported 594 and 328 on the two valves; the physically plausible values are 59.4 L and 32.8 L. Dividing by 10 matches the emitter flow rate on both valves independently.

The manual_irrigation_amount_unit selector is set to liter on both devices (the alternative is US gallon, a 3.785 factor, so it cannot account for a factor of 10).

Notes

This looks like the same class of issue already fixed for another attribute on this device in #27980 — SONOFF SWV "on_time": is in 10s not 1s steps — where the firmware reports in tenths and the converter needed to scale.

In src/devices/sonoff.ts, real_time_irrigation_volume / hour_irrigation_volume are declared with unit: "L" and no scale/divisor, so the raw attribute value is exposed directly.

I have not captured the raw Zigbee frames, so I can't confirm the firmware-side unit — the evidence above is from measured flow rates. Happy to provide logs or run tests if useful.

Zigbee2MQTT version

2.12.1

Adapter firmware version

ZStack3x0, revision 20210708 (2.7.1)

Adapter

zstack (/dev/ttyUSB0)

Device

SONOFF SWV-ZFE — dateCode 20260317, swBuildId 1.0.7
zigbee-herdsman-converters 26.76.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/devices/sonoff.ts and inspect the real_time_irrigation_volume and hour_irrigation_volume exposes, comparing their definitions with the scaling used for the related fix in #27980. Confirm that the converter exposes measured values in liters rather than deciliters, and verify both attributes against the reported examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.