Last active
July 31, 2025 16:18
-
-
Save ccfiel/532d0000c2ec584a5e4ff3728c2ebe3c to your computer and use it in GitHub Desktop.
Revisions
-
ccfiel revised this gist
Jul 31, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default { [13, "state", tuya.valueConverter.onOffNotStrict], [14, "auto_clean", tuya.valueConverter.raw], [21, "flow_rate", tuya.valueConverter.divideBy1000], [22, "temperature", tuya.valueConverter.divideBy100], [26, "voltage", tuya.valueConverter.divideBy100], ], }, -
ccfiel renamed this gist
Jul 29, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ccfiel created this gist
Jul 29, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ import * as exposes from "zigbee-herdsman-converters/lib/exposes"; import * as tuya from "zigbee-herdsman-converters/lib/tuya"; const e = exposes.presets; const ea = exposes.access; /** @type {import('zigbee-herdsman-converters').Definition} */ export default { fingerprint: [ { modelID: "TS0601", manufacturerName: "_TZE284_vuwtqx0t", }, ], model: "TS0601_water_valve", vendor: "Tuya", description: "Ultrasonic water meter valve", fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, 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), // Flow rate sensor e.numeric("flow_rate", ea.STATE).withUnit("m³/h").withDescription("Instantaneous water flow rate").withValueMin(0).withValueStep(0.001), // Temperature sensor e.temperature(), // Voltage monitoring e.voltage(), // Auto clean mode toggle e.binary("auto_clean", ea.STATE_SET, true, false).withDescription("Auto clean mode"), ], meta: { tuyaDatapoints: [ [1, "water_consumed", tuya.valueConverter.divideBy1000], [13, "state", tuya.valueConverter.onOffNotStrict], [14, "auto_clean", tuya.valueConverter.raw], [21, "flow_rate", tuya.valueConverter.divideBy1000], [22, "temperature", tuya.valueConverter.divideBy10], [26, "voltage", tuya.valueConverter.divideBy100], ], }, // Optional: Add device-specific options options: [ exposes.options.precision("water_consumed"), exposes.options.calibration("water_consumed"), exposes.options.precision("flow_rate"), exposes.options.calibration("flow_rate"), exposes.options.precision("temperature"), exposes.options.calibration("temperature"), ], };