Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
evanfloden opened this issue May 26, 2017 · 5 comments
Closed

Comments

@evanfloden
Copy link

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:

  • AlarmCmd_Get = 0x04
  • AlarmCmd_Report = 0x05

Version 2:

  • AlarmCmd_SupportedGet -> 0x07
  • AlarmCmd_SupportedReport -> 0x08

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:

  • 0: Command Class (113 = COMMAND_CLASS_ALARM)
  • 1: AlarmCmd Report
  • 2: Alarm Type
  • 3: Alarm Level (0 or 255)
  • 4: SourceNodeID
  • 9: User Code
  • 10: Burglar
@Fishwaldo
Copy link
Member

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
Copy link
Author

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

@Fishwaldo
Copy link
Member

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
Copy link

openzwave-dev-watcher commented May 29, 2017 via email

@openzwave-dev-watcher
Copy link

openzwave-dev-watcher commented May 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants