How to determine the actual number of partitions? #99
Replies: 9 comments
-
This isn't currently tracked in the library but in theory you could check the status commands (0x05, 0x27, etc) to see which partitions are disabled (status = 0xC7). In general, it is possible to obtain all panel and module data in the sketch - the library exposes the panel data as At that point it's a matter of processing the data similar to what happens in For now selecting which data to use resources to track is arbitrary - I've thought about having a set of extended status commands that are only available to esp8266/esp32, though for now it's made more sense to setup new status tracking as actual use cases come up. |
Beta Was this translation helpful? Give feedback.
-
I'm unfamiliar with the inner workings of the panel protocols. Could you elaborate please? What are the "status commands" and how can I access them? |
Beta Was this translation helpful? Give feedback.
-
For example: To see if partition 2 is disabled, in the sketch you could check on each run of If I get around to writing an example of unlocking a panel it would demonstrate this technique in the sketch because it would need some of the panel data that I don't think the library needs to track in general. |
Beta Was this translation helpful? Give feedback.
-
Actually, I forgot that I had already broken out the status per partition so it should be straightforward:
Loop through the partitions but as an example for partition 2 you should be able to check |
Beta Was this translation helpful? Give feedback.
-
In my loop, I got these values: |
Beta Was this translation helpful? Give feedback.
-
Which panel model is this? The PC1864 will use PC1864, partition 1 enabled, 2-8 disabled:
When the sketch first starts up this will not be valid until one of the status commands is processed. |
Beta Was this translation helpful? Give feedback.
-
It's PC1565. At the time I reported, the sketch has been running in the main loop() for a while. |
Beta Was this translation helpful? Give feedback.
-
I'd like to know the partitions inside setup(). What's the best way to wait until the status commands are processed? Sorry, I understand that this may sound like a stupid question to you. I'm still working on better understanding how the library works. |
Beta Was this translation helpful? Give feedback.
-
I tried the following inside setup() but it didn't seem to work: dsc.begin();
delay(1000);
while(!dsc.keybusConnected && !dsc.loop()) delay(100); I'm using Wemos D1 Mini Pro, and it's not connected to the keybus (or anything other than the usb to my laptop to power it), but the above code simply proceeded past, so afterwards, I still don't have a valid dsc.status[] data. Update: this code works: for (int i = 0; i < 3*10; i++) { dsc.loop(); delay(100); }; |
Beta Was this translation helpful? Give feedback.
-
Hi, is it possible to find out how many partitions are actually in use? For example, my home alarm system only has/uses 1 partition. If this can be determined from code, I can skip broadcasting other partition status.
Beta Was this translation helpful? Give feedback.
All reactions