e-mcgee / paradox_platform

Paradox alarm homebridge platform
25 stars 6 forks source link

Assigning partitions #8

Closed jclendon closed 6 years ago

jclendon commented 6 years ago

Hi, Fantastic plugin! I have it working with my Paradox SP5500 with IP150. I have 2 partitions in my setup so it would be great if you could create more than one alarm instance with a partition variable in the config.json file so that you can you can control each partition individually. Thanks!

e-mcgee commented 6 years ago

Hi,

Thanks for feedback. This is the second request for multiple partition. I will try to add as soon as I have time.

deon-wentzel commented 6 years ago

I see in the index.js you have two partitions? What do we need to add in the config.json to recognize the 2nd partition?

if (partition == 0) { switch (state) { case "ARM" : message1 = CONTROLALARM_ARM_P0_MSG; break; case "DISARM" : message1 = CONTROLALARM_DISARM_P0_MSG; break; case "SLEEP" : message1 = CONTROLALARM_SLEEP_P0_MSG; break; case "STAY" : message1 = CONTROLALARM_STAY_P0_MSG; break; } } if (partition == 1) { switch (state) { case "ARM" : message1 = CONTROLALARM_ARM_P1_MSG; break; case "DISARM" : message1 = CONTROLALARM_DISARM_P1_MSG; break; case "SLEEP" : message1 = CONTROLALARM_SLEEP_P1_MSG; break; case "STAY" : message1 = CONTROLALARM_STAY_P1_MSG; break; } }

e-mcgee commented 6 years ago

At the moment the second partition is not yet implemented. In the code I have simply made provision for the different messages to send to the alarm. I need to add code to recognise the config of multiple partitions and also change the data structures to accommodate this.

e-mcgee commented 6 years ago

2 partitions now supported.

deon-wentzel commented 6 years ago

Hi,

Installed it and working great with both partitions, will keep you posted if I find any issues.

e-mcgee commented 6 years ago

Thanks