Closed tetele closed 2 years ago
Hey sorry mate, i have updated my original post and answered these questions.
Cheers mate. Interesting. I'm just guessing now, so either the AU plugs hardware is not 100% equal to the EU version or they might use significantly different firmware.
Does anyone know if you can manually change the quirk?
The following issue seems to be linked/same as this one: https://github.com/home-assistant/core/issues/65292
I had the same problem with a freshly installed Home Assistant (running as a container on a RPi 4 with ZHA and a RaspBee II) and the SP-EUC01 Aqara smart plug.
For the maeu01 models: I am fairly certain I know what is wrong. is anyone willing to try to modify the quirk locally? if so, remove this line:
https://github.com/zigpy/zha-device-handlers/blob/b0bbbfb6b1f267b7d87d833b1ba5a5b0b127a9a1/zhaquirks/xiaomi/aqara/plug_mmeu01.py#L93 , then save the file and restart HA. After HA is back up, reconfigure the device via the reconfigure button on the device card.
z2m binds the clusters on these: https://github.com/Koenkk/zigbee-herdsman-converters/blob/66bfcdc9405abebe70906b279e96f12de73f26a7/devices/xiaomi.js#L1048
After applying this patch, most identified sensors are still showing "Not available" – however smartenergy_metering_summation_delivered
now actually shows a value whereas before it was dead too.
What I find strange is the alleged device temperature value of 0,2°C which doesn't make any sense.
@dmulcahey ..summarizing an unwanted breaking change in 2022.m.r has pushed aqara plug into the "red water", adding lumi.plug.maeu01 in the quirks models list has not been enough to rescue the plug.
Hi, I purchased 3 of these EU plugs today hoping to monitor a few of my appliances.
I've got the following HA setup:
Version | core-2022.3.6
-- | --
Installation Type | Home Assistant Container
Development | false
Supervisor | false
Docker | true
User | root
Virtual Environment | false
Python Version | 3.9.9
Operating System Family | Linux
Operating System Version | 5.16.15-arch1-1
CPU Architecture | x86_64
Timezone | Europe/Oslo
Using SONOFF ZigBee 3.0
After going through all the comments I was able to get the plugs to report summed metering, but that's it. Following these steps.
Before commenting out SKIP_CONFIGURATION
:
After commenting out SKIP_CONFIGURATION
:
@husjon Hi, but here we are still missing a fundamental sensor: active power, and I'm quite sure a multiplier factor x100 on device temperature.
@Stefano0042, yep. I was mainly adding my comment as a summary of what was mentioned previously. I'm still hoping for a solution as I mainly bought these plugs for appliance monitoring in addition to the switching.
I haven't been able to do much troubleshooting lately, but if someone could point me in the right direction I'll try to assist as needed.
I have the same problem with newly added plugs. First one i bought and connect in January works well. Others were bought & connected in february and these are not working. All sensors are unavailable.
First plug connected in January (dont remember version of HA) is still working well
Lately installed are unavailable - only on/off is available
Hello, today I got my Aqara socket, and its currently also not working...
Can someone with the MAEU01 plug please test the quirk in https://github.com/zigpy/zha-device-handlers/pull/1479
DO NOT USE THE CUSTOM DEPS ADDON
1 - Remove the existing device via the remove button on the device card in HA 2 - configure the quirk as a local quirk 3 - restart HA 4 - pair the plug to HA again
I did that, but it didn't seem to make a difference for me.
The device after I re-paired it.
The changes I made:
FYI, currently running supervised version 2022.4.1 on my pi
Can someone with the MAEU01 plug please test the quirk in #1479
DO NOT USE THE CUSTOM DEPS ADDON
1 - Remove the existing device via the remove button on the device card in HA 2 - configure the quirk as a local quirk 3 - restart HA 4 - pair the plug to HA again
Device is added. On_Off works. Power meter does not work.
On a clean 2022.4 docker instance I did the following steps:
It is now missing sensor.electrical_measurement
. (this was there with no quirk assigned)
Also the device temperature is still off by a factor of 10. (same as no quirk)
To add to my previous comment. Here is the same plug with no quirk assigned. (this includes the same steps as above, but with the quick assignment removed)
Looks like this cluster value gives the current power consumtion in W. I don'd understand how to modify the quirk to pass this value correctly to HA.
ElectricalMeasurementCluster (Endpoint id: 1, Id: 0x0b04, Type: in) active_power (id: 0x050b) Value: 936
Same problem here. I have two (seemingly) identical plugs - one of which doesn't get quirk applied.. The quirk patch from @dmulcahey does not appear to make any difference here.. Following log output (with patch applied) which I suppose could reveal the/an issue (?);
2022-04-13 17:41:34 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='lumi.plug.maeu01' manuf='LUMI' nwk=0xEBCA ieee=54:ef:44:10:00:2c:7b:6d is_initialized=True>
2022-04-13 17:41:34 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.plug.maeu01 (54:ef:44:10:00:2c:7b:6d)
2022-04-13 17:41:34 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xiaomi.aqara.plug_mmeu01.Plug'>
2022-04-13 17:41:34 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1, 242} {1, 242, 21, 31}
Signature:
{
"node_descriptor":"NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *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)",
"endpoints":{
"1":{
"profile_id":260,
"device_type":"0x0051",
"in_clusters":[
"0x0000",
"0x0002",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0xfcc0"
],
"out_clusters":[
"0x000a",
"0x0019"
]
},
"21":{
"profile_id":260,
"device_type":"0x0051",
"in_clusters":[
"0x000c"
],
"out_clusters":[
]
},
"31":{
"profile_id":260,
"device_type":"0x0051",
"in_clusters":[
"0x000c"
],
"out_clusters":[
]
},
"242":{
"profile_id":41440,
"device_type":"0x0061",
"in_clusters":[
],
"out_clusters":[
"0x0021"
]
}
}
}
Hello @dmulcahey
When do you plan to merge your nice fix :D ? https://github.com/zigpy/zha-device-handlers/pull/1479 I just bought 4 lumi.plug.maeu01 and i would like to be able to have the metrics on consumption
Thank you again for your work
Hi @dmulcahey
I've set up the environment locally and been looking at your PR and the only way to get it to work is to add .cluster_id
to the missing input_clusters.
This makes it so that both electrical_measurement
and smartenergy_metering_summation_delivered
correctly shows their values.
The plug state and measurements are also updated in realtime when the button is pressed on the physical unit.
The device_temperature
is still off by a factory of 100, but is not that big of a deal currently.
Currently this is what I've got going.
What clusters did you change?
Here are the differences between your PR: https://github.com/husjon/zha-device-handlers/commit/ddae1020e581822a58bae1621fa4494bbd690543
OK that will break the other plug… give me a few to push a change to the PR and then can you test it again if you have a few?
Here are the differences between your PR: husjon@ddae102
So the more I think about this.. can you try something for me? Just remove the quirk class PlugMAEU01
completely. Remove the plug from HA / ZHA, wait about 30s then restart HA and re-pair it please. If it works we can nix the quirk until someone wants to look into DeviceTemperature
I pushed this change to the branch
Sure
This is how the plug is configured without the quirk class.
Same as with the cluster_id
assignment.
So aside from device temperature it is all working?
Yeah, except for the device temperature everything seem to work as expected.
The plug on_off
and electrical_measurement
is updated in realtime when the physical button on the is pressed.
Also as for smartenergy_metering_summation_delivered
it seem to be correct.
I need to run my current load for a while to get a more valid summary.
OK if this tracks true we can just remove it for now. Thanks for testing.
Summation is working as expected.
Happy to help.
Anyone else on this thread want to give this a shot?
Anyone else on this thread want to give this a shot?
I did. It took about 5-6 tries to re-pair the plug correctly (with all endpoints, clusters, resulting entities etc.). However, once paired, it reports a 0 power draw, although that's not true.
Btw, I'm not sure if it's really important, but I haven't used a custom quirk. I modified the quirk directly in the Docker container on HAOS. Is that common practice?
Btw, I'm not sure if it's really important, but I haven't used a custom quirk. I modified the quirk directly in the Docker container on HAOS. Is that common practice?
We do not support doing this. But it does work. Can you remove it again please and provide the debug logs from pairing it again?
We do not support doing this. But it does work.
What's the recommended way, then? Simply create a copy of the quirk in /config/custom_zha_quirks?
Can you remove it again please and provide the debug logs from pairing it again?
Sure! Here you go!
We do not support doing this. But it does work.
What's the recommended way, then? Simply create a copy of the quirk in /config/custom_zha_quirks?
Can you remove it again please and provide the debug logs from pairing it again?
Sure! Here you go!
Oof that thing tried to configure several times and there are various failures. Let things settle down then go to the device card in HA and click the reconfigure button and run through that dialog please.
Is this enough? It didn't do anything differently after reconfiguration.
Well that says it all worked… but you are saying the plug still isn’t working correctly in HA?
I am saying that when I turn on a ~1kW load in the plug, it reports a power drain of 0.0W, as per HA. I've also tried reading directly from the cluster (ElectricalMeasurement 0x0b04 > active_power 0x050b) and the value reported is also 0.
Same behavior with 2 identical plugs with different loads.
I see the same reconfiguration parameters that @tetele is seeing, but on my end all 3 of my plugs are all working as expected. :thinking:
Below you'll find the logs from my pairing attempts (isolated to one of the plugs) and also how the environment was set up (start_ha.sh) at the bottom of the gist. https://gist.github.com/husjon/16b4eaeeaf3a3019f861cdc07e6215ae
Hope this helps.
On core-2022.4.3 HA Core installation:
Patch local quirk Remove device Restart HA Add device
Quirk is skipped all the time...., so nothing different, clear.
I'm having the same issue as @tetele: my 2 plugs are recognized, but without any value for electrical_measurement
or summation_delivered
.
Tried on core-2022.4.6. Patch local quirk Remove device Restart HA Add device
I can confirm the same results as @husjon . I'm currently charging my phone and the values seem to be ok (except temperature). I'm using a custom quirk with the file downloaded from the fix-xiaomi-maeu01 branch
@husjon ...your app_version (0x0001) is?
@Stefano0042, my test instance was using docker:
homeassistant/home-assistant 2022.4.6 c75bec8a4f57 27 hours ago 1.25GB
homeassistant/home-assistant stable c75bec8a4f57 27 hours ago 1.25GB
If that was what you ment. :)
I think he meant the firmware version, which you get by going to the device page > Manage clusters > Cluster: Basic (0x0000) > Attribute: app_version (0x0001) > Get Zigbee attribute
exactly Tudor, thank you, after the last available upgrade is 32 as all my maeu01 are today.
..maybe I'm wrong but dut (device under test) firmware alignment should be part of the preconditions. coordinator type and ver..., ...
I have to different firmware revisions on my plugs. The old one with firmware 22 was added before xmas and report power and consumption. The new ones with firmware 32 does not report power and consumption. On-Off works on both.
I have not tried to reconfigure or add the old one after installing the latest custom quirk.
..this is in line with my "32" case, no power and consumption, the only recognizable quirk was the old one with maeu01 in the model list, at the root of proliferations of "unknown" entities. Two firmware, two different behaviors.
Thanks @tetele, all 3 of my plugs shows app_version: 32
Describe the bug I use this plug with HA 2022.2.3, where it's been updated to use the quirk for lumi.plug.mmeu01 after this pull.
There are errors popping up in the log after this update.
To Reproduce Steps to reproduce the behavior: unknown
Additional context