druciak
(druciak)
April 2, 2018, 2:02pm
2652
Just found a while to analyze the code. Decapsulating multiinstance code looks weird to me…
We have a notification:
2018-04-02 14:44:31.265 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 0C 00 04 00 1A 06 60 06 02 25 03 FF 56
So this is:
2018-04-02 14:44:31.281 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Received msg (0): Message: class=ApplicationCommandHandler[4], type=Request[0], dest=26, callback=0, payload=00 1A 06 60 06 02 25 03 FF
Which is sent from node 26 with multiinstance message: 60 06 02 25 03 FF
This is what we have in ZWaveCommandClassPayload as payload bytes.
Then the control goes to ZWaveNode.processCommand(60 06 02 25 03 FF) : https://github.com/openhab/org.openhab.binding.zwave/blob/development/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveNode.java#L1126
Here: https://github.com/openhab/org.openhab.binding.zwave/blob/development/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveNode.java#L1203
we check payload.getCommandClassId() which takes byte nbr 0 of the payload -> 60 (COMMAND_CLASS_MULTI_CHANNEL)
and payload.getCommandClassCommand() which takes byte nbr 1 of the payload -> 06
Then we go into ‘if’ statement and here: https://github.com/openhab/org.openhab.binding.zwave/blob/development/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveNode.java#L1219
we realize this is MULTI_INSTANCE_ENCAP
AND (!) we get instance number from byte nbr 1 (from which we were taking class command) -> 06.
Shouldn’t we take byte nbr 2 (02)? This is what I spotted just browsing sources, haven’t had time to debug this yet, but definitely will do.
Is this a bug or I am just missing something?
chris
(Chris Jackson)
April 2, 2018, 2:10pm
2653
I will take a look - thanks (but this is not related to the issue where the device is not responding to the MC requests).
chris
(Chris Jackson)
April 2, 2018, 2:14pm
2654
Strictly speaking, it’s a bug, but the code is not used so can be deleted. It will not change the operation of the binding at all since it is assigned to a value that is never used. Probably this was a line for debugging at some stage in the past…
druciak
(druciak)
April 2, 2018, 5:22pm
2655
chris:
I will take a look - thanks (but this is not related to the issue where the device is not responding to the MC requests).
I am talking about Node 13 and 26 issue, this log is for node 26.
chris:
Strictly speaking, it’s a bug, but the code is not used so can be deleted.
Are you sure? Please take a closer look. There is another bug: endpoint number is assigned indeed to wrong variable, but the code is definitely used.
I just tested it and now - woohoo - reports are back for node 13 and 26. I am going to make a PR in a few minutes.
1 Like
chris
(Chris Jackson)
April 2, 2018, 5:31pm
2656
I’m a bit confused what you’re talking about with this? What log are you talking about - your report above didn’t have a log .
Well, I just deleted the line and there were no errors as the variable is not used, so yes, I’m pretty sure.
Cool - I’ll be interested to see this .
Just to be sure… @chris , did you see my post?
chris
(Chris Jackson)
April 2, 2018, 5:37pm
2658
No - it’s lost in this thread. It doesn’t seem to be related to security in any way is it? Maybe a separate thread would be better as we don’t need to discuss every zwave issue here .
I’m not really sure I can answer much though - probably something strange in the lower layers outside of the binding, but I don’t know.
druciak
(druciak)
April 2, 2018, 5:38pm
2659
chris:
Well, I just deleted the line and there were no errors as the variable is not used, so yes, I’m pretty sure.
Read my post carefully. Indeed instanceNumber is not used, but everything inside this ‘if’ (lines 1219-) is needed. So there are actually 2 bugs.
Here is PR: Fix for MULTI_INSTANCE_ENCAP by druciak · Pull Request #865 · openhab/org.openhab.binding.zwave · GitHub
1 Like
chris:
It doesn’t seem to be related to security in any way is it?
Nope. I thought this thread was about this developement binding in general, not just the security part. I guess if you can’t answer there aren’t much hope here though. I’ll see if I get any further information out and post in a new thread if I do
chris
(Chris Jackson)
April 2, 2018, 5:44pm
2661
Sorry - it was not so easy to understand.
chris
(Chris Jackson)
April 2, 2018, 5:48pm
2662
PR looks good - thanks. It should help solve some of the issues with old devices that support the older multi-instance class.
Please can you sign the commit and the PR though. Thanks.
druciak
(druciak)
April 2, 2018, 6:01pm
2663
chris:
Sorry - it was not so easy to understand.
Yes, I know. I was in the middle of building/installing/analysing the binding and focusing on all of these so my posts here are little bit chaotic.
chris:
Please can you sign the commit and the PR though.
The commit has “signed-off” do I need to do something more?
chris
(Chris Jackson)
April 2, 2018, 6:07pm
2664
Generally it should be on the PR as well, but that’s fine - I didn’t see it on the commit. I’ve merged and I’ll try and do an update later or tomorrow.
Hi, thank you for a good refactoring session Im having issues with some of my fibaro magnet sensor and smoke detectors and hopes that this will be the remedy.
Is there any upgrade path explained somewhere? Perhaps a wiki? Second, when do you think this will be mainstreamed and will it require manual steps?
Keep up the good work!
chris
(Chris Jackson)
April 7, 2018, 8:44am
2666
The first 5 or 6 messages in this thread have the update method.
I will try and look at it once I finish some other work in a month or so.
Yes.
5iver
(Scott Rushworth)
April 7, 2018, 1:54pm
2667
It would be helpful if you could include steps in the first post for removing/rediscovering existing Things, and remove the link to the old jar in post 6 . And since this thread gets so much traffic, maybe add some helpful links, like the database and OH zwave binding documentation.
I’ve load the newest development snapshot of 2.April 2018.
Now all my Z-Wave devices are marked as UNINITIALIZED in Paper UI.
Before was installed the snapshot 2.3.0 of this link:
https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastStableBuild/org.openhab.binding%24org.openhab.binding.zwave/
Do you know something about this problem?
sihui
(SiHui)
April 8, 2018, 6:25pm
2669
Yes, read the first couple of posts in this thread: you need to delete all things and readd them if you want to switch from snapshot to development.
awakefie
(Aaron)
April 8, 2018, 11:26pm
2670
I have a GE Zwave Fan switch and since switching to Openhab2 it no longer has speed control. It only does on/off.It is being recognized as a ‘ZWave 4002 In-Wall Smart Fan Control’
Any thoughts?
sihui
(SiHui)
April 9, 2018, 5:44am
2671
awakefie:
It only does on/off.
I guess you need to link two items, one switch and one dimmer, to the switch_dimmer
channel:
http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/281