zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

SONOFF SWV real_time_irrigation_volume does not reset between irrigation cycles

Open axl5324 opened this issue 3 months ago • 5 comments

What happened?

The real_time_irrigation_volume sensor for the SONOFF SWV (and SWV-BSP) does not reset to 0 when a new irrigation cycle starts or ends.

Instead of reporting the water volume delivered during the single/current session, the value keeps accumulating across multiple runs, behaving like an ongoing cumulative counter rather than a real-time session volume.

What did you expect to happen?

real_time_irrigation_volume should either reset to 0 at the beginning of each irrigation session or report only the total volume delivered during the last completed cycle.

How to reproduce it (minimal and precise)

  1. Run an irrigation cycle on SONOFF SWV and observe real_time_irrigation_volume.
  2. Stop the irrigation.
  3. Run a second irrigation cycle.
  4. Observe that real_time_irrigation_volume resumes from the previous value instead of resetting to 0.

Device details

  • Device Model: SONOFF SWV / SWV-BSP
  • IEEE Address: 0xf4b3b1fffe4df5e4
  • Firmware Version: 1.0.4 (4100)
  • Zigbee2MQTT Version: 2.13.0

Zigbee2MQTT version

2.13.0

Adapter firmware version

7.4.3 [GA]

Adapter

ZBDongle-E

Setup

Zigbee2mqtt on docker container

Device database.db entry

No response

Debug log

No response

Notes

No response

axl5324 avatar Aug 24 '26 11:08 axl5324

I noticed the same behaviour. Same device firmware etc., but running Zigbee2MQTT Version: 2.12.0

To add to the observation above: There appears to be some kind of resetting the volume, but it is unclear to me when that happens. Seems like some arbitrary time between two irrigation sessions? I think that the volume should be reset every time the valve is opened . . .

edsub avatar Sep 07 '26 14:09 edsub

I traced the SWV definition shipped with Zigbee2MQTT 2.13.0 (zigbee-herdsman-converters 26.90.0). In src/devices/sonoff.ts, real_time_irrigation_volume maps directly to attribute 0x5007 of customClusterEwelink; daily_irrigation_volume is a separate attribute, 0x500f. The numeric converter forwards the reported value, including zero. It does not add successive reports together or reset this value on an ON/OFF transition.

Could someone capture a short debug excerpt covering the end of one normal watering session and the start of the next? The useful comparison is the incoming 0x5007 / 20487 values against the published MQTT real_time_irrigation_volume, with the corresponding ON/OFF messages. If available, include 0x500f / 20495 and the irrigation start/end fields too. An excerpt for this valve with device addresses redacted would be enough.

If the incoming 0x5007 values themselves continue across sessions, that points toward the device's counter/reporting behaviour. If a zero arrives but the MQTT value stays nonzero, it gives us a concrete decoding/state-publication case to investigate. Missing a reset report alone would not distinguish those cases.

This field is exposed as report-only, so a normal /set request to force it to zero is not supported. I don't have this valve available to reproduce the firmware behaviour; the above is a source-level check and a way to narrow the diagnosis.

aspinozaxxx-lab avatar Sep 19 '26 09:09 aspinozaxxx-lab

Happy to get you a debug excerpt for one watering session once I know what to do..... @aspinozaxxx-lab Can you give me a short instruction on what to capture from where durin a watering session?

Just looking again at the Z2MQTT fields I noticed that it looks like the "Real time irrigation volume" is a total volume and "Daily irrigation volume" is what the title says. The issue is therefore likely due to an improper title of the "Realtime irrigation volume" and an incorrect subtitle, definitely not "Volume of the last/current irrigation session" . I can (if properly named) live with what we currently have (can fix the session volume as well) but based on the title/subtitle I thought this would be dropdead easy.....

Image

edsub avatar Sep 21 '26 20:09 edsub

Thanks, @edsub — happy to help. For the Z2M 2.12.0 you mentioned:

  1. In the Zigbee2MQTT web UI, open Settings → Settings → Advanced, change Log level to debug and save. This setting takes effect without restarting.
  2. Capture the next normal watering and note its start/end times. One complete session is a useful start; the beginning of the following normal session helps check for a reset. No extra watering needed.
  3. Use the log file: the UI's Logs tab hides debug lines by default. With default file logging, it is log/<timestamp>/log.log inside Zigbee2MQTT's data directory. The Advanced settings Log directory and Log file show any customized location.
  4. Share the lines for this valve from just before it opens until shortly after it closes, particularly Received Zigbee message and MQTT publish. Replace identifying names/addresses consistently, and omit other devices. No configuration or full startup log needed.
  5. Restore the previous Log level afterwards.

If you cannot find the file, tell me whether you use the HA add-on, Docker or another setup and I can give the exact steps.

Your observation about the label makes sense. It may be a naming issue, but we do not yet know when that counter resets. Comparing the raw reports with the published values will help narrow that down.

aspinozaxxx-lab avatar Sep 22 '26 06:09 aspinozaxxx-lab

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Nov 22 '26 00:11 github-actions[bot]