dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

Aquara Multi Sensors (Temperature/Pressure/Humidity) no longer reporting temperature #5974

Closed UppyJC closed 2 years ago

UppyJC commented 2 years ago

Describe the bug

Since upgrading to latest deCONZ version, Aquara Multi Sensors (Temperature/Pressure/Humidity) no longer reporting temperature. API reports null values, Phoscon reports 0 degrees. Pressure and humidity values fine.

Deleting and re-adding sensors makes no difference.

Working correctly on previous version, but can't remember which version that was!

Steps to reproduce the behavior

Add any sensor of affected type to deCONZ. Observe null temperature value in API and 0 temperature value in Phoscon. Humidity and pressure values report correctly.

Expected behavior

Temperature value reports correctly in API and Phoscon.

Screenshots

Screenshot 2022-04-22 at 14 49 32 Screenshot 2022-04-22 at 14 49 45

Environment

deCONZ Logs

Additional context

UppyJC commented 2 years ago

Ok, we have progress!

The issue appears to be files left behind in "devices" directories from previous versions, with one nested inside the other. i.e. "C:\Program Files (x86)\deCONZ\devices\generic" and "C:\Program Files (x86)\deCONZ\devices\devices\generic" (I think that's where it was before I moved it...). This second folder had a much older modified date on it.

I also had further a further "devices" directory in the user account's AppData\Local folder.

I have moved all but the first folder mentioned out of anywhere deCONZ is looking and everything started working with the DDF editor no-longer showing duplicate attributes.

Most sensors are now reporting temperature successfully - some still reporting zero at the moment, but I can re-pair those.

Not sure how I ended up with so many "devices" directories on my system, but I'd suggest others with the issue check they've not got the same.

Further update... another 2 of the sensors now reporting temperature so they're fixing themselves as they check in. 2 to go!

manup commented 2 years ago

Cool nice findings, there was a bit of struggle in earlier versions to get the files placed, I guess these are the leftovers. I'll check the installer to auto cleanup such structures, easy solution is to just remove the Program Files (x86)\deCONZ\devices before installing the package version to get always the clean copy.

The devices directory in the AppData\Local is created automatically, it's there to be able to create overwrites from the packaged versions.

UppyJC commented 2 years ago

Ah cool - I thought the AppData copy might be auto-created but wasn't sure. Sounds like the cleanup in the installer is probably the best way to resolve this issue!

Apologies it's taken so long chasing such a strange problem which, of course, will only occur on setups that have followed certain version upgrade paths! I'm just glad I could be part of finding the root cause in the end.

All sensors are now reporting temperature successfully.

CherAlban commented 2 years ago

Coming from 2.16.1 I deleted both devices directories and re-installed 2.16.1 again. The AppData devices directory got re-created and is empty now, the Programs devices directory also got re-created (non nested) holding all .json directories and files. Some of my devices became not reachable, but after re-adding them, all of them are reporting correctly now.

Thanks for your work, and good catch!

kimmeld commented 2 years ago

Wow, great find!

I had the extra devices directory just like @UppyJC - moved it out of the way and the sensors are slowly reporting in.

Thanks for your help everyone!

MrSolo570 commented 2 years ago

Hey thanks for your diagnostics and the detailed how to for a Windows machine. I am running deconz within a docker container / plugin for home assistant. Is this problem going to be fixed with future patches or do I have to remove files and such manually like described above?

manup commented 2 years ago

In the Docker container this usually shouldn't be a problem, I think they are build from scratch like a first installation?

I've fixed the Windows installer script now to ensure a fresh copy. Also the .deb package preinstall script to do the same (alltough I'm not sure if it is the same problem on Linux..).

thyaoo06 commented 2 years ago

Hi, I have got same trouble, please did you set up a new exe in http://deconz.dresden-elektronik.de/win/. Last one is from 24May... Thanks a lot for your debug :=)

thyaoo06 commented 2 years ago

Many Thanks for the new file....

xavax59 commented 2 years ago

I have de 2.16.1 on jeedom and i have the same issue. Editing the relevant DDF (xiaomi_wsdcgq11lm_temp_hum_press_sensor.json) and changing it to Bronze and it's ok.

Smanar commented 2 years ago

So it work again with disabling the DDF. But on jeedom you are not on windows ?

xavax59 commented 2 years ago

So it work again with disabling the DDF. But on jeedom you are not on windows ?

Yes ! it work with DDF In Bronze. My Jeedom Works on debian 10.10

SwoopX commented 2 years ago

I'm closing this one, as the solution is to install the latest version (2.17.0).

xavax59 commented 2 years ago

I’m in 2.16.1. It’s the latest version ? I have the problème with this version ….

Smanar commented 2 years ago

The 2.16 is the last stable, the last beta is the 2.17.

xavax59 commented 2 years ago

With the last stable 2.17.1 I have the same problem

MrSolo570 commented 2 years ago

Hey @MrSolo570 ,

In your deCONZ install there will be a devices directory - mine is C:\Users\ha_user\AppData\Local\deCONZ\devices, but yours will likely be different.

From here, go the xiaomi directory and open the file for your sensor (xiaomi_wsdcgq11lm_temp_hum_press_sensor.json is the one I used), then find the line that reads "status": "Gold", and change Gold to Bronze. Restart deCONZ and the sensor will now be using the old working code, not the new DDF code.

I tried that as you can see but the sensor is still not working... image

Smanar commented 2 years ago

You have the "Bronze" Status on your capture.