Powerplug TS011F meter functionality missing

Hi.
I bought a zigbee powerplug TS011F manufacturer TZ3000_ew3ldmgx on AliExpres.
Power on/off works. But i get no power readings form the device.
Is it possible to change the cluster config? Or how do I fix it?

My setup:
RPI3
Home Assistant Core
core-2021.5.4

Sonoff zigbee bridge with tasmota firmware 9.4.0.4(zbbridge)
ncp-uart-sw_6.7.8_115200.ota

Ha UI

Entities
switch.tz3000_ew3ldmgx_ts011f_507b8ffe_on_off
sensor.tz3000_ew3ldmgx_ts011f_507b8ffe_electrical_measurement
sensor.tz3000_ew3ldmgx_ts011f_507b8ffe_smartenergy_metering

Error message
error

Zigbee device signature

{
  "node_descriptor": "NodeDescriptor(byte1=1, byte2=64, mac_capability_flags=142, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False, *is_valid=True, *logical_type=<LogicalType.Router: 1>, *user_descriptor_available=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x010a",
      "in_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0702",
        "0x0b04",
        "0xe000",
        "0xe001"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZ3000_ew3ldmgx",
  "model": "TS011F",
  "class": "zigpy.device.Device"
}

1 Like

I have the exact same problem. It works fine with Zigbee2MQTT, but that is nto what I wanted to use in this particular installation, so having it work with ZHA would be most helpful.
Has anyone else have any insights as to where the limitation may reside?

1 Like

Hi,

Just got mine today.
Looks like the problem with the electrical_measurement is fixed.
I can see the power usage.

But no data from Metering.
sensor.tz3000_ew3ldmgx_ts011f_bb1466fe_smartenergy_metering

Hi,

Support for plug is merged into DEV from ZHA.

Hi!
I just bought a bunch of the _TZ3000_dpo1ysak variant.

Up until yesterday i used deconz, but in hope of being able to monitor the power usage - i switched to zha, which in itself was quite a task :upside_down_face:

Any way - i managed to pair the device
but it seems very inkonsistent with the usage statistics:

Either it calculates wrong - or something else is off, as i have not used that amount of khw the last day :slight_smile:

br Ronni

Today 2 of these smart plugs came in the mail. Slapped one behind my dishwasher and the other one behind my UFH pump. I can confirm that the kWh readings are way off. Running the dishwasher for just 30 minutes has send it from 0 to 50 kWh. Just a wild guess but it seems that the kWh value is multiplied by 100 as 0,5 kWh might be a bit more realistic.

Edit: Seems I was right and it looks like the devs are already working on it: https://github.com/zigpy/zha-device-handlers/issues/1045

I dont g’et any readings at all.
I use Sonoff sigbee bridge with tasmota firmware for my power plugs.
I flashed the bridge to newest firmware and upgraded HA to latest firmware. And still… no cigar :relaxed:

I have the same power plug, and with ZHA I get al lot less readings then with zigbee2mqtt.

Hello
I also have these power plug bought on Ali, no power meter measurement. Zigbee2mqtt find all these entry, but any value are « null ».

1 Like

Support for TS011F has been improved lately in Zigpy (lib used by ZHA) but we need to wait for a new release

Power measurement works on ZHA, I’ve tried. But not on zigbee2mqtt.
Do you know when it will be plublished on the next released of zigbee2mqtt, because this my zigbee integration (not ZHA).

It seems already supported:

Unfortunately, it doesn’t work for me on zigbee2mqtt. My others plugs as aqara work.

Look under the tab “Expose”. It can take a while before all attributes have values

FYI, remaining issues now lie in to get correct multiplier/divider factors into zha quirk all devices, see:

https://github.com/zigpy/zha-device-handlers/issues?q=

https://github.com/zigpy/zha-device-handlers/pulls?q=

Some information here in ZHA docs why ZHA device handlers are needed to fix some devices quirks:

https://www.home-assistant.io/integrations/zha/#zha-exception-and-deviation-handling

Oke, just checked again and it seems like I lied… Sorry. Ths plug I thougt was a ’ TS011F_plug’ was actually a ‘TS0121_plug’. I checked my other plug, and turns out zigbee2mqtt doesn’t have the values

{
    "current": null,
    "energy": null,
    "linkquality": 23,
    "power": null,
    "power_outage_memory": "on",
    "state": "ON",
    "voltage": null
}

Okay, I’ve been testing with the TS011F plug (_TZ3000_dpo1ysak) to get it to work. I tried to add it as a Tuya device via an external converter based on the documentation and the code already in zigbee-herdsman-converters. This is what I came up with:

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 e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [
        {modelID: 'TS011F', manufacturerName: '_TZ3000_dpo1ysak'},
        {modelID: 'TS011F', manufacturerName: '_TZ3000_cphmq0q7', applicationVersion: 69}
    ],
    model: 'TS011F_plug_4',
    description: 'Smart plug (with custom power monitoring by polling)',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
    toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {
            acCurrentDivisor: 1000,
            acCurrentMultiplier: 1
        });
        endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
        device.save();
    },
    exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
        e.energy(), exposes.enum('power_outage_memory', ea.STATE_SET, ['on', 'off', 'restore'])
            .withDescription('Recover state after power outage')],
    onEvent: (type, data, device, options) => {
        const endpoint = device.getEndpoint(1);
        if (type === 'stop') {
            clearInterval(globalStore.getValue(device, 'interval'));
            globalStore.clearValue(device, 'interval');
        } else if (!globalStore.hasValue(device, 'interval')) {
            const seconds = 60;
            const interval = setInterval(async () => {
                try {
                    await endpoint.read('haElectricalMeasurement', ['rmsVoltage', 'rmsCurrent', 'activePower']);
                    await endpoint.read('seMetering', ['currentSummDelivered']);
                } catch (error) {
                    /* Do nothing*/
                }
            }, seconds * 1000);
            globalStore.putValue(device, 'interval', interval);
        }
    },
};

module.exports = definition;

After some debugging and trying, I could not get any other attribute then ‘state’ and ’ linkquality’. Even when I add the same device again, it still doesn’t get anything except those two.

MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Smart plug (with custom power monitoring by polling)","friendly_name":"0x540f57fffe19e97b","model":"TS011F_plug_4","supported":true,"vendor":"TuYa"},"type":"pairing"}'
Configuring '0x540f57fffe19e97b'
Successfully configured '0x540f57fffe19e97b'
MQTT publish: topic 'zigbee2mqtt/0x540f57fffe19e97b', payload '{"current":null,"energy":null,"linkquality":57,"power":null,"power_outage_memory":null,"state":"OFF","voltage":null}'

When will the release be available? I’d be happy to beta test, as I also have a TS011F and voltage shows 0.2V instead 230V.

I don’t know. Soon I hope because I have the same issue