Comments (5)
@taligentx, I find all needed parts inside dscKeybusPrintData.cpp
in [Armed by access code] & [Disarmed by access code] sections.
The main idea is to know and maybe log which user armed/disarmed system.
Maybe in future you will add storage of last used access code number in variable to simplify usage together with Admed/Disarmed events?
For now I will try to get this codes numbers in my sketch using code parts from dscKeybusPrintData.cpp.
from dsckeybusinterface.
As you've seen, the data is available but not currently tracked, I'll look into it.
from dsckeybusinterface.
@taligentx ,thank you!
Now I get it like this:
String sUserCode_id="";
void setStatus(byte partition) {
...
switch (dsc.status[partition]) {
...
case 0x04: __getAccesCodeID(); writeLog("Armed stay by "+sUserCode_id); break;
...
}
}
void __getAccesCodeID() {
sUserCode_id="";
bool bOK=false;
while (!bOK){
switch (dsc.panelData[0]) {
//case 0xA5: bOK=true; __getAccesCodeID_0xA5(); break;
case 0xEB: bOK=true; __getAccesCodeID_0xEB(); break; //Access Code ID always is getted here
default: {
break;
}
}
dsc.handlePanel(); // Continues processing Keybus data
}
}
void __getAccesCodeID_0xEB() {
switch (dsc.panelData[7]) {
case 0x00: __getAccesCodeID_0(8); return;
default: {
return;
}
}
}
void __getAccesCodeID_0(byte panelByte) {
bool decoded = true;
switch (dsc.panelData[panelByte]) {
case 0x49: break;
case 0x4A: break;
case 0x4B: break;
case 0x4C: break;
case 0x4D: break;
case 0x4E: break;
case 0x4F: break;
case 0x50: break;
case 0x51: break;
case 0x52: break;
case 0x53: break;
case 0x54: break;
case 0x55: break;
// 0x56 - 0x75: Zone tamper, zones 1-32
// 0x76 - 0x95: Zone tamper restored, zones 1-32
case 0x98: break;
// 0x99 - 0xBD: Armed by access code
case 0xBE: break;
case 0xBF: break;
// 0xC0 - 0xE4: Disarmed by access code
case 0xE5: break;
case 0xE6: break;
case 0xE7: break;
case 0xE8: break;
case 0xE9: break;
case 0xEA: break;
case 0xEC: break;
case 0xEF: break;
case 0xF0: break;
case 0xF1: break;
case 0xF4: break;
case 0xFF: break;
default: decoded = false;
}
if (decoded) return;
if (dsc.panelData[panelByte] >= 0x99 && dsc.panelData[panelByte] <= 0xBD) {
byte dscCode = dsc.panelData[panelByte] - 0x98;
if (dscCode >= 35) dscCode += 5;
//sUserCode_id+="Armed by ";
switch (dscCode) {
case 33: sUserCode_id+="duress "; break;
case 34: sUserCode_id+="duress "; break;
case 40: sUserCode_id+="master "; break;
case 41: sUserCode_id+="supervisor "; break;
case 42: sUserCode_id+="supervisor "; break;
default: sUserCode_id+="user "; break;
}
sUserCode_id+="code ";
sUserCode_id+=String(dscCode);
return;
}
if (dsc.panelData[panelByte] >= 0xC0 && dsc.panelData[panelByte] <= 0xE4) {
byte dscCode = dsc.panelData[panelByte] - 0xBF;
if (dscCode >= 35) dscCode += 5;
//sUserCode_id+="Disarmed by ";
switch (dscCode) {
case 33: sUserCode_id+="duress "; break;
case 34: sUserCode_id+="duress "; break;
case 40: sUserCode_id+="master "; break;
case 41: sUserCode_id+="supervisor "; break;
case 42: sUserCode_id+="supervisor "; break;
default: sUserCode_id+="user "; break;
}
sUserCode_id+="code ";
sUserCode_id+=String(dscCode);
return;
}
}
I think this is not the best way, but it works in my current test sketch.
from dsckeybusinterface.
Added to the develop branch, check the Status examples to see how it can be used. Note that the panel sends the access code in a separate message after the armed/disarmed status, so it's handled as a separate status instead of combined with the armed status checking.
from dsckeybusinterface.
Thank you!
from dsckeybusinterface.
Related Issues (20)
- Question ) Module message for fir, auxiliary and panic alarm
- question HOT 3
- [Contribution] New Status on Set 0x16 / Module PC5200 HOT 4
- Status not properly reported for "stay no entry delay"
- PC3000 Testing HOT 9
- Is it possible to send disarm code via MQTT? HOT 7
- esp32-Poe adapter support? HOT 1
- Temperature display HOT 2
- QR Code
- VirtualKeypad-Web compilation error HOT 1
- VirtualKeypad WEB, serial output.
- Keybus Error / Address? HOT 3
- OpenHab MQTT esp8266 issue
- DSC PC1550 Clasic Series 6 digit code compile ok but keep rebooting HOT 2
- Make your own input expander
- Debugging disarm not working overnight HOT 3
- Ignore
- Lastest version outgrew UNO?? HOT 3
- Unable to request states for Zone 9 and 11+ (1-8 and 10 working fine) PC3000 HOT 1
- PC3000 - Zones 9-16 not updating HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsckeybusinterface.