Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.5k stars 1.63k forks source link

LDSENK02S DonT display Voltage or Current #20841

Open Martin82sf opened 5 months ago

Martin82sf commented 5 months ago

What happened?

Hi.

The model LDSENK02S

Cant measure either voltage or Current.

Publish 'get' 'voltage' to 'Enchufe TV' failed: 'Error: Read 0x5cc7c1fffe07e5fc/1 haElectricalMeasurement(["rmsVoltage"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'

Publish 'get' 'current' to 'Enchufe TV' failed: 'Error: Read 0x5cc7c1fffe07e5fc/1 haElectricalMeasurement(["rmsCurrent"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'

I have two of them and this happens in both

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.35.1-1

Adapter firmware version

20221102

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus ZBDongle-P

Setup

Add ON Home assistant ON a NUC

Debug log

No response

xabylr commented 5 months ago

Hello, I am having the same problem with this adapter, but I had it working since some previous versions of Zigbee2MQTT.

Yesterday, the device stopped responding and I tried to repair it. I shouldn't have done that, because it didn't work. Then, I restarted Zigbee2MQTT. After the restart, the device now responded to on/off commands, but when joining the same errors appears. The device is not able to obtain power, current, voltage or energy as it was able before.

I was using Zigbee2MQTT version 1.35.0 yesterday when I detected the problem. I updated to 1.35.1, but no luck.

xabylr commented 5 months ago

It looks like it broke when the converter was modified because of a refactor. If I create a custom converter using the previous code, it works again!

https://github.com/Koenkk/zigbee-herdsman-converters/commit/5f3378765bdf1de5327a4859164fcee68dd0794e#diff-3e7c29010594010cba39762df3fec6fc1fb0bf958c48679cf19cf508cd8c59a2L309-L320

@Martin82sf In the meantime you can do the same. You only have to create a file LDSENK02S.js next to configuration.yaml with the following content:

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;

module.exports = [
    {
        zigbeeModel: ['LDSENK02S'],
        model: 'LDSENK02S',
        vendor: 'ADEO',
        description: 'ENKI LEXMAN 16A EU smart plug',
        extend: extend.switch({exposes: [e.power(), e.energy()], fromZigbee: [fz.electrical_measurement, fz.metering]}),
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
            await reporting.onOff(endpoint);
            await reporting.activePower(endpoint);
            await reporting.currentSummDelivered(endpoint);
            await reporting.readMeteringMultiplierDivisor(endpoint);
        },
    }
];

Then edit the configuration.yaml file to have an entry like this:

external_converters:
  - LDSENK02S.js

Finally restart Zigbee2MQTT and you should get your metrics for the device.

Martin82sf commented 5 months ago

@xabylr Thanks but if not working .

Not don't appear in the dashboard the options

image

And continues reporting "null" in the voltage / current values

image

xabylr commented 5 months ago

Yes, you are right, for me they don't appear as well. I haven't noticed that. However, for me it was an improvement because I didn't even have power or energy before that.

Martin82sf commented 4 months ago

Still fails in lastest version [1.36.0]

chiva commented 2 weeks ago

More in-depth analysis is being done here: https://github.com/Koenkk/zigbee-herdsman-converters/issues/7147

We can close this one to avoid doubling efforts