Hi everyone, and apologies if this is a beginner question. I’m trying to set up the TS0601 watering device I purchased from AliExpress. I know there are many posts like this, and I truly appreciate any guidance.
The Issue:
When I try to connect the device, I get the following message:
2m: Device '0x4c97a1fffef0bffd' with Zigbee model 'TS0601' and manufacturer name '_TZE284_fhvpaltk' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new_devices/01_support_new_devices.html
What I’ve Tried:
Based on the information above, I did some research and found that zigbee-herdsman-converters might help. I discovered a PR recently raised to add this device. So, I tried creating a custom converter to get this working.
Here’s what I came up with (I’m a beginner, so please excuse any mistakes!):
const { exposes, ea } = require('zigbee-herdsman-converters');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const valve_config = {
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_eaet5qt5", "_TZE284_fhvpaltk"]),
model: "TS0601_water_switch",
vendor: "Tuya",
description: "Dual water valve",
fromZigbee: [
tuya.fz.datapoints, // Handles general Tuya datapoints
fz.battery, // Battery level support
],
toZigbee: [
tuya.tz.datapoints, // Handles sending Tuya datapoints
],
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
exposes: [
// Valve 1 Status
exposes.enum("valve_status_l1", ea.STATE, ["manual", "auto", "idle"]).withDescription("Valve 1 status").withEndpoint("l1"),
// Valve 2 Status
exposes.enum("valve_status_l2", ea.STATE, ["manual", "auto", "idle"]).withDescription("Valve 2 status").withEndpoint("l2"),
// Valve 1 Control (on/off)
exposes.switch().withEndpoint("l1").withDescription("Valve 1 on/off").withLabel("Valve 1"),
// Valve 2 Control (on/off)
exposes.switch().withEndpoint("l2").withDescription("Valve 2 on/off").withLabel("Valve 2"),
// Valve 1 Countdown Timer
exposes.numeric("countdown_l1", ea.STATE_SET).withUnit("min").withDescription("Valve 1 countdown in minutes").withValueMin(0).withValueMax(1440).withEndpoint("l1"),
// Valve 2 Countdown Timer
exposes.numeric("countdown_l2", ea.STATE_SET).withUnit("min").withDescription("Valve 2 countdown in minutes").withValueMin(0).withValueMax(1440).withEndpoint("l2"),
// Valve 1 Duration (last irrigation)
exposes.numeric("valve_duration_l1", ea.STATE).withUnit("s").withDescription("Valve 1 irrigation last duration in seconds").withEndpoint("l1"),
// Valve 2 Duration (last irrigation)
exposes.numeric("valve_duration_l2", ea.STATE).withUnit("s").withDescription("Valve 2 irrigation last duration in seconds").withEndpoint("l2"),
// Battery
exposes.battery(),
// Battery Voltage
exposes.battery_voltage(),
],
meta: {
tuyaSendCommand: "sendData",
tuyaDatapoints: [
[1, "state_l1", tuya.valueConverter.onOff], // Valve 1 on/off
[2, "state_l2", tuya.valueConverter.onOff], // Valve 2 on/off
[13, "countdown_l1", tuya.valueConverter.raw], // Valve 1 countdown
[14, "countdown_l2", tuya.valueConverter.raw], // Valve 2 countdown
[25, "valve_duration_l1", tuya.valueConverter.raw], // Valve 1 duration
[26, "valve_duration_l2", tuya.valueConverter.raw], // Valve 2 duration
[104, "valve_status_l1", tuya.valueConverterBasic.lookup({manual: 0, auto: 1, idle: 2})], // Valve 1 status
[105, "valve_status_l2", tuya.valueConverterBasic.lookup({manual: 0, auto: 1, idle: 2})], // Valve 2 status
],
multiEndpoint: true, // Enable multi-endpoint support
},
endpoint: (device) => {
return {
l1: 1, // Valve 1 uses endpoint 1
l2: 1, // Valve 2 also uses endpoint 1
};
},
};
module.exports = valve_config;
Next, I added this to the top of my configuration.yaml
:
version: 4
homeassistant:
enabled: true
external_converters:
- '/config/zigbee2mqtt/valve_converter.js'
However, when I try to use the device, it still shows as unsupported, and the Exposes list only shows Linkquality.
My Questions:
- What mistake have I made in the converter?
- Is there anything else I need to do to integrate this device properly?
Thanks in advance for your help!