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 911 forks source link

Alarm Command Class V2: Incorrect AlarmCmd in command_classes/Alarm.cpp #1230

Closed evanfloden closed 7 years ago

evanfloden commented 7 years ago

Problem

I have an alarm access keypad device which claims to send an Alarm Command Class Version 2 with an extra byte containing the UserCode.

The alarm type is Alarm_Access_Control and as described in the wiki:

the Alarm_Access_Control Type and Alarm_Access_Control_KeyPad_Lock Event exposes a Additional ValueByte containing the UserCode Position that was entered on the device.

This type is only available in Version 2 of the command class.

Yet for the device to be recognised as Version 2 (and thus for OZW to process the extra ValueByte) the command_classes/Alarm.cpp code requires that the byte after the command class (0x71) to be:

Version 1:

Version 2:

This is clearly not happening with this device with the message of the command recieved being for example:

0x71, 0x05, 0x00, 0xff, 0x00, 0xff, 0x06, 0x05, 0x01, 0x02, 0x87

Given that that Alarm::HandleMsg is evaluating:

(AlarmCmd)_data[0] == 0x05 == AlarmCmd_Report

it seems it is not possible to retrieve the extra ValueByte as it would if it was evaluated as AlarmCmd_SupportedReport and entered this condition here.

From this I have deduced that one of either two things is happening. Either:

  1. OZW is incorrectly requiring the byte from (AlarmCmd)_data[0] to be 0x07 or 0x08 to be recognised as a version 2 command and thus retrieve the extra ValueByte.

  2. The manufacturer is not adhering to version 2 and the device should be using 0x08.

Proposed Solution Either way, it seems that the command_classes/Alarm.cpp could be modified to allow the capture of the additional ValueByte.

Device: Zipato Mini RFiD Keypad

Example Command Message Recieved: 0x71, 0x05, 0x00, 0xff, 0x00, 0xff, 0x06, 0x05, 0x01, 0x02, 0x87

Index -> Value:

Fishwaldo commented 7 years ago

Firstly SupportedReport != Report.

SupportedGet/Report is check the capabilities of the device. In this case, the type of Alarms it supports. Its not used to report Alarm Updates.

secondly, This has been addressed in the Dev Branch, where we support upto Version 3 of the AlarmClass.

But we need to continue to work on it to get it upto Version 8 of the Notification CC (Renamed from Alarm Class after Version 3)

evanfloden commented 7 years ago

Thanks for the quick reply. The new code in Dev Branch makes a lot more sense, will try it out.

Fishwaldo commented 7 years ago

It still needs work, and the way we expose things will change, but its a start.... Version 8 of the Notification CC has a lot of extra features. How to "expose" them to the app I haven't figured out yet.

openzwave-dev-watcher commented 7 years ago

Do you need official documentation ?

Il giorno venerdì 26 maggio 2017 12:32:06 UTC+2, Justin Hammond ha scritto:

It still needs work, and the way we expose things will change, but its a start.... Version 8 of the Notification CC has a lot of extra features. How to "expose" them to the app I haven't figured out yet.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OpenZWave/open-zwave/issues/1230#issuecomment-304248559, or mute the thread https://github.com/notifications/unsubscribe-auth/AK91Zn0wMxS9evU8RY_oKEGjrblb3aB0ks5r9qojgaJpZM4NnWAU .

openzwave-dev-watcher commented 7 years ago

The documentation is public, so no need. 

Justin Hammond

On 29 May 2017, at 4:28 PM, giuseppe d <demarco.giu@gmail.com mailto:demarco.giu@gmail.com > wrote:

Do you need official  documentation ?

Il giorno venerdì 26 maggio 2017 12:32:06 UTC+2, Justin Hammond ha scritto:

It still needs work, and the way we expose things will change, but its a start.... Version 8 of the Notification CC has a lot of extra features. How to "expose" them to the app I haven't figured out yet.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

-- You received this message because you are subscribed to the Google Groups "OpenZWave" group. To unsubscribe from this group and stop receiving emails from it, send an email to openzwave+unsubscribe@googlegroups.com mailto:openzwave+unsubscribe@googlegroups.com . For more options, visit https://groups.google.com/d/optout.