home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

Sonoff Door/Window Sensor SNZB-04 in ZHA doesn't give any entity status #44168

Closed Jens-Wymeersch closed 3 years ago

Jens-Wymeersch commented 3 years ago

The problem

I'm able to pair the sensor correctly but once paired it doesn't show/update the entity status (open/closed) in Home Assistant.

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

I'm using ELELABS Zigbee stick with Proxmox VM.

probot-home-assistant[bot] commented 3 years ago

Hey there @dmulcahey, @adminiuga, mind taking a look at this issue as its been labeled with an integration (zha) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

TheJulianJES commented 3 years ago

Just tried to reproduce this with an Elelabs stick (using custom firmware though) and a Sonoff Door/Window sensor. Pairing and opening/closing both work just fine. From your rough description, it seems like the initial pairing also works. So just when you open/close the door sensor, it doesn't reflect the state in Home Assistant. Can you enable debug logs (https://www.home-assistant.io/integrations/zha/#reporting-issues) and then open/close the sensor and send the relevant logs? (Perhaps having logs of the pairing also wouldn't be a bad idea)

Jens-Wymeersch commented 3 years ago

@TheJulianJES I tried again today. It worked to pair and to see the right status with of them. The only difference between previous tries is that I've updated today to the latest latest releases. By the way the pairing process has improved significantly with this release. Big kudo's to the team ! For the second one i still unable to get the right status all the time. Sometimes it worked and sometimes it didn't. Here you find the logs from startup https://privatebin.net/?432f1fd04b402f9e#8ByGYCh3KH1B9khBHLPp2sWtXACV4bTVuFktdW2RxwF9

The id from both devices are 0x0ab6 (failure) and 0xf338 (success).

Jens-Wymeersch commented 3 years ago

For device 0xf338, i saw that the battery was depleted and now doesn't show the right status anymore. So basically I have 2 devices paired but none of them give the right status

TheJulianJES commented 3 years ago

I didn't take a closer look at the logs yet, but battery reporting isn't always really accurate. The best indication seems to be to check how bright the LEDs from devices are. If possible, could you just try replacing the batteries for new ones (or swapping them)? It could be that both of the batteries aren't powerful enough to get the device to report properly.

(Also some more generic troubleshooting steps:

Also, if you're still running the stock Elelabs firmware (based on v6 probably), you could try updating it to custom firmware from the "zha-ng" repo: https://github.com/zigpy/zigpy/wiki/Coordinator-Firmware-Updates#elelabs-adapters-elu013-and-elr023 You shouldn't loose any settings or devices. For me, this fixed some Xiaomi sensors directly dropping off the coordinator after some fixed amount of time.

For using the custom firmware, this would be needed in the Hass config:

zha:
  zigpy_config:
    source_routing: true
    ezsp_config:
      CONFIG_APS_UNICAST_MESSAGE_COUNT: 20
      CONFIG_MAX_END_DEVICE_CHILDREN: 32
      CONFIG_SOURCE_ROUTE_TABLE_SIZE: 200
      CONFIG_ADDRESS_TABLE_SIZE: 16
Jens-Wymeersch commented 3 years ago

@TheJulianJES I tried to pair them with a router Tuya/jinvoo curtain switch which I used throughout the house because it had the best performance. But I'll try again. For the Elelabs, I flashed it from day 1 as described. EZSPv8 and then efr32mg13p-v8-676-sw-115200. I however didn't add anything in the configuration.yaml file.

I have currently 89 devices connected (of which about 50 routers). 41 devices are being routed through routers (all sensors). What will be the impact of adding the code ?
zha: zigpy_config: source_routing: true ezsp_config: CONFIG_APS_UNICAST_MESSAGE_COUNT: 20 CONFIG_MAX_END_DEVICE_CHILDREN: 32 CONFIG_SOURCE_ROUTE_TABLE_SIZE: 200 CONFIG_ADDRESS_TABLE_SIZE: 16

github-actions[bot] commented 3 years ago

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.