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

Aqara T1 switches dont report power anymore #11480

Closed
sygys opened this issue Feb 18, 2022 · 27 comments
Closed

Aqara T1 switches dont report power anymore #11480

sygys opened this issue Feb 18, 2022 · 27 comments
Labels
problem Something isn't working stale Stale issues

Comments

@sygys
Copy link

sygys commented Feb 18, 2022

What happened?

After updating to version 1.23.0-1 all 3 of my aqara T1 switches (Xiaomi DLKZMK11LM) stopped reporting power usage and energy (kwh and watts) temperature and controlling the switch keep working.

i tried re-pairing the devices but that give me this error:

error 2022-02-18 18:52:09: Failed to configure '0x54ef44100009be5b', attempt 1 (Error: Bind 0x54ef44100009be5b/1 genOnOff from '0x00124b00237e0705/1' failed (AREQ - ZDO - bindRsp after 10000ms)
at Timeout._onTimeout (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:64:35)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7))

What did you expect to happen?

I expected them to work properly and give me power and energy after the update

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.23.0-1

Adapter firmware version

20210120

Adapter

cc2652p2

Debug log

error 2022-02-18 18:52:09: Failed to configure '0x54ef44100009be5b', attempt 1 (Error: Bind 0x54ef44100009be5b/1 genOnOff from '0x00124b00237e0705/1' failed (AREQ - ZDO - bindRsp after 10000ms)
at Timeout._onTimeout (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:64:35)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7))

@sygys sygys added the problem Something isn't working label Feb 18, 2022
@Koenkk
Copy link
Owner

Koenkk commented Feb 18, 2022

Try updating your coordinator firmware and repair the device (the devices are now expected to be in "xiaomi" mode which require this firmware)

@sygys
Copy link
Author

sygys commented Feb 18, 2022

Thanks for the reply. is there any chance i can get the old converter from somewhere to write a external converter without updating the coordinator? im not happy with doing that at this point. i have 114 devices connected and down want to screw things up.

@sygys
Copy link
Author

sygys commented Feb 18, 2022

I reverted back to the old z2mqtt version and it is working again. I dont understand why updates always have to break stuff that works perfectly...

@Koenkk
Copy link
Owner

Koenkk commented Feb 19, 2022

@z-x-f could you add back the standard power converters for Aqara devices? (Koenkk/zigbee-herdsman-converters#3292) However I'm not sure if that introduces flipping in precisions

@z-x-f
Copy link
Contributor

z-x-f commented Feb 19, 2022

I think it is better to use an external converter, if you are not going to update the firmware of the coordinator.

@Koenkk
Copy link
Owner

Koenkk commented Feb 20, 2022

@sygys following external converter should do it:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0acn2'],
    model: 'DLKZMK11LM',
    vendor: 'Xiaomi',
    description: 'Aqara single switch module T1 (with neutral)',
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.aqara_opple],
    toZigbee: [tz.on_off, tz.xiaomi_power, tz.xiaomi_switch_type, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_led_disabled_night, fz.metering, fz.electrical_measurement],
    exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy(), e.temperature().withAccess(ea.STATE),
        e.voltage().withAccess(ea.STATE), e.power_outage_memory(), e.led_disabled_night(), e.switch_type()],
    configure: async (device, coordinatorEndpoint, logger) => {
        await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
    },
    ota: ota.zigbeeOTA,
};

module.exports = definition;

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale Stale issues label Mar 23, 2022
@ernst77
Copy link

ernst77 commented May 12, 2022

For me the energy consumption works only for few days and then stops, any change is not updated. On/off switch still works
0A3B2CDC-2E60-4F42-B0EC-C03E57B5C199

@soebbing
Copy link

I have the same issue of power not being reported at all. I tried the external converter above, but ota.zigbeeOTA was missing a require. I tried the following:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const zigbeeOTA = require('zigbee-herdsman-converters/lib/ota/zigbeeOTA');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0acn2'],
    model: 'DLKZMK11LM',
    vendor: 'Xiaomi',
    description: 'Aqara single switch module T1 (with neutral)',
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.aqara_opple],
    toZigbee: [tz.on_off, tz.xiaomi_power, tz.xiaomi_switch_type, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_led_disabled_night, fz.metering, fz.e
    exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy(), e.temperature().withAccess(ea.STATE),
        e.voltage().withAccess(ea.STATE), e.power_outage_memory(), e.led_disabled_night(), e.switch_type()],
    configure: async (device, coordinatorEndpoint, logger) => {
        await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
    },
    ota: zigbeeOTA,
};

module.exports = definition;

In the end, nothing changed, though. Still no power is being reported. If there is anything I can help with to make this work, I'm more than happy try stuff out or deliver logs or something!

@sygys
Copy link
Author

sygys commented Jun 22, 2022

It all started when the z2mqtt update messed up the setup for me. The problem is that the coordinator firmware needs te be updated to the latest version for the t1 switch to work properly again. I really don't understand why every update seems to break more then it fixes. I decided to just stop updating z2mqtt. The only reason for this is that updates made by koenk seems to keep breaking already working devices forcing to upgrade coordinators and God knows what that can only mess more things up. If everything works just stop updating z2mqtt. There is absolutely no reason to update a perfect working setup. Especially not z2mqtt in which updates tend to have absolutely no value to existing systems and only mess things up

@soebbing
Copy link

soebbing commented Jun 22, 2022

Thanks for your reply! Please excuse my ignorance: what is the coordinator in this context? The Zigbee USB stick I am using? Edit: So, after Googling around, the coordinator seems to be the firmware on my Zigbee USB stick (please correct me, if I'm wrong!). Since my Slaesh CC2652RB stick is from December, I'll check out how to upgrade the firmware.

Which version of zigbee2mqtt are you using? I don't know how to downgrade it on Hassos, but I'm eager to check it out!

@sygys
Copy link
Author

sygys commented Jun 22, 2022

Not sure if downgrading will help I posted this issue a while back after which someone replied that the coordinator firmware needed to be upgraded. I'm using a zigbee to Ethernet coordinator from tube's website it uses a CC2652P2 zigbee chip. This thing can be upgraded to the latest firmware. But reading your post I start to wonder if upgrading will fix it. Because if you use an USB stick I don't think that this is the problem. I use an external converter that does work by the way.

@soebbing
Copy link

soebbing commented Jun 22, 2022

I just upgraded the Zigbee2Mqtt coordinator firmware on my stick to this version: https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin
The update seemed to have went smooth, but I still don't see any values, with and without the custom converter.

Edit:

I use an external converter that does work by the way.

Is it any different from the ones above, could you share it?

@sygys
Copy link
Author

sygys commented Jun 22, 2022

try this:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Xiaomi',
    description: 'Aqara single switch module T1 (with neutral)',
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.aqara_opple],
    toZigbee: [tz.on_off, tz.xiaomi_power, tz.xiaomi_switch_type, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_led_disabled_night, fz.metering, fz.electrical_measurement],
    exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy(), e.temperature().withAccess(ea.STATE),
        e.voltage().withAccess(ea.STATE), e.power_outage_memory(), e.led_disabled_night(), e.switch_type()],
    configure: async (device, coordinatorEndpoint, logger) => {
        await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
    },
    ota: ota.zigbeeOTA,
};

module.exports = definition;

@sygys
Copy link
Author

sygys commented Jun 22, 2022

This works with my T1's

You will have to look which exact model you have and change these. on the places where it says 'n0agl1'

also check if the model is the same.

I had some trouble with these too. i ended up cutting power to these switches to make it work.

Also check if you have the same model.

If you get this working i advise to stop updating z2mqtt. there is like i said no reason to update a well working system. unless you add devices that dont work out of the box. But maybe its even better to download the external converter for those devices. this way the system you have will keep working. These updates are most of the time terrible.

@soebbing
Copy link

After the firmware update alone didn't fix it, I just tried to re-add the device into the network. After the device got interviewed correctly, it doesn't seem to be working at all. The values/states that worked (On/off, temperature, e.g.) are recognized, but not working. It looks like the connection get's dropped after the interview.

I tried the same with your converter, with similar results.

I'll try to downgrade the coordinator later and repeat the process. :(

@soebbing
Copy link

I downgraded the coordinator to https://github.com/Koenkk/Z-Stack-firmware/blob/467eee408c37c3c4bee956877e2f7aabf9b007e4/coordinator/Z-Stack_3.x.0/bin/CC2652RB_coordinator_20220103.zip (the previous version) and removed your external converter. This seems to have fixed the issue: I can control the switch and can read values for power, energy and temperature!

I have no insight in how these firmwares are built - is there a place to check for changes between 20220103 and 20220219?

@FaGerstenlauer
Copy link

Why ist it closed?

The Problem is still there. And the custom converter doesn't work either. :-(

@jmcollin78
Copy link

Hello, with the same problem I try to install the converter. At Z2M restart I have this error:

Zigbee2MQTT
[19:11:13] INFO: Preparing to start...
[19:11:14] INFO: Socat not enabled
[19:11:17] INFO: Starting Zigbee2MQTT...

/app/node_modules/zigbee-herdsman-converters/index.js:172
        if (converter.options) {
                      ^
TypeError: Cannot read properties of undefined (reading 'options')
    at Object.addDefinition [as addDeviceDefinition] (/app/node_modules/zigbee-herdsman-converters/index.js:172:23)
    at new ExternalConverters (/app/lib/extension/externalConverters.ts:15:17)
    at new Controller (/app/lib/controller.ts:84:58)
    at start (/app/index.js:106:18)

And Z2M doesn't start anymore.
Because the UI is no more available I cannot remove the aqara-t1.js from external converters and It seems not configured in config files.
So i'm totally stuck.

The converter I get is the one listed above:

const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const tz = require("zigbee-herdsman-converters/converters/toZigbee");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const ota = require("zigbee-herdsman-converters/lib/ota");
const extend = require("zigbee-herdsman-converters/lib/extend");
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ["lumi.switch.n0agl1"],
    model: "SSM-U01",
    vendor: "Xiaomi",
    description: "Aqara single switch module T1 (with neutral)",
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.aqara_opple],
    toZigbee: [
        tz.on_off,
        tz.xiaomi_power,
        tz.xiaomi_switch_type,
        tz.xiaomi_switch_power_outage_memory,
        tz.xiaomi_led_disabled_night,
        fz.metering,
        fz.electrical_measurement,
    ],
    exposes: [
        e.switch(),
        e.power().withAccess(ea.STATE_GET),
        e.energy(),
        e.temperature().withAccess(ea.STATE),
        e.voltage().withAccess(ea.STATE),
        e.power_outage_memory(),
        e.led_disabled_night(),
        e.switch_type(),
    ],
    configure: async (device, coordinatorEndpoint, logger) => {
        await device
            .getEndpoint(1)
            .write(
                "aqaraOpple",
                { mode: 1 },
                { manufacturerCode: 0x115f, disableResponse: true }
            );
    },
    ota: ota.zigbeeOTA,
};

module.exports = definition;

@petravic
Copy link

petravic commented Jun 13, 2024

This converter works with latest release and fixed the power not reporting problem for me.

const {} = require('zigbee-herdsman-converters/lib/modernExtend');

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const lumi = require('zigbee-herdsman-converters/lib/lumi');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Aqara',
    description: 'Single switch module T1 (with neutral)',
    extend: [],
    fromZigbee: [fz.on_off, fz.metering, fz.electrical_measurement, fz.device_temperature, lumi.fromZigbee.lumi_specific],
    exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(), e.switch_type(), e.voltage(), e.current()],
    toZigbee: [lumi.toZigbee.lumi_switch_type, tz.on_off, lumi.toZigbee.lumi_switch_power_outage_memory, lumi.toZigbee.lumi_led_disabled_night],
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering', 'genDeviceTempCfg']);
        await reporting.onOff(endpoint);
        await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
        await reporting.readMeteringMultiplierDivisor(endpoint);
        await reporting.currentSummDelivered(endpoint);
        await reporting.activePower(endpoint, {min: 5, max: 600, change: 10});
        await reporting.deviceTemperature(endpoint);
        device.powerSource = 'Mains (single phase)';
        device.type = 'Router';
        device.save();
    }
};

@Kiezelke
Copy link

Kiezelke commented Jun 18, 2024

How and where do I need to put this code? I have 2 Aquara T1 switches with nog power usage.

const {} = require('zigbee-herdsman-converters/lib/modernExtend');

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const lumi = require('zigbee-herdsman-converters/lib/lumi');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Aqara',
    description: 'Single switch module T1 (with neutral)',
    extend: [],
    fromZigbee: [fz.on_off, fz.metering, fz.electrical_measurement, fz.device_temperature, lumi.fromZigbee.lumi_specific],
    exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(), e.switch_type(), e.voltage(), e.current()],
    toZigbee: [lumi.toZigbee.lumi_switch_type, tz.on_off, lumi.toZigbee.lumi_switch_power_outage_memory, lumi.toZigbee.lumi_led_disabled_night],
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering', 'genDeviceTempCfg']);
        await reporting.onOff(endpoint);
        await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
        await reporting.readMeteringMultiplierDivisor(endpoint);
        await reporting.currentSummDelivered(endpoint);
        await reporting.activePower(endpoint, {min: 5, max: 600, change: 10});
        await reporting.deviceTemperature(endpoint);
        device.powerSource = 'Mains (single phase)';
        device.type = 'Router';
        device.save();
    }
};`

@jmcollin78
Copy link

This converter works with latest release and fixed the power not reporting problem for me.

const {} = require('zigbee-herdsman-converters/lib/modernExtend');

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const lumi = require('zigbee-herdsman-converters/lib/lumi');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Aqara',
    description: 'Single switch module T1 (with neutral)',
    extend: [],
    fromZigbee: [fz.on_off, fz.metering, fz.electrical_measurement, fz.device_temperature, lumi.fromZigbee.lumi_specific],
    exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(), e.switch_type(), e.voltage(), e.current()],
    toZigbee: [lumi.toZigbee.lumi_switch_type, tz.on_off, lumi.toZigbee.lumi_switch_power_outage_memory, lumi.toZigbee.lumi_led_disabled_night],
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering', 'genDeviceTempCfg']);
        await reporting.onOff(endpoint);
        await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
        await reporting.readMeteringMultiplierDivisor(endpoint);
        await reporting.currentSummDelivered(endpoint);
        await reporting.activePower(endpoint, {min: 5, max: 600, change: 10});
        await reporting.deviceTemperature(endpoint);
        device.powerSource = 'Mains (single phase)';
        device.type = 'Router';
        device.save();
    }
};

last line is missing. See post above.

@jmcollin78
Copy link

jmcollin78 commented Jun 18, 2024

The converter I get is the one listed above with the fixed line :

const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const tz = require("zigbee-herdsman-converters/converters/toZigbee");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const ota = require("zigbee-herdsman-converters/lib/ota");
const extend = require("zigbee-herdsman-converters/lib/extend");
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ["lumi.switch.n0agl1"],
    model: "SSM-U01",
    vendor: "Xiaomi",
    description: "Aqara single switch module T1 (with neutral)",
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.aqara_opple],
    toZigbee: [
        tz.on_off,
        tz.xiaomi_power,
        tz.xiaomi_switch_type,
        tz.xiaomi_switch_power_outage_memory,
        tz.xiaomi_led_disabled_night,
        fz.metering,
        fz.electrical_measurement,
    ],
    exposes: [
        e.switch(),
        e.power().withAccess(ea.STATE_GET),
        e.energy(),
        e.temperature().withAccess(ea.STATE),
        e.voltage().withAccess(ea.STATE),
        e.power_outage_memory(),
        e.led_disabled_night(),
        e.switch_type(),
    ],
    configure: async (device, coordinatorEndpoint, logger) => {
        await device
            .getEndpoint(1)
            .write(
                "aqaraOpple",
                { mode: 1 },
                { manufacturerCode: 0x115f, disableResponse: true }
            );
    },
    ota: ota.zigbeeOTA,
};

module.exports = definition;

Finally I got it working !

I press the both button on Zigbee2mqtt which seems to do a kind of soft pairing of the device:
Capture d’écran 2024-06-18 à 18 57 42

The power instantaneously comes back !

@jmcollin78
Copy link

How and where do I need to put this code? I have 2 Aquara T1 switches with nog power usage.

const {} = require('zigbee-herdsman-converters/lib/modernExtend');

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const lumi = require('zigbee-herdsman-converters/lib/lumi');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['lumi.switch.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Aqara',
    description: 'Single switch module T1 (with neutral)',
    extend: [],
    fromZigbee: [fz.on_off, fz.metering, fz.electrical_measurement, fz.device_temperature, lumi.fromZigbee.lumi_specific],
    exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(), e.switch_type(), e.voltage(), e.current()],
    toZigbee: [lumi.toZigbee.lumi_switch_type, tz.on_off, lumi.toZigbee.lumi_switch_power_outage_memory, lumi.toZigbee.lumi_led_disabled_night],
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering', 'genDeviceTempCfg']);
        await reporting.onOff(endpoint);
        await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
        await reporting.readMeteringMultiplierDivisor(endpoint);
        await reporting.currentSummDelivered(endpoint);
        await reporting.activePower(endpoint, {min: 5, max: 600, change: 10});
        await reporting.deviceTemperature(endpoint);
        device.powerSource = 'Mains (single phase)';
        device.type = 'Router';
        device.save();
    }
};

module.exports = definition; <---- this line is missing !!

You have to put this file (with the last line missing) into the /config/zigbee2mqtt directory and add this lines into the configuration.yaml file (in the same directory):

...
external_converters:
  - aqara-t1.js

Then restart ZigbeeToMqtt addon (Parameters/addon/Zigbee2Mqtt restart) and then click on the button in py post just above. It should work. May be you will have to wait a few.

@Kiezelke
Copy link

thanks, works now. Reconfiguration did the trick.

@soebbing
Copy link

Confirmed too: Latest Firmware with this custom converter worked for me as well!

Thanks a lot @petravic @Kiezelke @jmcollin78 !

@hexer4u
Copy link

hexer4u commented Jul 13, 2024

Resolved: for anyone reading this due to the error below, use the converter from here #11480 (comment) making sure to add the modules.export as stated.

Hi
I tried the converter mentioned above, and initially ran into an issue because it was using
const extend = require('zigbee-herdsman-converters/lib/extend');
which was not supported anymore. I removed it.
Then I got
Failed to load external converter file 'aqara-t1.js' (Cannot read properties of undefined (reading 'options'))
and now i'm stuck.

Any ideas?
Thanks

Edit:
There seem to be 2 converters in this thread.
I used the second one, making sure to have the module.exports = definition; in place, and now it works.

Thank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests

10 participants