1 diff --git a/hardware/OpenZWave.cpp b/hardware/OpenZWave.cpp
2 index 1f5c341c..51b2865b 100644
3 --- a/hardware/OpenZWave.cpp
4 +++ b/hardware/OpenZWave.cpp
5 @@ -1641,19 +1641,83 @@ void COpenZWave::AddValue(const OpenZWave::ValueID &vID, const NodeInfo *pNodeIn
8 _device.instanceID = newInstance;
9 - if (m_pManager->GetValueAsByte(vID, &byteValue) == true)
12 + (vLabel == "Access Control") ||
13 + (vLabel == "UserCode")
16 - _device.devType = ZDTYPE_SWITCH_NORMAL;
18 - _device.intvalue = 0;
20 - _device.intvalue = 255;
21 - InsertDevice(_device);
22 + if( ValueID::ValueType_List == vID.GetType() )
26 + std::string vListStr;
27 + if (m_pManager->GetValueListSelection(vID, &vListStr))
29 + _device.devType = ZDTYPE_SWITCH_NORMAL;
30 + _device.Alarm_Type = 6;
31 + _device.intvalue = 0;
32 + if (vListStr == "Access Control - RF Lock")
33 + _device.intvalue = 24;
34 + else if (vListStr == "Access Control - RF Unlock")
35 + _device.intvalue = 25;
36 + else if (vListStr == "Access Control - Manual Lock")
37 + _device.intvalue = 21;
38 + else if (vListStr == "Access Control - Manual Unlock")
39 + _device.intvalue = 22;
40 + else if (vListStr == "Access Control - KeyPad Lock")
41 + _device.intvalue = 18;
42 + else if (vListStr == "Access Control - KeyPad Unlock")
43 + _device.intvalue = 19;
44 + else if (vListStr == "Not Active")
45 + _device.intvalue = 1;
47 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: Unhandled List Selection: %s", vListStr.c_str());
48 + InsertDevice(_device);
53 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: GetValueListSelection Exception");
57 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: Unhandled Value for Label: %s", vLabel.c_str());
60 + else if( ValueID::ValueType_Byte == vID.GetType() )
62 + if (m_pManager->GetValueAsByte(vID, &byteValue) == true)
64 + _device.devType = ZDTYPE_SWITCH_NORMAL;
66 + _device.intvalue = 0;
68 + _device.intvalue = 255;
69 + InsertDevice(_device);
74 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: Unhandled Value: X, Type: %i", vID.GetType());
79 - if (vLabel != "SourceNodeId")
80 + if (vLabel == "UserCode") {
81 + if ((vType == OpenZWave::ValueID::ValueType_Raw) || (vType == OpenZWave::ValueID::ValueType_String))
83 + std::string strValue;
84 + if (m_pManager->GetValueAsString(vID, &strValue) == true)
85 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: UserCode: %s", strValue.c_str());
89 + if (m_pManager->GetValueAsByte(vID, &byteValue) == true)
90 + _log.Log(LOG_STATUS, "OpenZWave: Value_Added: UserCode: %i", byteValue);
93 + else if (vLabel != "SourceNodeId")
95 _log.Log(LOG_STATUS, "OpenZWave: Value_Added: Unhandled Label: %s, Unit: %s", vLabel.c_str(), vUnits.c_str());
97 @@ -2395,7 +2459,7 @@ void COpenZWave::UpdateValue(const OpenZWave::ValueID &vID)
98 unsigned char byteValue = 0;
100 std::string strValue = "";
102 + std::string lValue = "";
104 if (vType == OpenZWave::ValueID::ValueType_Decimal)
106 @@ -2833,16 +2897,40 @@ void COpenZWave::UpdateValue(const OpenZWave::ValueID &vID)
108 else if (vLabel == "Access Control")
110 + if (!lValue.empty()) {
111 + if (lValue == "Access Control - RF Lock")
113 + else if (lValue == "Access Control - RF Unlock")
115 + else if (lValue == "Access Control - Manual Lock")
117 + else if (lValue == "Access Control - Manual Unlock")
119 + else if (lValue == "Access Control - KeyPad Lock")
121 + else if (lValue == "Access Control - KeyPad Unlock")
123 + else if (lValue == "Not Active")
130 case 0x00: // Previous Events cleared
131 case 0x06: //Keypad unlock/Arm Home
132 + case 0x12: // KeyPad lock
133 + case 0x15: // Manual Lock
134 case 0x17: // Door closed
135 + case 0x18: // RF operated lock
136 case 0xfe: // Unkown event; returned when retrieving the current state.
140 case 0x05: //Keypad Lock/Arm Away
141 + case 0x13: // KeyPad unlock
142 case 0x16: // Door open
143 + case 0x19: // RF operated unlock
144 default: // all others, interpret as alarm