Boaz-Chang / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

Implement ZWave Binding #265

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
General ZWave Support

Implement binding for ZWave Controller/Device/Network support. 

Original issue reported on code.google.com by bmcro...@gmail.com on 29 Apr 2013 at 12:25

GoogleCodeExporter commented 9 years ago
I think I have somehow overwritten/lost my changes whilst trying to figure out 
how to merge!! Do you still have a copy? I have it locally here.

Original comment by ben.jone...@gmail.com on 21 Aug 2013 at 11:10

GoogleCodeExporter commented 9 years ago
Sure, everything is here.

Original comment by jwsp...@gmail.com on 21 Aug 2013 at 11:14

GoogleCodeExporter commented 9 years ago
I've committed and merged your code. I've changed the extractValue method a bit.

First i've changed byte values to int values. byte values are signed (no 
unsigned types in java) and bite you in the *** when you start combining them 
with integers, because 0xFF is -1 instead of 255. So I try representing bytes 
as ints wherever I can to avoid the issue. Memory usage isn't an issue anyway 
anymore and java + OS usually aligns at bigger boundaries anyway.

Then the negate is unneccessary since the int value is signed. so bit shifting 
it nicely to the left actually creates a signed version already. The |= for 
smaller values remains neccessary to get a nice 2-complement version of the 
negative value.

Original comment by jwsp...@gmail.com on 21 Aug 2013 at 11:53

GoogleCodeExporter commented 9 years ago
Ow, and this function only works with 1, 2 or 4 byte values. But i've read in 
some spec that these are the only sizes offered, so the rest seems ok.

Original comment by jwsp...@gmail.com on 21 Aug 2013 at 11:55

GoogleCodeExporter commented 9 years ago
Ok - I just copied that function from openzwave and to be honest I am pretty
green when it comes to all this byte shifting etc. Glad you have fixed it
up! Cheers.

I am looking forward to this state converter stuff - that will solve my
issue with the door sensor only sending BASIC_REPORTs. I can just create the
item as a Contact and the converter will be able to convert from the on/off
to OPEN/CLOSED.

Next up I am going to install my Fibaro universal sensor and try to get that
reporting values. That should be 2 binary sensors and a multi level sensor
(another temp). I think the binary sensor command class should be returning
a boolean, rather than "OPEN" or "CLOSED" - agreed?

Making great progress!

Original comment by ben.jone...@gmail.com on 22 Aug 2013 at 12:01

GoogleCodeExporter commented 9 years ago
Yeah it should be returning a boolean. I'll get that with the converter stuff 
i'm doing anyway in the 1.4.0 branch.

Want to try and keep the 1.3.0 branch pretty clean as the issues state is ready 
for merge. This was a nice new command class, but I think we should leave the 
1.3.0 mostly the way it is now.

Original comment by jwsp...@gmail.com on 22 Aug 2013 at 12:07

GoogleCodeExporter commented 9 years ago
issue state is ReadyForReview I meant.

Original comment by jwsp...@gmail.com on 22 Aug 2013 at 12:08

GoogleCodeExporter commented 9 years ago
Yep - totally agree. I think it is more than ready for the 1.3.0 release
now.

Original comment by ben.jone...@gmail.com on 22 Aug 2013 at 12:09

GoogleCodeExporter commented 9 years ago
I will create binaries tomorrow. Have to get some sleep now.

Original comment by jwsp...@gmail.com on 22 Aug 2013 at 12:12

GoogleCodeExporter commented 9 years ago
and the binaries with sensor_multilevel

Original comment by jwsp...@gmail.com on 22 Aug 2013 at 8:04

Attachments: