Discover SONOFF water valve as MQTT valve - #32367
Open
MaxRink wants to merge 1 commit into
Open
Conversation
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
June 22, 2026 10:55
1d7a9d2 to
19a2ac1
Compare
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
3 times, most recently
from
June 22, 2026 11:30
b4e01f6 to
6e1e2e6
Compare
Owner
|
Given that the |
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
June 22, 2026 19:44
6e1e2e6 to
1f86eb0
Compare
Contributor
Author
|
Yes, changing the Home Assistant discovery component from I adjusted the implementation so the old object ID shape is preserved ( |
This was referenced Jun 23, 2026
Owner
|
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
June 23, 2026 18:44
ba3bc8a to
bdf543a
Compare
Owner
|
Im wondering if we maybe can just do this through the override ha discovery payload which already exists in zhc? |
MaxRink
marked this pull request as draft
June 25, 2026 17:05
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
June 25, 2026 17:52
bdf543a to
c1e78d9
Compare
MaxRink
marked this pull request as ready for review
July 4, 2026 19:46
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
July 31, 2026 12:11
c1e78d9 to
7782333
Compare
MaxRink
force-pushed
the
ha-discovery-valve-switch
branch
from
August 14, 2026 17:35
7782333 to
895091e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discover switch exposes as Home Assistant MQTT
valveentities when ZHC expose metadata declareshomeassistant: {type: "valve"}.The object ID remains the existing switch-shaped value (
switchorswitch_<endpoint>), so this PR does not add an avoidable entity rename on top of the Home Assistant component/domain migration.Why
SONOFF water valves are exposed by ZHC as on/off switch-like Zigbee devices, but they are semantically valves in Home Assistant. ZHC now carries this intent on the expose itself via
withHomeAssistant, so Zigbee2MQTT can translate that generic expose metadata without hardcoding a device model.Review note
Koenkk flagged that changing the Home Assistant component and the object ID together would be breaking for users. This PR stays narrow and keeps the object ID stable, so only the HA component mapping changes here.
Validation
Local validation in
/private/tmp/z2m-valve-discovery:node --run checknode --run test -- test/extensions/homeassistant.test.ts -t "MQTT valve"node --run buildgit diff --check origin/dev...HEADPaired work
homeassistant: {type: "valve"}.