zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[External Converter]: TS0601 from _TZE204_1oft6qso

Open zettich opened this issue 1 year ago • 2 comments

Link

https://sklep.automat-on.pl/Sterownik-ogrzewania-podlogowego-zigbee-Tuya-8-kanalowy-CH8Z.html

Database entry

{"id":38,"type":"Router","ieeeAddr":"0x287681fffeeec6de","nwkAddr":8132,"manufId":4098,"manufName":"_TZE204_1oft6qso","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,61184],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"�a�0f�a�0\u0012�a�0\u0012","65506":31,"65508":0,"65534":0,"modelId":"TS0601","manufacturerName":"_TZE204_1oft6qso","powerSource":1,"zclVersion":3,"appVersion":70,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0031de9997","endpointID":1}],"configuredReportings":[],"meta":{}}},"appVersion":70,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":-768188465},"lastSeen":1764542831270}

Zigbee2MQTT version

2.6.3 (unknown)

External converter

const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const e = exposes.presets;

const valueConverter = tuya.valueConverterBasic.lookup(() => ({
    ON: true,
    OFF: false,
}));

// Tuya datapoints for AutomatOn CH8Z (TS0601 / _TZE204_1oft6qso)
//
//  1  - Switch 1
//       Boolean on/off for relay channel 1 (code: "switch_1").
//
//  2  - Switch 2
//       Boolean on/off for relay channel 2 (code: "switch_2").
//
//  3  - Switch 3
//       Boolean on/off for relay channel 3 (code: "switch_3").
//
//  4  - Switch 4
//       Boolean on/off for relay channel 4 (code: "switch_4").
//
//  5  - Switch 5
//       Boolean on/off for relay channel 5 (code: "switch_5").
//
//  6  - Switch 6
//       Boolean on/off for relay channel 6 (code: "switch_6").
//
//  7  - Switch 7
//       Boolean on/off for relay channel 7 (exposed by Tuya as "switch_usb1").
//
//  8  - Switch 8
//       Boolean on/off for relay channel 8 (exposed by Tuya as "switch_usb2").
//
//  9  - Countdown 1
//       Auto-off timer for channel 1 in seconds (code: "countdown_1").
//       Range 0–43200, step 1.
//
// 10  - Countdown 2
//       Auto-off timer for channel 2 in seconds (code: "countdown_2").
//       Range 0–43200, step 1.
//
// 11  - Countdown 3
//       Auto-off timer for channel 3 in seconds (code: "countdown_3").
//       Range 0–43200, step 1.
//
// 12  - Countdown 4
//       Auto-off timer for channel 4 in seconds (code: "countdown_4").
//       Range 0–43200, step 1.
//
// 13  - Countdown 5
//       Auto-off timer for channel 5 in seconds (code: "countdown_5").
//       Range 0–43200, step 1.
//
// 14  - Countdown 6
//       Auto-off timer for channel 6 in seconds (code: "countdown_6").
//       Range 0–43200, step 1.
//
// 15  - Countdown 7
//       Auto-off timer for channel 7 / USB1 in seconds (code: "countdown_usb1").
//       Range 0–43200, step 1.
//
// 16  - Countdown 8
//       Auto-off timer for channel 8 / USB2 in seconds (code: "countdown_usb2").
//       Range 0–43200, step 1.
//
// 17  - Increase electricity
//       Incremental energy counter (exact unit/scale defined by Tuya firmware).
//
// 18  - Current current
//       Measured load current (exact unit/scale defined by Tuya firmware).
//
// 19  - Current power
//       Measured active power for the device (exact unit/scale defined by firmware).
//
// 20  - Current voltage
//       Measured line voltage (exact unit/scale defined by firmware).
//
// 21  - Test bit
//       Internal test/diagnostic flag (factory use, not normally exposed).
//
// 22  - Voltage coefficient
//       Calibration coefficient for voltage measurement.
//
// 23  - Electric coefficient
//       Calibration coefficient for energy / consumption measurement.
//
// 24  - Power coefficient
//       Calibration coefficient for power measurement.
//
// 25  - Electricity coefficient
//       Additional calibration coefficient for energy (vendor-specific use).
//
// 26  - Fault
//       Fault status bitmask (individual bits are vendor-specific).
//
// 27  - Relay status
//       Power-on state policy (code: "relay_status"):
//         "power_off" – all channels OFF after power restore,
//         "power_on"  – all channels ON after power restore,
//         "last"      – restore last relay states.
//
// 28  - Indicate light
//       Front LED behaviour (code: "light_mode"):
//         "none"   – LED always off,
//         "relay"  – LED follows relay state,
//         "pos"    – LED shows position / status pattern.
//
// 29  - Child lock
//       Locks/unlocks local keys (code: "child_lock"), Zigbee control remains active.
//
// 101 - Cycle Time
//       Cyclic schedule / cycle time configuration (code: "cycle_time"),
//       format and semantics are vendor-specific.
//
// 102 - Random Schedule
//       Randomised on/off schedule configuration (e.g. anti-theft / lighting mode),
//       format and semantics are vendor-specific.

const definition = {
    fingerprint: [
        {
            modelID: "TS0601",
            manufacturerName: "_TZE204_1oft6qso",
        },
    ],
    model: "CH8Z",
    vendor: "AutomatOn",
    description: "Underfloor heating / irrigation valves controller - AutomatOn CH8Z",
    exposes: [
        e.switch().withEndpoint("l1"),
        e.switch().withEndpoint("l2"),
        e.switch().withEndpoint("l3"),
        e.switch().withEndpoint("l4"),
        e.switch().withEndpoint("l5"),
        e.switch().withEndpoint("l6"),
        e.switch().withEndpoint("l7"),
        e.switch().withEndpoint("l8"),
    ],
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    configure: async (device, coordinatorEndpoint) => {
        await tuya.configureMagicPacket(device, coordinatorEndpoint);
        await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ["genOnOff"]);
    },
    endpoint: (x) => {
        return {
            l1: 1,
            l2: 1,
            l3: 1,
            l4: 1,
            l5: 1,
            l6: 1,
            l7: 1,
            l8: 1,
        };
    },
    meta: {
        multiEndpoint: true,
        tuyaDatapoints: [
            [1, "state_l1", valueConverter],
            [2, "state_l2", valueConverter],
            [3, "state_l3", valueConverter],
            [4, "state_l4", valueConverter],
            [5, "state_l5", valueConverter],
            [6, "state_l6", valueConverter],
            [7, "state_l7", valueConverter],
            [8, "state_l8", valueConverter],
        ],
    },
};

module.exports = definition;

What does/doesn't work with the external definition?

work:

  • set switch state works correctly

does not work:

  • getting real state of the switch
  • countdowns
  • built-in sensors
  • indicator light mode
  • power on behaviour

Notes

software_build_id: undefined date_code: `` endpoints:

{"1":{"clusters":{"input":["genBasic","genGroups","genScenes","manuSpecificTuya"],"output":["genOta","genTime"]},"name":"l1"}}

zettich avatar Nov 30 '25 23:11 zettich

🙏 Thank you for creating this issue and sharing your external converter!

In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.

If NOT all features work, please follow the How To Support new devices. Since this is a Tuya also consider How To Support new Tuya devices.

If you need help with the process, feel free to ask here and we'll be happy to assist.

github-actions[bot] avatar Nov 30 '25 23:11 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jan 30 '26 00:01 github-actions[bot]