[Feature request]: Expose 'actual_irrigation_amount' as a standalone sensor for Sonoff SWV / Zigbee Smart Water Valve
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.7k
- Forks
- 2k
- Avg merge
- 18h 55m
- Merged PRs (30d)
- 35
Description
Is your feature request related to a problem? Please describe
I am using the Sonoff SWV (SWV-ZFE) Zigbee Smart Water Valve in Home Assistant via Zigbee2MQTT. Currently, the real-time water consumption for the active irrigation cycle is nested inside the JSON string payload of irrigation_schedule_status under the key actual_irrigation_amount.
Because Home Assistant has a strict 255-character limit for entity states, long JSON strings pushed directly as state values get truncated.
Furthermore, the currently exposed x_real_time_irrigation_volume sensor is misleadingly named: it behaves as a daily total volume (resets at midnight and updates every 5 minutes) rather than showing the actual real-time volume of the ongoing cycle.
Describe the solution you'd like
It would be great if Zigbee2MQTT could expose actual_irrigation_amount directly as a standalone sensor (e.g. sensor.<device>_actual_irrigation_amount with unit L).
Having this as a dedicated sensor would:
- Avoid truncation issues caused by the HA 255-character state limit;
- Allow users to easily track exact real-time water consumption during each irrigation run and use it natively in Home Assistant dashboards or automations.
Describe alternatives you've considered
Currently using string-splitting workaround templates in Home Assistant to extract 'actual_irrigation_amount' from the truncated irrigation_schedule_status state, which is fragile and inefficient.
If anyone needs to extract the real-time value from the truncated state (e.g., using custom:template-entity-row or a template sensor), you can use this extraction logic:
{% set value = states('sensor.irrigazione_giardino_irrigation_schedule_status') %}
{% if 'actual_irrigation_amount' in value %}
{{ value.split("'actual_irrigation_amount': ")[1].split(',')[0] | trim }} L
{% else %}
N/D
{% endif %}
Additional context
Device information
- Device Model: SONOFF SWV / SWV-ZFE (Zigbee Smart Water Valve)
- Integration: Zigbee2MQTT
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Sonoff SWV/SWV-ZFE device converter and the existing irrigation_schedule_status and x_real_time_irrigation_volume definitions. Expose actual_irrigation_amount as a standalone sensor with unit L, then add or update the relevant converter tests to verify the value and naming.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100