Description
- Satel Integra version: Satel Integra 64 running 1.18 2018-06-20, ETHM-1 Plus running 2.05
- Python version: 3.5.3
- Operating System: Hassbian
Unlock or find possibility to arm/disarm zones (partitions) other than the first one.
There is a mistake in Satel's documentation which probably implements mistakes in this script. There is often mistaken term partition with zone together with input. To understand it we have to know roughly an idea of Satel's architecture. The partition is user oriented and user unique, one can not have access to more than one partition. The zone is tied to parition only theoretically, to have a kind of hierarchy (especially when working with DLOADX). Every zone, partition, input have its own numbering, independent.
So, to the point. Every time we talk about zones regarding this script we really talk about inputs. Every time we talk about partitions - these are zones. Actually we do not need to know which partition or zone an input is tied to as we only check its state. The same sitiuation rules arming. That is the user who is tied to a partition and can arm/disarm only that zones/inputs which are inside it. So it is not true your script operates on one partition only.
So what we need to fix is to be able to arm/disarm more than one zone. When we send arm command (x80) the default behavior in mode=0 is to arm all zones and inputs inside it. But we have to point which zones there really are.
This is the command we send now:
\xfe\xfe\x80\x**\x**\x**\x**\xff\xff\xff\xff\x01\x00\x00\x00\x5f\xff\xfe\x0d
where x80 is the arm command in mode 0, x** [...] xff password (max 16 digits, no coding, decimal value, ff means unused), and the part \x01\x00\x00\x00 stands for the zones we have to arm/disarm This one points exactly to the first one.
int.from_bytes(b'\x01\x00\x00\x00', byteorder='little') equals 1
So correcting the Satel's manual - we talk here about zones not partitions. The key for choosing the zones is as follows:
4 bytes partition list:
- example from Satel's manual: arming zone 1,2 and 29 equals \x03\x00\x00\x10. Why? We have 4 bytes and 8 bits per byte, so Satel's idea was (1,2 and 29 - 32 total zones possible):
11000000 00000000 00000000 00001000
using bytorder 'little' we have:
00010000 00000000 00000000 00000011
what makes decimal value of (268435459).to_bytes(4, byteorder="little") = \x03\x00\x00\x10.
Command we send now:
\xfe\xfe\x80\x**\x**\x**\x**\xff\xff\xff\xff\x03\x00\x00\x10\x5f\xff\xfe\x0d
And it arms zones number 1,2 and 29.
For most popular, low zone numbers an example is: - zones 1,2,3,4:
00000000 00000000 00000000 00001111
makes dec 15 -> (15).to_bytes(4, byteorder="little")
and the command:
\xfe\xfe\x80\x**\x**\x**\x**\xff\xff\xff\xff\\x0f\x00\x00\x00\x5f\xff\xfe\x0d
arms/disarms zones 1,2,3 and 4. Checked.
So setting partition = 15 actually does the job for me ;).
@property
def _partition_bytes(self):
partition = 1 << self._partition_id - 1
return (15).to_bytes(4, 'little')
It might be a good idea to arm all zones by default, I have to check if that always works.