Skip to content

TS011F socket with Power metering #8836

Open
@MakorKa

Description

I get one Tuya SOcket with power metering, that has missing data about Power.

After few tries, i was able to write new converter.

const m = require('zigbee-herdsman-converters/lib/modernExtend');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/modernExtend');
const NS = 'zhc:tuya';
const {tuyaMagicPacket} = tuya.modernExtend;


const definition = {
    fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_qlmnxmac'}],
    model: 'TS011F_2_gang_power',
    vendor: 'Tuya',
    description: '2 gang socket with power monitoring',
    extend: [
        tuyaMagicPacket(),
        m.deviceEndpoints({endpoints: {left: 1, right: 2}, multiEndpointSkip: ['current', 'voltage', 'power', 'energy']}),
        m.onOff({powerOnBehavior: false, endpointNames: ['left', 'right']}),
        m.identify(),
        m.electricityMeter(),
    ],
};

module.exports = definition;

Now it expose

{
    "backlight_mode": "high",
    "child_lock": "UNLOCK",
    "linkquality": 204,
    "power_on_behavior": "previous",
    "state_l1": "ON",
    "state_l2": "ON",
    "update": {
        "installed_version": -1,
        "latest_version": -1,
        "state": null
    },
    "current": 0,
    "energy": 43,
    "power": 0,
    "voltage": 228,
    "identify": null,
    "state_left": "ON",
    "state_right": "ON"
}

But i still have few issues and didnt know how to fix them.
First is energy: 43 should be too high, maybe 0.43 is correct. How to add divider?
Second - OTA now lost

And third:

[2025-02-19 17:10:17] debug: 	zh:controller:endpoint: Error: ZCL command 0xa4c138aef804068e/1 haElectricalMeasurement.read(["acPowerDivisor","acPowerMultiplier"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.checkStatus (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:349:28)
    at Endpoint.zclCommand (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:954:26)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at runNextTicks (node:internal/process/task_queues:69:3)
    at processImmediate (node:internal/timers:459:9)
    at Endpoint.read (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29)
    at result.configure (/app/node_modules/.pnpm/zigbee-herdsman-converters@21.31.0/node_modules/src/lib/modernExtend.ts:1944:37)
    at Object.configure (/app/node_modules/.pnpm/zigbee-herdsman-converters@21.31.0/node_modules/src/index.ts:272:21)
    at Configure.configure (/app/lib/extension/configure.ts:124:13)
    at Immediate.<anonymous> (/app/lib/extension/configure.ts:69:17)
[2025-02-19 17:10:17] error: 	z2m: Failed to configure '0xa4c138aef804068e', attempt 1 (Error: ZCL command 0xa4c138aef804068e/1 haElectricalMeasurement.read(["acPowerDivisor","acPowerMultiplier"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.checkStatus (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:349:28)
    at Endpoint.zclCommand (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:954:26)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at runNextTicks (node:internal/process/task_queues:69:3)
    at processImmediate (node:internal/timers:459:9)
    at Endpoint.read (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29)
    at result.configure (/app/node_modules/.pnpm/zigbee-herdsman-converters@21.31.0/node_modules/src/lib/modernExtend.ts:1944:37)
    at Object.configure (/app/node_modules/.pnpm/zigbee-herdsman-converters@21.31.0/node_modules/src/index.ts:272:21)
    at Configure.configure (/app/lib/extension/configure.ts:124:13)
    at Immediate.<anonymous> (/app/lib/extension/configure.ts:69:17))

How to fix this and make device fully functional?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions