Skip to content
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4f07e15
Update tuya.ts
Kigrou Oct 29, 2025
d885dcc
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 2, 2025
aeabc7c
Merge branch 'master' into patch-1
Kigrou Nov 2, 2025
6b6b15d
Update tuya.ts
Kigrou Dec 6, 2025
2aa0b48
Merge branch 'master' into patch-1
Kigrou Dec 12, 2025
14249d7
fix: Enhance ZCL specification (#10983)
Nerivec Dec 13, 2025
66b208c
fix: Onokom: fix descriptions (#11005)
zwg3 Dec 13, 2025
043c31a
fix(detect): Detect `_TZE204_xibaabmu` and `_TZE284_xibaabmu` as Zemi…
bernardesarthur Dec 13, 2025
156e45a
fix: Light Solutions 91-943: support color and color temp (#11008)
simon-bd Dec 13, 2025
bd2f0b2
fix(detect): Detect `B3876M9` as Arteco ZP-301Z (#11001)
MasterFeige Dec 13, 2025
46e9fff
feat: Sinope TH1123ZB(-G2)/TH1124ZB(-G2): expose ecoMode (#10990)
lemoinem Dec 13, 2025
2fd9bce
fix: SONOFF SNZB-02: relax reporting intervals (#10911)
auanasgheps Dec 13, 2025
84ddb4d
chore: fix biome
Koenkk Dec 13, 2025
2aceb99
chore(master): release 25.87.0 (#11010)
Koenkk Dec 13, 2025
4651efd
fix: Eurotronic SPZB0001: fix setting of setpoint (#10996)
johannes-mueller Dec 13, 2025
ee4701b
fix: Moes BHT-002: change max temperature limit to 80 https://github.…
Koenkk Dec 13, 2025
5a3871c
fix: Tuya TS011F_wall_outlet: expose child lock https://github.com/Ko…
Koenkk Dec 13, 2025
a3d85fb
fix(detect): Detect `_TZE284_clm4gdw4` as Tuya TS0601_cover_10 https:…
Koenkk Dec 13, 2025
a1012bd
fix: Nous E9: fix integration https://github.com/Koenkk/zigbee2mqtt/i…
Koenkk Dec 13, 2025
5b94b81
feat(add): S4DM-0A101WWL (#11012)
antegallya Dec 13, 2025
9d4b7c2
updates
Koenkk Dec 13, 2025
5c8c58e
Merge remote-tracking branch 'origin/master' into pr/Kigrou/10636
Koenkk Dec 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 71 additions & 30 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1304,45 +1304,86 @@ export const definitions: DefinitionWithExtend[] = [
description: "Ultrasonic water meter valve",
extend: [tuya.modernExtend.tuyaBase({dp: true})],
exposes: [
// Main valve switch
e
.switch()
.setAccess("state", ea.STATE_SET),

// Water consumption sensor
e
.numeric("water_consumed", ea.STATE)
.withUnit("m³")
.withDescription("Total water consumption")
.withValueMin(0)
.withValueStep(0.001),

e.switch().setAccess("state", ea.STATE_SET),
e.numeric("water_consumed", ea.STATE).withUnit("L").withDescription("Total water consumption").withValueMin(0).withValueStep(0.001),
e.numeric("month_consumption", ea.STATE).withUnit("L").withDescription("month consumption").withValueMin(0).withValueStep(0.001),
e.numeric("daily_consumption", ea.STATE).withUnit("L").withDescription("daily consumption").withValueMin(0).withValueStep(0.001),
// // I can't seem to get this to work - when i try to change the value i get an error in zigbee2mqtt, stuck on 1 Hour
// e
// .enum("report_period", ea.STATE_SET, ["1h", "2h", "3h", "4h", "6h", "8h", "12h", "24h"])
// .withDescription("Report period"),
// Flow rate sensor
e
.numeric("flow_rate", ea.STATE)
.withUnit("m³/h")
.withDescription("Instantaneous water flow rate")
.withValueMin(0)
.withValueStep(0.001),

// Temperature sensor
.withUnit("L/h")
.withDescription("Instantaneous water flow rate"),
e.binary("auto_clean", ea.STATE_SET, "ON", "OFF").withDescription("Auto clean"),
e.temperature(),

// Voltage monitoring
e.voltage(),
// Auto clean mode toggle
e
.binary("auto_clean", ea.STATE_SET, true, false)
.withDescription("Auto clean mode"),
e.battery_voltage(),
],
meta: {
tuyaDatapoints: [
[1, "water_consumed", tuya.valueConverter.divideBy1000],
[1, "water_consumed", tuya.valueConverter.raw],
[
2,
"month_consumption",
{
from: (v) => {
const buf = Buffer.isBuffer(v) ? v : Buffer.from(v || []);
if (buf.length >= 8) {
const value = (buf.readUInt8(4) << 24) + (buf.readUInt8(5) << 16) + (buf.readUInt8(6) << 8) + buf.readUInt8(7);
return value;
}
return 0;
},
},
],
[
3,
"daily_consumption",
{
from: (v) => {
const buf = Buffer.isBuffer(v) ? v : Buffer.from(v || []);
if (buf.length >= 8) {
const value = (buf.readUInt8(4) << 24) + (buf.readUInt8(5) << 16) + (buf.readUInt8(6) << 8) + buf.readUInt8(7);
return value;
}
return 0;
},
},
],
[
4,
"report_period",
tuya.valueConverterBasic.lookup({
"1h": tuya.enum(0),
"2h": tuya.enum(1),
"3h": tuya.enum(2),
"4h": tuya.enum(3),
"6h": tuya.enum(4),
"8h": tuya.enum(5),
"12h": tuya.enum(6),
"24h": tuya.enum(7),
}),
],
[13, "state", tuya.valueConverter.onOffNotStrict],
[14, "auto_clean", tuya.valueConverter.raw],
[21, "flow_rate", tuya.valueConverter.divideBy1000],
[14, "auto_clean", tuya.valueConverter.onOff],
[
21,
"flow_rate",
{
from: (v) => {
const buf = Buffer.isBuffer(v) ? v : Buffer.from(v || []);
if (buf.length >= 4) {
const value = buf.readUInt32BE(0);
return value;
}
return 0;
},
},
],
[22, "temperature", tuya.valueConverter.divideBy100],
[26, "voltage", tuya.valueConverter.divideBy100],
[26, "battery_voltage", tuya.valueConverter.divideBy100],
],
},
// Optional: Add device-specific options
Expand Down