OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 918 forks source link

BeNext door sensors no longer working since v1.4 to v1.6 transition / Domoticz #2512

Open Catfriend1 opened 3 years ago

Catfriend1 commented 3 years ago

Hi,

I suspect there is a bug in the openzwave driver at https://github.com/OpenZWave/open-zwave/blob/a9d57fccf045d6adca8ab172f982688844ddb512/cpp/src/Manager.cpp#L1872 where "isValueValid" is offered for Domoticz at https://github.com/domoticz/domoticz/blob/28537b5bbc0e4d88e99ca3540e354f7964687f7c/hardware/OpenZWave.cpp#L2503 .

I've searched for the root cause across weeks. Trying to find out why Domoticz commit "11034 | 68ee7a9b1 | 20190727 | OZW, better battery support" broke support for my BeNext door sensors until today. Meanwhilst, Domoticz updated OZW driver from 1.4 to 1.6+. I discovered that removing the pManager->isValueValid check brings back the sensor readings to life. (See my comparison PR https://github.com/domoticz/domoticz/compare/development...Catfriend1:fixBeNext ) which is a "dirty fix". I think the BeNext values should be interpreted as VALID in the OZW driver instead.

Domoticz commit history, for reference:

More info on my Domoticz GitHub ticket and forum posting:

Quote:

Hi,

Extensive information can be found here: https://www.domoticz.com/forum/viewtopic.php?f=24&t=33505&p=264243#p264243

I've verified the bug by buying new components and only building a ZW network from with the Aeotec Gen5 Stick and a BeNext door sensor.

Sensor info:
BeNext Door Sensor | BeNext | 0x0101 | 0x0004

Commit # 68ee7a9 makes Domoticz no longer "process" updates from the sensor which the sensor still transmits over the air to the ZWave Controller correctly.

It last WORKED in "11033 | 8faa48d | 20190727 | Bugfix: Resolved problem with HTTP Protocol Listen broken by previous fix.".
It does NO LONGER WORK since "11034 | 68ee7a9 | 20190727 | OZW, better battery support"
It does NO LONGER WORK in current domoticz releases.

Source of commit info: https://www.domoticz.com/wiki/Domoticz_version_table_V4
I've built on Debian 10.7 using libboost 1.72.0 and the current OpenZWave master (1.6+). OZW version is: Version: 1.6-1570-ga9d57fcc

===

I did a "git revert 68ee7a9" on top of "git checkout 2020.2" and it did NOT work. Looking through "hardware/OpenZWave.cpp" ( https://github.com/domoticz/domoticz/blob/development/hardware/OpenZWave.cpp ) , I've found this is also required to make it work again:

Patch: Catfriend1@8912f35

Original spot of the 2nd problem:

domoticz/hardware/OpenZWave.cpp

Line 2503 in 28537b5

 if (!m_pManager->IsValueValid(vID)) 
I don't know Domoticz code in deep so please patch it properly.

To sum up: Two commits are required to be reverted/corrected to make the BeNext door sensor work again.
commit 1: 68ee7a9
commit 2: 130020b

Thank you.

Kind regards,
Catfriend1