Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New device support]: ACMELEC AE-T7-K-WIFI - Tuya TS0601 - Air conditioning thermostat #26463

Open
margitin opened this issue Feb 22, 2025 · 0 comments
Labels
new device support New device support request

Comments

@margitin
Copy link

Link

https://www.aliexpress.com/item/1005008075784391.html

Database entry

{"id":4,"type":"Router","ieeeAddr":"0xa4c138d6b371bcec","nwkAddr":43689,"manufId":4417,"manufName":"_TZE204_iy5ksbrw","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65506":56,"65508":0,"65534":0,"modelId":"TS0601","manufacturerName":"_TZE204_iy5ksbrw","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":0,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1},{"cluster":61184,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1},{"cluster":5,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1},{"cluster":4,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1},{"cluster":10,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1},{"cluster":25,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1}],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[{"cluster":33,"type":"endpoint","deviceIeeeAddress":"0x588e81fffed21188","endpointID":1}],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":217189513}

Zigbee2MQTT version

1.22.1

Comments

I've managed to discover and configure almost all datapoints, without using Tuya gateway. Some of them require very different value format and took a lot of time to get them work. I got stuck in configuring GreenPower mode switch. It doesn't work all the times. Also there is no way to get to fan_only mode of the climate, but it is present in the device. No datapoint is outputted, when fan_only mode is selected.
I suggest that there is a timer function available, temperature calibration also, but at this point, I didn't manage to make them work.

External definition

const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const fz_thermostat = {
    cluster: 'manuSpecificTuya',
    type: ['commandDataResponse', 'commandSetDataResponse', 'commandGetData'],
    convert: (model, msg, publish, options, meta) => {
        const dpValues = msg.data.dpValues;
        if (!dpValues || dpValues.length === 0) return;

        const result = {};

        dpValues.forEach(dpValue => {
            const dp = dpValue.dp;
            const value = dpValue.data[0];

            // Logging all DP's
            //meta.logger.info(`Received DP #${dp} with value ${value}`);

            switch (dp) {
                case 1: // Power state
                    result.state = value === 0 ? 'OFF' : 'ON';
                    break;
                case 24: // Room temperature
                    result.local_temperature = dpValue.data.reduce((acc, val) => (acc << 8) + val, 0);
                    meta.logger.info(`Room temperature updated: ${result.local_temperature}°C`);
                    break;
                case 16: // Target temperature
                    result.occupied_heating_setpoint = dpValue.data.reduce((acc, val) => (acc << 8) + val, 0);
                    meta.logger.info(`Target temperature updated: ${result.occupied_heating_setpoint}°C`);
                    break;
                case 28: // Fan speed
                    result.fan_mode = ['low', 'medium', 'high', 'auto'][value] || 'auto';
                    break;
                case 2: // System mode
                    result.system_mode = ['cool', 'heat', 'fan_only'][value] || 'heat';
                    meta.logger.info(`System mode updated: ${result.system_mode}`);
                    break;
                case 58: // Green power state
                    result.green_power = value === 1;
                    meta.logger.info(`Green power updated: ${result.green_power ? 'ON' : 'OFF'}`);
                    break;
            }
        });
        return result;
    },
};

const tz_state = {
    key: ['state'],
    convertSet: async (entity, key, value, meta) => {
        const isOn = value.toUpperCase() === 'ON';
        await tuya.sendDataPointBool(entity, 1, isOn);
    },
};

const tz_target_temp = {
    key: ['occupied_heating_setpoint'],
    convertSet: async (entity, key, value, meta) => {
        await tuya.sendDataPointValue(entity, 16, value);
    },
};

const tz_system_mode = {
    key: ['system_mode'],
    convertSet: async (entity, key, value, meta) => {
        const lookup = { cool: 0, heat: 1, fan_only: 2 };
        await tuya.sendDataPointEnum(entity, 2, lookup[value]);
    },
};

const tz_fan_mode = {
    key: ['fan_mode'],
    convertSet: async (entity, key, value, meta) => {
        const lookup = { low: 0, medium: 1, high: 2, auto: 3 };
        await tuya.sendDataPointEnum(entity, 28, lookup[value]);
    },
};

const definition = {
    fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE204_iy5ksbrw' }],
    model: 'AE-T7-K-WIFI',
    vendor: 'ACMELEC',
    description: 'Tuya AC thermostat',
    fromZigbee: [fz_thermostat, tuya.fz.datapoints],
    toZigbee: [tz_state, tz_target_temp, tz_system_mode, tz_fan_mode, tuya.tz.datapoints],
    onEvent: tuya.onEventSetLocalTime,
    configure: tuya.configureMagicPacket,
    exposes: [
        e.binary('state', ea.STATE_SET, 'ON', 'OFF'),
        e.child_lock(),
        e.enum('green_power', ea.STATE_SET, ['ON', 'OFF']),
        e.climate()
            .withSetpoint('occupied_heating_setpoint', 16, 31, 1, ea.STATE_SET)
            .withLocalTemperature(ea.STATE)
            .withSystemMode(['cool', 'heat', 'off'], ea.STATE_SET)
            .withFanMode(['low', 'medium', 'high', 'auto'], ea.STATE_SET)
    ],
    meta: {
        tuyaDatapoints: [
            // [1, 'state', tuya.valueConverter.onOff], - Not working well.
            // [2, 'system_mode', tuya.valueConverterBasic.lookup({cool: tuya.enum(0), heat: tuya.enum(1), off: tuya.enum(2)})], - Not working well.
            // [24, 'local_temperature', tuya.valueConverter.raw], - Not working well.
            // [16, 'occupied_heating_setpoint', tuya.valueConverter.raw], - Not working well.
            [40, 'child_lock', tuya.valueConverter.lockUnlock],
            // [28, 'fan_mode', tuya.valueConverterBasic.lookup({low: tuya.enum(0), medium: tuya.enum(1), high: tuya.enum(2), auto: tuya.enum(3)})], - Not working at all.
            [58, 'green_power', tuya.valueConverterBasic.lookup({off: tuya.enum(0), on: tuya.enum(1)})],
        ],
    },
}

module.exports = definition;

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

Fully functional: Power state (ON, OFF), Room temperature, Target temp, Fan speed,
Almost done: System mode (Cool, Heat, Fan only - this one is not working), Green power
Not done: Timer functionality, Temperature calibration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request
Projects
None yet
Development

No branches or pull requests

1 participant