feat: add Novato ZRM01 and ZRM02 smart relay support#12139
feat: add Novato ZRM01 and ZRM02 smart relay support#12139Koenkk merged 9 commits intoKoenkk:masterfrom
Conversation
| fingerprint: tuya.fingerprint("TS000F", ["_TZ3218_n0jsuogs"]), | ||
| model: "ZRM01", | ||
| vendor: "Novato", | ||
| description: "Smart relay 1 channel", |
There was a problem hiding this comment.
Instead of from/toZigbee/exposes, can you try with extend: [tuya.modernExtend.tuyaBase(), tuya.modernExtend.tuyaOnOff()],, this also supports the switch type
There was a problem hiding this comment.
Hi @Koenkk, thanks for the suggestion. I tried
extend: [tuya.modernExtend.tuyaBase(), tuya.modernExtend.tuyaOnOff({switchType: true, powerOnBehavior2: true})](also tested with justswitchType: true), but writing fails on this device:Publish 'set' 'switch_type' to '0xa4c1387dc97315db' failed: 'Error: ZCL command 0xa4c1387dc97315db/1 manuSpecificTuya3.write({"switchType":1}, ...) failed (Status 'UNSUPPORTED_ATTRIBUTE')'The helper writes to the
manuSpecificTuya3cluster, but this device exposesswitch_typeandpower_on_behavioras manufacturer-specific attributes on the standardgenOnOffcluster (manufacturerCode0x1141, attributes0x8001and0x8002, ENUM8). On/off works fine because that's just standardgenOnOff.So
tuyaOnOffdoesn't fit here. Would you prefer I keep the local converters (as in the original PR), or is there another modernExtend helper better suited for genOnOff manuf-specific attributes that I missed?
There was a problem hiding this comment.
Tested with m.enumLookup() on both ZRM01 and ZRM02 — works correctly. Pushed the updated commit:
Removed the local fzLocalNovatoZrm / tzLocalNovatoSwitchType / tzLocalNovatoPowerOnBehavior converters
Both definitions now use m.onOff({powerOnBehavior: false}) (since power_on_behavior lives on the manufacturer-specific 0x8002 attribute, not the standard one) plus two m.enumLookup calls for switch_type (0x8001) and power_on_behavior (0x8002), targeting genOnOff with manufacturerCode: 0x1141
For ZRM02 the manuf attributes are device-wide and only readable on endpoint 1, so I set endpointName: "l1" on both lookups
Thanks for the pointer to enumLookup — much cleaner than the original.
refactor: use modernExtend enumLookup for Novato ZRM01/ZRM02
| fingerprint: tuya.fingerprint("TS000F", ["_TZ3218_n0jsuogs"]), | ||
| model: "ZRM01", | ||
| vendor: "Novato", |
There was a problem hiding this comment.
Please merge ZRM01 with QS-Zigbee-SEC01-DC. It should fix this issue:
| name: "switch_type", | ||
| lookup: {kickback: 0, seesa_toggle: 1, seesaw_sync: 2}, |
There was a problem hiding this comment.
Please use the standard naming: toggle, state, momentary.
Also maybe this can be switchType2 in tuyaOnOff?
| m.enumLookup({ | ||
| name: "power_on_behavior", | ||
| lookup: {off: 0, on: 1, memory: 2}, | ||
| cluster: "genOnOff", | ||
| attribute: {ID: 0x8002, type: DataType.ENUM8}, |
There was a problem hiding this comment.
Did you try powerOutageMemory from tuyaOnOff? Seems to be the same attribute
efactor: use tuyaOnOff(powerOutageMemory) and standard naming
|
Thanks @andrei-lazarov, you were right about powerOutageMemory — tested it on both ZRM01 (single endpoint) and ZRM02 (multi-endpoint with endpoints: ["l1", "l2"]) and it works correctly. Updated all three definitions: QS-Zigbee-SEC01-DC — same fix applied, should resolve #27805. Kept it as a separate definition though since SEC01-DC is a dry-contact module while the new ZRM01/ZRM02 are mains AC switching relays — different products despite sharing the TZ3218* SoC family. |
|
Thanks. Did you test the switch type? I think the order is wrong now. I believe: So it would be |
…type naming Per @andrei-lazarov review feedback: - Replace custom enumLookup for 0x8002 with tuyaOnOff({powerOutageMemory: true}) - Rename switch_type values to standard Tuya naming (momentary/toggle/state) Mapping verified against Tuya's official documentation: - 0 (kickback / 回弹式) → momentary (spring-loaded push button) - 1 (seesaw_toggle / 翘板翻转式) → toggle (rocker flip) - 2 (seesaw_sync / 翘板同步式) → state (rocker sync) Apply the same fix to QS-Zigbee-SEC01-DC (_TZ3218_hdc8bbha) which uses the same SoC family and enum semantics. Closes #27805. Tested on _TZ3218_hdc8bbha by feeding voltage pulses to S1: - Value 0: latched toggle on each press-release (push button) - Value 1: relay toggles on each input edge change (rocker flip) - Value 2: relay tracks input level (rocker sync)
Hi @andrei-lazarov, thanks for pushing on this — the labels turned out to need careful checking. According to Tuya's official documentation, the enum values for these
Mapped to standard zigbee-herdsman-converters labels: lookup: {momentary: 0, toggle: 1, state: 2}The "kickback" label is the confusing one in English — it actually refers to the spring-back action of a momentary push button (Chinese 回弹 literally means "spring back"), not "tap and reverse direction." So Verified empirically on
Updated all three definitions in this PR:
All three share the same SoC family ( |
|
Thanks! |
Adds support for Novato ZRM01 (1-channel) and ZRM02 (2-channel) smart relays based on the Tuya TS000F module.
Devices added:
ZRM01— Smart relay 1 channel (_TZ3218_n0jsuogs)ZRM02— Smart relay 2 channel (_TZ3218_sgbsg6mr)Features:
genOnOffclusterpower_on_behaviorattribute (off / on / memory) — manufacturer attribute0x8002, code0x1141switch_typeattribute (kickback / seesa_toggle / seesaw_sync) — manufacturer attribute0x8001, code0x1141Link to picture pull request: Koenkk/zigbee2mqtt.io#5098