Aqara T1 with neutral is not showing power KWH in home assistant

I just started with home assistant from Homey, and the aqara switches i used in homey works fine but i cant see the power usage. its missing

I have 5 of these relays in total and its the same with all

I use sonoff dongle and MQTT

Everything else works fine, but would like for this to work as well

Any ideas?

Skjermbilde 2022-02-12 204947
this is the one

Hi, I have the same problem. Did you find a solution to get the energy and power updated?

Same problem here. Originally bought two of these to measure the power usage on two circuits, I have three in total. They were working fine for some time (weeks or months, donā€™t remember at the time) until they all stopped reporting values some time in February or march I think.
All three stopped reporting values less than a day apart.
I have since switched houses. I have a new HA instance and do not have the data easily available. But I have a backup, so I can report back soon.
I have now connected one of the switches to my new instance (with a different conbee2-stick) and itā€™s still not reporting values. Tried updating OTA with zigbee2mqtt, no cigar.

I booted up my old instance and checked the energy and power readings in grafana and collected some information.
I have three devices;

- device 1:
  first reported value: 2021-10-20 17:19
  last reported value: 2022-02-03 06:04:00
- device 2:
  first reported value: 2022-01-14 17:45
  last reported value: 2022-02-03 06:10:54
- device 3:
  first reported value: 2022-01-14 18:14
  last reported value: 2022-02-03 06:15:08

The ā€˜last reported valueā€™ is the last sample where the value (energy or power) changed. After that there are still samples in influx-db, but the line is flat.
After adding one of the devices in my new HA instance it just says None on both energy and power entities.
In zigbee2mqtt it says Null.
So all three devices stop working at nearly the same time regardless of when they were added and I wonder if anyone else had their device stop working at that date.

I didnā€™t notice them not working until some time later, so I could not know if something happened at that time, e.g. zigbee2mqtt update. But I donā€™t think I would have done any maintenance that early in the morning.

@iHege @lenkar

Found this post about it on the zigbee2mqtt github.
It seems to have happened when zigbee2mqtt was updated.
There are two options:

  • upgrade firmware of the coordinator (seems to be the difficult route)
  • use an external converter for the Aqara T1 relay module

Pleased to say that I could get it working with an external converter. Will use that for now and save upgrading the coordinator for rainy day.
Here is a working external converter.

Adding external converter: More configuration options | Zigbee2MQTT
The data directory of zigbee2mqtt is normally in /config/zigbee2mqtt (same as z2mā€™s configuration.yaml). Good luck, hope it works out for you!

2 Likes

@dissar What solution are you currently using? For some reason I canā€™t get the external converter to work. I also tried to upgrade the firmware of my coordinator but ran into issues there as well, so I had to downgrade/revert.

What is the data directory exactly? Is that the directory in which configuration.yaml lives or is it a directory inside that directory?

I fixed it by updating the coordinator firmware and re-pairing the devices. The external converter route didnā€™t work for me.

Hi, Iā€™ve a similar situation: Iā€™ve integrated a couple of T1 w/ Neutral (paired with Aqara M2 hub) in Home Assistant by using HomeKit Controller. Power consumption data are visible in the Aqara Home app but are not shown in HA. Did you manage to solve it some way that could be useful to me too?

I ran into the same problem some weeks ago and the external converter works fine for me.
I coppied the script into a new file /config/zigbee2mqtt/aqara-t1.js and added just ā€œaqara-t1.jsā€ under settings ā†’ external convertor within the webui of Zigbee2MQTT. Hope it helps anybody to get this easy solution running.

Worked like charme, thanks!

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;

Can you please post the right converter ?

Hello @dissar

The converter you gave donā€™t work in my environment. Can you please send here the right converter ? I have exactly the same trouble.


Here are some news:

Itā€™s now running Z2M v1.33.0 again and it is working.

ā†’ rollback to 1.33.0 which is available in the Parameters / System / backup for me.

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();
    }
};

Setup:


Not working here. I have also an aqara T1 releay. Pasted the code but still not displaying consumption.