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

[Device Support Request] Xiaomi Mija ZB3.0 smart plug ZNCZ04LM (lumi.plug.mmeu01) #2583

Closed
SwoopX opened this issue Mar 13, 2020 · 103 comments
Closed

Comments

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 13, 2020

grafik

grafik

grafik

grafik

grafik

Endpoint 15:
grafik

Endpoint 16:
grafik

@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 13, 2020

The attributes from cluster FCC0:

ZigBee Cluster Library Frame, Mfr: Unknown (0x115f), Command: Discover Attributes Response, Seq: 157
    Frame Control Field: Profile-wide (0x1c)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .1.. = Manufacturer Specific: True
        .... 1... = Direction: Server to Client
        ...1 .... = Disable Default Response: True
    Manufacturer Code: Unknown (0x115f)
    Sequence Number: 157
    Command: Discover Attributes Response (0x0d)
    Attribute Status Record
        Attribute: 0x00f3
        Data Type: 8-Bit Unsigned Integer (0x20)
    Attribute Status Record
        Attribute: 0x00f5
        Data Type: 32-Bit Unsigned Integer (0x23)
    Attribute Status Record
        Attribute: 0x00f6
        Data Type: 16-Bit Unsigned Integer (0x21)
    Attribute Status Record
        Attribute: 0x00fa
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x00fc
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x00fe
        Data Type: Character String (0x42)
    Attribute Status Record
        Attribute: 0x00ff
        Data Type: Octet String (0x41)
    Attribute Status Record
        Attribute: 0x0100
        Data Type: 8-Bit Unsigned Integer (0x20)
    Attribute Status Record
        Attribute: 0x0200
        Data Type: 8-Bit Unsigned Integer (0x20)
    Attribute Status Record
        Attribute: 0x0201
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x0202
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x0203
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x0204
        Data Type: Single Precision Floating Point (0x39)
    Attribute Status Record
        Attribute: 0x0205
        Data Type: 8-Bit Unsigned Integer (0x20)
    Attribute Status Record
        Attribute: 0x0206
        Data Type: Single Precision Floating Point (0x39)
    Attribute Status Record
        Attribute: 0x0207
        Data Type: Boolean (0x10)
    Attribute Status Record
        Attribute: 0x020b
        Data Type: Single Precision Floating Point (0x39)
    Attribute Status Record
        Attribute: 0xf000
        Data Type: 8-Bit Unsigned Integer (0x20)
    Attribute Status Record
        Attribute: 0xfffd
        Data Type: 16-Bit Unsigned Integer (0x21)

0000   1c 5f 11 9d 0d 01 f3 00 20 f5 00 23 f6 00 21 fa   ._...... ..#..!.
0010   00 10 fc 00 10 fe 00 42 ff 00 41 00 01 20 00 02   .......B..A.. ..
0020   20 01 02 10 02 02 10 03 02 10 04 02 39 05 02 20    ...........9.. 
0030   06 02 39 07 02 10 0b 02 39 00 f0 20 fd ff 21      ..9.....9.. ..!

And some investigation to find out what they are for:

<attribute id="0x00f3" name="Unknown" type="u8" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00f5" name="Unknown" type="u32" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00f6" name="Reporting Interval" type="u16" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00fa" name="Unknown" type="bool" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00fc" name="Unknown" type="bool" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00fe" name="Serial Number" type="cstring" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x00ff" name="Unknown (write only)" type="ostring" mfcode="0x115f" access="w" required="m"> </attribute>
<attribute id="0x0100" name="Unknown" type="u8" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0200" name="Unknown" type="u8" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0201" name="Restore Power on Outage" type="bool" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0202" name="Auto-off after 20m below 2W" type="bool" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0203" name="Device LED off" type="bool" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0204" name="Unknown" type="float" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0205" name="Unknown" type="u8" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0206" name="Unknown" type="float" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0x0207" name="Consumer connected" type="bool" mfcode="0x115f" access="r" required="m"> </attribute>
<attribute id="0x020b" name="Max. Load exceeded at (in W)???" type="float" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0xf000" name="Unknown" type="u8" mfcode="0x115f" access="rw" required="m"> </attribute>
<attribute id="0xfffd" name="Unknown" type="u16" mfcode="0x115f" access="rw" required="m"> </attribute>

@SwoopX SwoopX changed the title [Device Support Request] Xiaomi Mija ZB3.0 smart plug lumi.plug.mmeu01 [Device Support Request] Xiaomi Mija ZB3.0 smart plug ZNCZ04LM (lumi.plug.mmeu01) Mar 13, 2020
@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 14, 2020

Decoding of manufacturer specific attribute reporting (attribute 0x00F7. cluster FCC0, Endpoint 1, first byte is always the length)

ZigBee Cluster Library Frame, Mfr: Unknown (0x115f), Command: Report Attributes, Seq: 45
    Frame Control Field: Profile-wide (0x1c)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .1.. = Manufacturer Specific: True
        .... 1... = Direction: Server to Client
        ...1 .... = Disable Default Response: True
    Manufacturer Code: Unknown (0x115f)
    Sequence Number: 45
    Command: Report Attributes (0x0a)
    Attribute Field, Octets: 64:10:00:03:28:17:98:39:00:00:00:00:95:39:1a:a4:…
        Attribute: 0x00f7
        Data Type: Octet String (0x41)
        Octet String: 64:10:00:03:28:17:98:39:00:00:00:00:95:39:1a:a4:…

0000   3d 64 10 00 03 28 17 98 39 00 00 00 00 95 39 1a
0010   a4 ec 3d 96 39 00 60 0b 45 97 39 00 00 00 00 05
0020   21 02 00 9a 20 00 08 21 16 01 07 27 00 00 00 00
0030   00 00 00 00 09 21 00 01 0b 20 00 9b 10 01
03 28 18				(Zcl8BitInt)     Device temperature
05 21 02 00				(Zcl16BitUint)   Unknown
07 27 00 00 00 00 00 00 00 00		(Zcl64BitUint)   Unknown
08 21 16 01				(Zcl16BitUint)   Unknown
09 21 00 01				(Zcl16BitUint)   Unknown
0b 20 00				(Zcl8BitUint)    Unknown
64 10 01				(ZclBoolean)     on/off
95 39 e0 7c e5 3d			(ZclSingleFloat) Consumption
96 39 00 60 0b 45			(ZclSingleFloat) Voltage
97 39 49 5f 53 41			(ZclSingleFloat) Current
98 39 44 8b 3c 40			(ZclSingleFloat) Power
9a 20 00				(Zcl8BitUint)    Unknown
9b 10 01				(ZclBoolean)     Unknown

@Smlooc
Copy link

Smlooc commented Mar 14, 2020

How to read ENERGY and POWER(endpoint 15 and 16) from API ?
Are only visible from GUI?

@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 14, 2020

As of now, you can't since the device is not supported yet. However, I'm almost done and I just need to amend some data types...

@Kristian8606
Copy link

I have lumi.plug.mmeu01 I was disappointed to find that consumption and history were not working, my question soon be included and maintained?

@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 24, 2020

I have an open pull request pending for the device. Locally, with the changes I made, it works perfectly from a deconz perspective. How middleware handles the sensor and data is a different question not to be discussed here then.

Once integrated, you will see a consumption and a power sensor, providing corresponding data. If you cannot wait, you may want to compile the version from my repo manually.

@Kristian8606
Copy link

Sorry for the stupid question but can you help me because I don't know how to install your code, some instruction would be helpful

@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 24, 2020

Have a look at the readme of the repo, the steps and requirements are mentioned there. To be abe to get the deconz dev package, check out phoscon.de to see how to add the deconz repository.

For compilation, there might be further packages required which you need to install first.

@Kristian8606
Copy link

if i wait will it be integrated into the next official update?

@SwoopX
Copy link
Collaborator Author

SwoopX commented Mar 24, 2020

That's my current assumption.

@Kristian8606
Copy link

Kristian8606 commented Apr 5, 2020

One thing I noticed quite by accident is that when I unplugged the device and plugged it back in, eve showed historical data.
A0F0D099-2769-487B-B071-93EBFAE2F4A5

@SwoopX
Copy link
Collaborator Author

SwoopX commented Apr 5, 2020

Not sure what exactly you mean. Can you elaborate a bit? Consumption is historical data, power is not.

@Kristian8606
Copy link

Sorry about my bad English. when I plug the plug into the mains and then plug in the heater in the app it records neither amps nor power consumption. After 15 minutes I unplug it and plug it back in and eve reads the story.
FE081227-6204-4DED-94C5-0AB004C19C49
A1C23D16-758A-41FF-A54C-AAF4C0A6253B

@Kristian8606
Copy link

The thought is that the unit show nothing, amper nor power consumption, but still records a story only when I turn it off and plug it in the electrical

@ebaauw
Copy link
Collaborator

ebaauw commented Apr 5, 2020

The Simple Metering cluster, 0x0702, exposes life-time consumption (Current Summation Delivered attribute, 0x0000), and current power (Instantaneous Demand attribute, 0x0400). The REST API plugin exposes these as state.consumption and state.power in a ZHAConsumption /sensors resource.

The Electrical Measurement cluster, 0x0B04, exposes current power (Active Power attribute, 0x050B). The REST API plugin exposes this as state.power in a ZHAPower /sensors resource.

The wired Xiaomi switches I've seen report power through the Analog Input cluster on the lower endpoint, and consumption through the Analog Input cluster on the higher endpoint. The lower endpoint should be exposed as ZHAPower, the higher as ZHAConsumption.

Eve needs both consumption and power to show history, so Homebridge Hue will compute any missing value from the other. For devices with a ZHAConsumption resource, Homebridge Hue creates the history based on state.consumption. For devices with only a ZHAPower resource, Homebridge Hue creates history based on state.power, approximating consumption by applying power over time.

@Kristian8606
Copy link

Thanks for the explanation. Also i would like to know where in the app i can adjust the price for kwh.

@SwoopX
Copy link
Collaborator Author

SwoopX commented Apr 5, 2020

@Kristian8606 that was not really a language problem ;) The code just got merged.

@ebaauw Very true. I've provided an updated code to handle the analog input clusters and consumption and power values are exposed now. Works like a charm locally.

@SwoopX SwoopX closed this as completed Apr 5, 2020
@ebaauw
Copy link
Collaborator

ebaauw commented Apr 5, 2020

Also i would like to know where in the app i can adjust the price for kwh.

Settings | General | Energy Cost

@Kristian8606
Copy link

@SwoopX would you view this problem about Xiaomi lumi.plug.mmeu01

ebaauw/homebridge-hue#664

@SwoopX
Copy link
Collaborator Author

SwoopX commented Apr 9, 2020

Thanks. There's indeed some more work required to expose V and A as well. I'll check it out.

@SwoopX
Copy link
Collaborator Author

SwoopX commented Apr 9, 2020

Updated it. If you want, you can compile my repo to test it.

@Kristian8606
Copy link

Great after work, I'll test it immediately.

@Kristian8606
Copy link

Thanks for the lightning reaction! Now this outlet is working as expected. I'll watch it for bugs and report if any. Once again thank you.

@thikade
Copy link

thikade commented Jul 27, 2020

@Kristian8606
Hi,
researching a phoscon issue I stumbled over your beautiful app screenshots displaying power metering stats.
I was wondering what the app name / system are you using for that is?
Thanks, Thomas

Link to your screenshot comment: #2583 (comment)

@ebaauw
Copy link
Collaborator

ebaauw commented Jul 27, 2020

That’s the Eve app for Apple’s HomeKit, see https://www.evehome.com/en/eve-app. Use Homebridge and Homebridge Hue to expose the devices connected to deCONZ to HomeKit, see https://github.com/ebaauw/homebridge-hue.

@thikade
Copy link

thikade commented Jul 27, 2020 via email

@archiespb
Copy link

Hi!

There is a bit of a problem with my ZNCZ04LM.
It works fine but after raspberry pi reboot phoscon/deconz (and home assistant) cannot control smart plug until I press button on it.

Is there any solution to this?

@leonardpitzu
Copy link

Exactly the same for me

@net1957
Copy link

net1957 commented Jan 8, 2021

same for me. I use deconz/phoscon ConBeeII with Jeedom on Raspberry 4

version 2.07.01
firmware 26680700

as they are new, I don't know if this was working in previous releases.

information for the plugs (all are on same sw version):
{
"8": {
"etag": "0cc603de166f4750f23e32d2adf62130",
"hascolor": false,
"lastannounced": "2020-12-20T11:57:27Z",
"lastseen": "2021-01-08T19:45Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Prise_4",
"state": {
"alert": "none",
"on": true,
"reachable": true
},
"swversion": "09-06-2019",
"type": "Smart plug",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-01"
}, ....

@sieren
Copy link

sieren commented Jan 8, 2021

Sadly, it's always been like that. I vaguely recall there were some discussions around it but nobody knew a good approach on how to fix this.

@bcutter
Copy link

bcutter commented Jan 19, 2021

What is the right way to pair this device using Phoscon? I only get the switch entity, no power consumption measurements at all (paired as light)...

#4238

(using latest stable firmware 26660700, Version 2.07.01 / 8.12.2020)

@bcutter
Copy link

bcutter commented Jan 21, 2021

Can someone please explain what is the right way to pair this smart plug using Phoscon?

Pairing as light it only provides the power switch, no other sensors (power, consumption, temperature etc. missing https://www.zigbee2mqtt.io/devices/ZNCZ04LM.html#xiaomi-zncz04lm / https://zigbee.blakadder.com/Xiaomi_ZNCZ04LM.html) :-(

@jsconstantelos @kt666 @ebaauw @SwoopX

@archiespb
Copy link

Try unpair and pair again. Sometimes my devices have the same bug.

@net1957
Copy link

net1957 commented Jan 21, 2021

some time it need some hours to get all informations

@bcutter
Copy link

bcutter commented Jan 21, 2021

So it doesn't matter how to pair it or is using the search for lights definitely the right way?

@archiespb
Copy link

Yes, it is light from Phoscon view point.

@net1957
Copy link

net1957 commented Jan 21, 2021

on deconz it look like:
image
and in jeedom the information is
{
"8": {
"etag": "ce3f5965ecfeda6fda07f3d0e8c5eef8",
"hascolor": false,
"lastannounced": "2021-01-16T14:36:19Z",
"lastseen": "2021-01-17T22:09Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Prise_4",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": "09-06-2019",
"type": "Smart plug",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-01"
},
"54": {
"config": {
"on": true,
"reachable": true,
"temperature": 2000
},
"ep": 21,
"etag": "d3daec152e685926d3f0d61288745ff2",
"lastseen": "2021-01-21T09:11Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Power 54",
"state": {
"current": 0,
"lastupdated": "2021-01-21T09:11:06.952",
"power": 0,
"voltage": 236
},
"swversion": "09-06-2019",
"type": "ZHAPower",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-15-000c"
},
"92": {
"config": {
"on": true,
"reachable": true,
"temperature": 2000
},
"ep": 1,
"etag": "3a182b8cd83b746c86237b21a29a1394",
"lastseen": "2021-01-21T09:11Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Consumption 92",
"state": {
"consumption": 5588,
"lastupdated": "2021-01-21T09:11:31.369",
"power": 0
},
"swversion": "09-06-2019",
"type": "ZHAConsumption",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-01-0702"
},
"93": {
"config": {
"on": true,
"reachable": true,
"temperature": 2000
},
"ep": 1,
"etag": "1aee1ac42531e4bb4b0e9e0c92bc5ff5",
"lastseen": "2021-01-21T09:11Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Power 93",
"state": {
"current": 0,
"lastupdated": "2021-01-21T09:11:32.263",
"power": 0,
"voltage": 236
},
"swversion": "09-06-2019",
"type": "ZHAPower",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-01-0b04"
},
"94": {
"config": {
"on": true,
"reachable": true,
"temperature": 2000
},
"ep": 22,
"etag": "d3daec152e685926d3f0d61288745ff2",
"lastseen": "2021-01-21T09:11Z",
"manufacturername": "LUMI",
"modelid": "lumi.plug.mmeu01",
"name": "Consumption 94",
"state": {
"consumption": 5588,
"lastupdated": "2021-01-21T09:11:06.952"
},
"swversion": "09-06-2019",
"type": "ZHAConsumption",
"uniqueid": "04:cf:8c:df:3c:86:77:ce-16-000c"
}
}

@framesetter99
Copy link

Actually had the same problem. Unwrapped from box, paired and only the light entity showed up with the rest API.
Repaired it back then, same issue.
One day later plugged in the unit again, added an active consumer (my laptop), repaired and I got the sensor.

It might be that having it on and having an actual consumer while pairing did the trick.
So just try to get it with the API, check if the additional sensors show up and repair if needed.

@bcutter
Copy link

bcutter commented Jan 21, 2021

@framesetter99 Thanks for that great advice, I will test this at the next opportunity. Sounds quite promising! ✌🏼

@bcutter
Copy link

bcutter commented Jan 23, 2021

I tested another two hours (!) and paired several times.

  • With active consumer connected
  • Tried to pair as sensor (it showed a green banner and it was added - as light)
  • Completely restarted deCONZ

This is the best I could get so far - and it´s just CRAP, still almost useless:
grafik

grafik

Update:
grafik

Updated summary:

  • Total consumption (kWh) only appears every few seconds, being "not available" most of the time
  • Power and current consumption entities (3 times?!) are bullshit - they don´t change depending on actual consumption
    --> Update: Current consumption seems to work now (it changes depending on the power usage)
  • I see no option to disable the LED according to https://www.zigbee2mqtt.io/devices/ZNCZ04LM.html#led_disabled_night-binary
  • Information not being available (not at all or not reliably (1)):
  1. Total power consumption (important)
  2. Temperature (nice)
  3. Voltage (I don´t care)
  4. Link quality (I don´t care)
  5. Not able to set LED state

+++ Can anyone who managed to successfully pair and integrate this device with deCONZ please post what it SHOULD offer when working fine? +++
@sieren @archiespb @net1957 @framesetter99

I experience some kind of strong limitations and multiple entities for current consumption as shown.

As a reference - this is what I expect (another user with a ZNCZ0**2**LM) not using deCONZ:
grafik

@bcutter
Copy link

bcutter commented Feb 7, 2021

Still no progress. Is it me or - sorry for that kind of formulation - is the deCONZ integration of lumi.plug.mmeu01 just crap? I mean I meanwhile spent 5 hours to get two of those devices to work and it´s still impossible (see #4238 (comment)).

It really is horrible. What else can I try? Any ideas (@SwoopX)?

@bcutter
Copy link

bcutter commented Feb 7, 2021

The sensor as such presented above looks perfectly fine. In it's default settings, you only get a consumption update every 10 mins. If the value doesn't change, then there's no update.

I have a 66 W consumer attached to the plug for one hour. Total consumption entity does not change (anymore):
grafik

deCONZ 0702 Simple metering cluster contains:
grafik

So... what about that 10 minutes update interval?!?

@poughkeepsee
Copy link

Actually had the same problem. Unwrapped from box, paired and only the light entity showed up with the rest API. Repaired it back then, same issue. One day later plugged in the unit again, added an active consumer (my laptop), repaired and I got the sensor.

It might be that having it on and having an actual consumer while pairing did the trick. So just try to get it with the API, check if the additional sensors show up and repair if needed.

This did the trick for me. Steps the reproduce:

  1. Reset the plug (press the on/off button for 5 seconds until the led flashes blue and red)
  2. Remove the plug from deconz
  3. Unplug from socket and plug again
  4. Press on/off for pair (light flashes blue)
  5. Press on again and have any device connected to the plug - THIS DID THE TRICK for me after trying 10 times with no device. Plug needs to be on and pulling power to any connected device, I just used my laptop charger
  6. Search (as light) in deconz
  7. Hopefully FCC0 is now showing Lumi specific and not unknown

This is anecdotal evidence, worked for me but I really hope it works for anyone else.

@Smanar
Copy link
Collaborator

Smanar commented Apr 13, 2022

Ha yes, not stupid, make the device make report with the problematic cluster using it, for deconz detect it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests