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

Energy consumption for AQARA SSM-U01 lumi.switch.n0agl1 does not work correctly #9531

Closed
lglw opened this issue Nov 6, 2021 · 12 comments
Closed
Labels
problem Something isn't working stale Stale issues

Comments

@lglw
Copy link

lglw commented Nov 6, 2021

Hi.
Energy consumption and temperature statistics for AQARA SSM-U01 lumi.switch.n0agl1 does not work correctly.
I waited, rebooted, added, removed this relay. Other functions of this relay work correctly.

{
    "linkquality": 159,
    "power_outage_memory": true,
    "state": "ON",
    "switch_type": "momentary",
    "device_temperature": null,
    "energy": null,
    "power": null
}

Debug info

Zigbee2MQTT version:1.22.0
Adapter hardware: Sonoff CC2652P + CP2102N
Adapter firmware version: zStack3x0 20210120

Log of adding and using the device
https://pastebin.com/fY3J5bVU

@rkuralev
Copy link

rkuralev commented Nov 15, 2021

Same for me. Consumption and power are always 0 or null
Device: lumi.switch.n0agl1
Link: https://www.zigbee2mqtt.io/devices/SSM-U01.html#xiaomi-ssm-u01

State:

{
    "device_temperature": 31,
    "energy": 0,
    "linkquality": 90,
    "power": 0,
    "power_outage_memory": false,
    "state": "OFF",
    "switch_type": "toggle"
}

Zigbee2Mqtt 1.22.0-2
Adapter: ZZH CC2652R, firmware Z-Stack 3.x.0 20210708

@Koenkk
Copy link
Owner

Koenkk commented Nov 16, 2021

Could you provide the debug log when pressing the yellow reconfigure button on the device page in the frontend?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

@z-x-f
Copy link
Contributor

z-x-f commented Nov 16, 2021

Maybe you can try this configuration:

    {
        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.xiaomi_switch_type, fz.xiaomi_switch_opple_basic],
        toZigbee: [tz.on_off, tz.xiaomi_power, tz.xiaomi_switch_type, tz.xiaomi_switch_power_outage_memory,],
        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.switch_type()],
        configure: async (device, coordinatorEndpoint, logger) => {
            await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
        },
    },

@rkuralev
Copy link

rkuralev commented Nov 16, 2021

@Koenkk here you go

Zigbee2MQTT:debug 2021-11-16 13:51:13: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure' with data '{"id":"shower_ventilator_switch","transaction":"of8hs-1"}'
Zigbee2MQTT:info  2021-11-16 13:51:13: Configuring 'shower_ventilator_switch'
Zigbee2MQTT:debug 2021-11-16 13:51:14: Received Zigbee message from 'shower_ventilator_switch', type 'readResponse', cluster 'haElectricalMeasurement', data '{"acPowerDivisor":10,"acPowerMultiplier":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-11-16 13:51:14: Received Zigbee message from 'shower_ventilator_switch', type 'readResponse', cluster 'seMetering', data '{"divisor":1000,"multiplier":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-11-16 13:51:15: Successfully configured 'shower_ventilator_switch'
Zigbee2MQTT:info  2021-11-16 13:51:15: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"shower_ventilator_switch"},"status":"ok","transaction":"of8hs-1"}'

@z-x-f thank you for you reply. Would you mind to point me out how to apply this configuration? I have not found anything like JSON config in the frontend...

@z-x-f
Copy link
Contributor

z-x-f commented Nov 16, 2021

@rkuralev You can modify /zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices/xiaomi.js, save and restart z2m, and then re-pair the device.

@rkuralev
Copy link

@z-x-f I don't have this directory

image

@Koenkk
Copy link
Owner

Koenkk commented Nov 16, 2021

@z-x-f thanks for the suggestions

Please try with the following converter (and give the measurements some time to come in)

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.n0agl1'],
    model: 'SSM-U01',
    vendor: 'Xiaomi',
    description: 'Aqara single switch module T1 (with neutral)',
    fromZigbee: [fz.on_off, fz.xiaomi_power, fz.device_temperature, fz.xiaomi_switch_type, fz.xiaomi_switch_power_outage_memory, fz.xiaomi_switch_opple_basic],
    exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.switch_type(), e.voltage(), e.current()],
    toZigbee: [tz.xiaomi_switch_type, tz.on_off, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_power],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genDeviceTempCfg']);
        await reporting.onOff(endpoint);
        await reporting.deviceTemperature(endpoint);
        device.powerSource = 'Mains (single phase)';
        device.save();
    },
};

module.exports = definition;

How to use the external converter: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#instructions

@rkuralev
Copy link

@Koenkk unfortunately does not help. Still see zero-s in power and consumption. Also get errors when trying to do actions, I collected several of them:

Failed to configure 'shower_ventilator_switch', attempt 1 (Error: Bind 0x54ef44100009b57b/1 genOnOff from '0x00124b0021600424/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))

Failed to configure 'shower_ventilator_switch', attempt 2 (Error: ConfigureReporting 0x54ef44100009b57b/1 genOnOff([{"attribute":"onOff","minimumReportInterval":0,"maximumReportInterval":3600,"reportableChange":0}], {"sendWhenActive":false,"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 20831 - 1 - 8 - 6 - 7 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))

Publish 'get' 'state' to 'shower_ventilator_switch' failed: 'Error: Read 0x54ef44100009b57b/1 genOnOff(["onOff"], {"sendWhenActive":false,"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'MAC no ack' (233))'

Publish 'get' 'power_outage_memory' to 'shower_ventilator_switch' failed: 'Error: Read 0x54ef44100009b57b/1 aqaraOpple([513], {"sendWhenActive":false,"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'MAC no ack' (233))'

Publish 'get' 'power_outage_memory' to 'shower_ventilator_switch' failed: 'Error: Read 0x54ef44100009b57b/1 aqaraOpple([513], {"sendWhenActive":false,"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'MAC no ack' (233))'

Request 'zigbee2mqtt/bridge/request/device/remove' failed with error: 'Failed to remove device 'shower_ventilator_switch' (block: false, force: false) (Error: AREQ - ZDO - mgmtLeaveRsp after 10000ms)'

@Koenkk
Copy link
Owner

Koenkk commented Nov 17, 2021

@rkuralev looks like communication with the device fails, try to repair it.

@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 Dec 18, 2021
@heikkis
Copy link

heikkis commented Jan 25, 2023

@rkuralev Did you manage to get this working? I have same device and same problem, only temperature is published.

image

image

@heikkis
Copy link

heikkis commented Jan 27, 2023

After updating ZZH! zigbee stick firmware and re-join the device, it worked at least for the power and voltage.

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

5 participants