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

ZHA not recognizing the Aqara Roller Shutter E1 correctly #86752

Closed
MTrab opened this issue Jan 26, 2023 · 80 comments
Closed

ZHA not recognizing the Aqara Roller Shutter E1 correctly #86752

MTrab opened this issue Jan 26, 2023 · 80 comments

Comments

@MTrab
Copy link
Contributor

MTrab commented Jan 26, 2023

The problem

I have 4 Aqara Roller shutter devices, only 1 of these are recognized correctly by ZHA even thou they are bought at the same time.

The ones not working are not responding to open/close commands, they have a switch (?!) exposed (the working one doesn't), no battery info and device temperature reports a static 0.3C

What version of Home Assistant Core has the issue?

Home Assistant 2023.1.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA with SkyConnect

Link to integration documentation on our website

No response

Diagnostics information

Working:
zha-9b654b0da4346ac555f8c3518151a96a-LUMI lumi.curtain.acn002-51dd2113f6d91475ac8b7df9ef5af72d.json.txt

One of the non working devices:
zha-9b654b0da4346ac555f8c3518151a96a-LUMI lumi.curtain.acn002-a590cf80ea73f711aa8cbd4025fc73d1.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @dmulcahey, @Adminiuga, @puddly, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zha can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign zha Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zha documentation
zha source
(message by IssueLinks)

@TheJulianJES
Copy link
Contributor

Did you all pair them with Home Assistant Core 2023.1.2 or later (or were they paired on a previous version)?
Can you try completely re-pairing the non-working ones? (There was an issue with Xiaomi IEEE prefixes: zigpy/bellows#520)

@MTrab
Copy link
Contributor Author

MTrab commented Jan 29, 2023 via email

@SGXander
Copy link

SGXander commented Jan 30, 2023

+1 on this, Just bought and E1 and pairing seems to be faulty. When pairing, ZHA page goes from ready back to initialising then back to ready and the E1 flashes rapid blue for a full 5 minutes. In HA the control page looks like the below screenshot flicking between unavailable and ok. When the pairing mode on the E1 stops it will settle into ok but neither the cover nor identify actions have any effect and the temperature never changes. After the 6 hour timeout for battery devices it will go unavailable indefinately.
image

edit: I'm using a TubesZB as a zigbee bridge to my HA VM

@MTrab
Copy link
Contributor Author

MTrab commented Jan 30, 2023

Yeah - same as mine.
Looks like the quirks isn't assigned as supposed for this device.
Only one of mine got the correct quirk

@SGXander
Copy link

I'm no zigbee or zha expert but is there a way to define the devices ieee as a specific type in the config as a workaround?
I'm having a read of: https://www.home-assistant.io/integrations/zha/#modifying-the-device-type to see

@SGXander
Copy link

if you can extract the quirks from your working one it may be possible to import using this: https://www.home-assistant.io/integrations/zha/#configuration-variables ?

@MTrab
Copy link
Contributor Author

MTrab commented Jan 30, 2023

Not sure how to do that. Haven't, yet, figured out how that works 😁

@SGXander
Copy link

I don't have an aqara hub but if you do can you pair them to that and see if it's a result of newer/older firmware?

@MTrab
Copy link
Contributor Author

MTrab commented Jan 30, 2023

Nope, I don't - only have a Conbee II (currently not used) and my SkyConnect

@MTrab
Copy link
Contributor Author

MTrab commented Feb 5, 2023

Might just go and migrate back to Z2M, as ZHA still doesn't seem mature for production instances.

@stefbontinckx
Copy link

I have the same issue with Skyconnect and ZHA.

@SGXander
Copy link

2022.2.1 seems to be an improvement. Device doesn't go into unavailable and the identify button press works. All other features reamin the same though.

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

I see no improvements. Have moved the Rollers back to Z2M on my Deconz dongle, but trying ZHA on every update, but no improvements at all.

@SGXander
Copy link

on the one that worked for you can you extract your signature and paste here please? I'm going to have a go at a quirks file...

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

Tell me how ;)

@SGXander
Copy link

If you go to the device page then ... and manage zigbee device there should be a signature tab. pretty sure it doesn't contain any identifying info it's just config registers. hoping by comparing to my faulty one I can figure out what's wrong with it. playing in the write attribute section I can actually get mine to roll up and down so pretty sure it is ok its just the translation to home assistant that isn't working...

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, 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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0202",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0009",
        "0x000d",
        "0x0013",
        "0x0102",
        "0xfcc0"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.curtain.acn002",
  "class": "zhaquirks.xiaomi.aqara.roller_curtain_e1.RollerE1AQ"
}

@SGXander
Copy link

interesting the differences to mine:
image
couple of in clusters but crucially the class is just device.device for me. couldn't be that easy but I'm going to have a go at a custom quirk file to change the class...

@dawidcieszynski
Copy link

I had a similar problem. Bought two devices. Both shown 0.3 °C. I've played a bit with setting min and max on the devices. Then after few hours I've realized that one of the devices started to work, there were proper quirk used.
obraz obraz

I've disabled quirks (because I observed that quirks changes the signature), restarted HA, compared the signatures and the not working device had other device_id (0x0202) than working (0x0100) and one of in_clusters
So I made a custom quirk using instructions from zigpy/zha-device-handlers#1801 (comment) (this quirk is already in HA, but with different device id, that's why I had to make my own one)
I've changed
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
to
DEVICE_TYPE: 0x0202,

Now both works, reports correct data, opens and closes roller shutters. The only not working part is the slider, but it isn't a must. :)
obraz

I have Home Assistant 2023.2.3 with Sonoff ZBDongle-E (EFR32MG21)

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

Thanks @dawidcieszynski

Can confirm all is working, except temperature, with this: https://github.com/MTrab/HAConfig/blob/master/custom_zha_quirks/roller_curtain_e1.py

Made following the guide you linked

@SGXander
Copy link

can confirm this fixes the cover entity and its position marker as well as removing the useless switch. can probably remove the number entity too which should be relatively easy now I have that example quirks file (thank you!)

@SGXander
Copy link

I can't find anywhere the zha.devicetype.xxx types are enumerated. we should really use the variable name as opposed to direct code but I wonder if there is a slightly different cover id that will fix it completely?

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

Okay - temperature was just a tad slow to update - everything works with the one on my repo

@MTrab
Copy link
Contributor Author

MTrab commented Feb 11, 2023

And yes - agree, an enumerator should be used for device type

@SGXander
Copy link

Think I've found the definitions: https://github.com/zigpy/zigpy/blob/dev/zigpy/profiles/zha.py
WINDOW_COVERING_DEVICE = 0x0202
Will test changing it to "zha.DeviceType.WINDOW_COVERING_DEVICE" shortly

the question then is why doesnt the replacement function above your addition work?

@applegeeks
Copy link

ah nice...i did restart and updatre ha but to no avail.
I did however not try plugin the dongle in and out again.

I wonder if that's what did it and I didnt have to re-flash the firmware?
might have to give this a try if I find myself ordering my third Aqara roller device.

@nworbneb
Copy link

nworbneb commented May 23, 2023

Hello, I'm still having problems with this. It mostly works but not as well as people seem to have above.

Setting an opening percentage works
Displays correct opening percentage if you specify a percentage, i.e. with slider or Alexa
However, often loses up or down arrow even if percentage is not 0 or 100, i.e. greyed out in GUI
Percentage does not update if you use the arrows to fully open or close
Battery = "Unknown"
Device Temperature = "0.3 degC"

I'm running:

HA 2023.5.3
SkyConnect latest firmware 7.2.2.0
Latest Aqara firmware: 20221009111923_OTA_lumi.curtain.acn002_0.0.0_1530_20221009_6C9C3D.ota, version: 3870
Quirk: zhaquirks.xiaomi.aqara.roller_curtain_e1.RollerE1AQ_3

Diagnostics:

zha-70d9316c6d191d1748701b7433055d4b-LUMI lumi.curtain.acn002-8907207564c13de75d1a2af23fd8b76f.json (2).txt

@jankowski-piotr
Copy link

@nworbneb I think you need to set opening limits on the device itself with hardware buttons. https://manuals.plus/aqara/roller-shade-driver-e1-manual#device_rotating_range_setup

@nworbneb
Copy link

nworbneb commented May 24, 2023

@nworbneb I think you need to set opening limits on the device itself with hardware buttons. https://manuals.plus/aqara/roller-shade-driver-e1-manual#device_rotating_range_setup

The device itself is configured and works fine manually, and for the most part, ok with zigbee. The main problem is battery status, and to a lesser extent, device temperature are not reported correctly.

image

The disconnect between top and bottom of travel and percentage opening might be a higher level HA issue? I've seen this reported with other non-Aqara devices.

image

Example: Can't raise blind from 75%

@adamxp12
Copy link

adamxp12 commented Jun 11, 2023

Bought two Aqara E1 rollers recently. after having one previously for a while. One of them works perfectly but the other one is like all the others here. it uses the RollerE1AQ_2 quirk instead ofRollerE1AQ and for whatever reason that means the battery percentage is missing, the temperature sensor is 0.3 and it acts rather odd on the state if you use the up/down buttons.

Updated the Sonoff zigbee plus 3.0 USB to latest firmware and repaired but still no dice. I would rather not get an aqara hub to "update" the motor if I have to. seeing as the two units I got have the exact same manufacturer date I find it hard to believe that it is even running different firmware to the working one. Very odd

Hopefully someone can chime in with a proper fix for this
BrokenBlind.txt

WorkingBlind.txt

@JoelMSawyer
Copy link

I'm having similar issues to others here with my Aqara E1 roller shade driver. It uses the zhaquirks.xiaomi.aqara.roller_curtain_e1.RollerE1AQ_2 quirk that others have reported to be problematic. Temperature is always reported as 0.3C, the battery state is not reported, and the blind's open/close state is not correctly reported.

I've tried re-pairing the device to HA several times, with no improvement. I'll try updating my Conbee II's firmware, however I doubt that will be the issue as I don't think it's running a particularly out of date version. If anyone has any other suggestions, I'd be very interested to try them.

Screenshot 2023-07-17 at 14 39 32

@adamxp12
Copy link

Bought a brand new HASS SkyConnect as I saw lots of issues with the Sonoff dongles, But alas this issue still effects one out of the 2 blind motors I own both from same batch so I am doubtful of different firmware. oh well no loss as the SkyConnect will be better long term.

Looks like an Aqara hub to update firmware might be the only way to fix these. So annoying because it seems to be entirely ZHA issue and am not prepared to move to Z2M for this one device

@MTrab
Copy link
Contributor Author

MTrab commented Jul 19, 2023

Did you try the custom_quirk mentioned in this thread?
I'm using it without problems on my roller drivers.

@nworbneb
Copy link

nworbneb commented Jul 19, 2023

Bought a brand new HASS SkyConnect as I saw lots of issues with the Sonoff dongles, But alas this issue still effects one out of the 2 blind motors I own both from same batch so I am doubtful of different firmware. oh well no loss as the SkyConnect will be better long term.

Looks like an Aqara hub to update firmware might be the only way to fix these. So annoying because it seems to be entirely ZHA issue and am not prepared to move to Z2M for this one device

I updated to the latest firmware using ZHA (no need for Aqara hub) using 20221009111923_OTA_lumi.curtain.acn002_0.0.0_1530_20221009_6C9C3D.ota - this reports as firmware 0x00000f1e. It didn't resolve the issue.

Ref: https://github.com/Koenkk/zigbee-OTA/blob/master/index.json

@nworbneb
Copy link

Did you try the custom_quirk mentioned in this thread? I'm using it without problems on my roller drivers.

I don't believe the custom quirk is required as it is already commited.

@adamxp12
Copy link

@MTrab I have tried that as well as latest skyconnect firmware but still only one blind is working. I posted the debug data of my working and broken one above. this is so strange

@MTrab
Copy link
Contributor Author

MTrab commented Jul 19, 2023

Did you try the custom_quirk mentioned in this thread? I'm using it without problems on my roller drivers.

I don't believe the custom quirk is required as it is already commited.

Since when?! Last time I checked it wasn't commited with my changes.

@MTrab
Copy link
Contributor Author

MTrab commented Jul 19, 2023

@MTrab I have tried that as well as latest skyconnect firmware but still only one blind is working. I posted the debug data of my working and broken one above. this is so strange

The one I have posted?
In that case it should be registred like this:
image

Note the Quirk line.

@adamxp12
Copy link

firefox_2023-07-19_16-44-15

Mine seems the same except I was lazy and named the file e1.py so its not like for like but 100% using your custom qurik

@nworbneb
Copy link

nworbneb commented Jul 19, 2023

Did you try the custom_quirk mentioned in this thread? I'm using it without problems on my roller drivers.

I don't believe the custom quirk is required as it is already commited.

Since when?! Last time I checked it wasn't commited with my changes.

Someone else raised a pull, it's listed as version 3 (rather than 2a) but otherwise identical:

zigpy/zha-device-handlers#2341

@adamxp12
Copy link

Tried the OTA update file mentioned above. but dont seem to want to upgrade. But I dont feel like I need to because the working one has exact same file version 3614 so yet again the issue seems to be HASS not the blind motor

@adamxp12
Copy link

Okay got the firmware on the broken E1 to the latest 3870 same as the working one which updated itself.

And have the latest firmware on my skyconnect. so exactly like the people here with working ones. yet it still chooses the broken quirk over the working one.

Looks like I will just have to run Z2M because this bug dont seem to be fixable

@MTrab
Copy link
Contributor Author

MTrab commented Jul 20, 2023

You need to delete and repair it formitnto change quirk.
It doesn't change once paired

@adamxp12
Copy link

Define delete and repair?

I have been using the remove button in HA ad then putting the E1 into pairing mode and readding it

@MTrab
Copy link
Contributor Author

MTrab commented Jul 20, 2023

Okay, then it should be fine

@adamxp12
Copy link

Sadly continues to give me grief. I have zero clue why one works and one dont.

I feel like I need to reboot/factory reset the E1 but I cant seem to do that as it will repair itself everytime and dont seem to actually reset because it remembers top/bottom. starting to wonder if its actually faulty in some way

Someone needs to release a blind motor thats not garbage. all we have are this buggy Aqara and the Tuya version of it which seems identical but offers no battery gauge (not that it works on the Aqara when its such a common issue not pairing correctly)

@MTrab
Copy link
Contributor Author

MTrab commented Jul 20, 2023

Sorry to hear you have problems with the device.
I have no issues with the 4 I have, after I have added my custom quirk.

@adamxp12
Copy link

adamxp12 commented Jul 20, 2023

I 100% believe that this issue is a combination of things. I think HASS is not talking to it properly during the pairing stage. so the E1 is not exposing the right clusters? I bet Z2M would help

But I also feel like the E1 is just not exposing them to begin with which might explain why some people have success pairing with the actual Aqara hub then repairing with HASS. I bet the Aqara hub is sending some extra commands or something to wake the device up??

Does not explain how I have had one for years working and 1/2 of the brand new ones worked fine too. but the 3rd one which is identical hates life

@adamxp12
Copy link

Welp I paired with Z2M and battery showed properly but not device temperature. Repaired with ZHA and same no battery and always thinks its open garbage. urghhhh. I really dont want to move to Z2M but looks like ZHA is just not mature enough (though this is the first issue I have had with many zigbee devices in my setup)

@adamxp12
Copy link

Okay soz for the spam but I think I figured something out. I fully shut the blind then repaired and it worked... No idea why. but this info might help someone fix this issue

@adamxp12
Copy link

adamxp12 commented Sep 18, 2023

Just got 2x more motors in. new issue. same firmware as the now fully working 2x I had before. but these new ones refuse to give a battery percentage. I can get working temperature readings though. Using the quirk from above on the same firmware as before. have tried pairing multiple ways now. The actual blind and temperature work as expected so its like the blinds are just not giving out battery info? but the other 2x on same firmware work fine still

Over the past week of having the two new ones the same error has been logged by ZHA
Using a skyconnect with lastest irmware and HASS 2023.9.2

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 485, in handle_callback
    handler(*args)
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 509, in ezsp_callback_handler
    self._handle_frame(*args)
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 554, in _handle_frame
    self.packet_received(
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 1010, in packet_received
    self.handle_message(
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 526, in handle_message
    return sender.handle_message(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/device.py", line 367, in handle_message
    self.endpoints[src_ep].handle_message(
  File "/usr/local/lib/python3.11/site-packages/zigpy/endpoint.py", line 235, in handle_message
    handler(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 430, in handle_message
    self.handle_cluster_general_request(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 476, in handle_cluster_general_request
    self._update_attribute(attr.attrid, value)
  File "/usr/local/lib/python3.11/site-packages/zhaquirks/xiaomi/__init__.py", line 325, in _update_attribute
    self.endpoint.power.battery_percent_reported(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 845, in __getattr__
    raise AttributeError(f"No such command name: {name}")
AttributeError: No such command name: battery_percent_reported

The existing blinds seem to be working fine still.

Looks like probably upstream changes that are effecting this quirk? https://github.com/zigpy/zha-device-handlers/commits/dev/zhaquirks/xiaomi/__init__.py

I have removed the custom qurik and gone back to the included zha quirks and battery works fine... so seems like its no longer needed

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests