szlaskidaniel/homebridge-risco-alarm

Arm Command only sets Partition 0

tkboyle opened this issue · 11 comments

Do you think it will be possible to set multiple partitions on arm?
Would it be a case of using fiddler or Charlie to determine what is done in POST.

Happy to send some logging as arm would only set partition 0.

Hi, if you could provide logs from Chrome Browser - that would be helpful.
Open Developer Tools in Chrome, then switch to Network Tab (filter just XHR packets)
There are 1x GET and 1x POST that are interesting for us:

  1. GetPCState (send every 5 sec), 1 of 5 contain more details like (overview key)
  2. When you ARM your system, then this HTTP req is sent:
    https://www.riscocloud.com/ELAS/WebUI/Security/ArmDisarm
  • we need to see what is inside this POST.
    In my system (1 partition) I've got:

"targetType = "0:armed"; , in your situation - I guess there could be multiple values? We need to check that.

Thx,
Daniel

Hi Daniel,

It looks like this.
{partInfo: {armedStr: "0 Partitions ", disarmedStr: "3 Partitions ", partarmedStr: "0 Partitions "},…}

The target type's looks like this 0:armed 1:armed 2:armed

There are two things that I can't determine here. From the WebUI you can only enable partitions manually one by one, whereas on mobile app (IOS) you can arm all partitions at once and disarms at once. If you are interested in this I will need to intercept the traffic. Something I will need to do when no one is inside.

Hi,

The issue is that we cannot select from HomeKit, which partitions you want to arm...
The easiest approach that I see here is to leave as it is for checking current state, is at least 1 is armed -> then we report this to HomeKit as "Away". When we've got 0 in an armed section -> Home.

For turn ON alarm, I believe that the best would be put inside the config the whole string that should be passed during "arm" situation. By default it will be "0:armed", but for people that could have more than 1 partition / or want to control only specific one, they could define there different string like: "0:armed 2:armed". The same approach for "disarm" section.

I'll give it a go and modify the code. Does it need comma (,) when passing the string?
0:armed,1:armed,2:armed ?

I believe it will be without commas, just spaces. That's why I've asked you to verify that in POST which is sent to arm/disarm system.

@tkboyle please download the latest version and test.
It works for me (but I use only 1 partition).

Hi Daniel,

Works for single partitions for me too. Just the syntax on how multiple string should be passed.
Spaces, commas, semicolon and %20 = did not work.

edit : seems by clicking the red padlock on the WebUI arms all partitions. I'll need to try this again and see what inside POST. I'll get back to you tomorrow when no one is around.

Hi Daniel,
The target type is just "armed" or "disarmed" This arms/disarms all partitions in one go.

Hi - so you say, that it is enough to set it without specifying partition number, only all armed or disarmed?
That's good. I'll leave this options in params in case some users want to arm/disarm only 1 partition.

"armed" or "disarmed" will do all partitions. It works for me.

The only other variable left to discover is what is called "partial". This is a collection of sensors to create safe zones.

This depends on whether the installer defined these at time of installation.

Ok. Many thanks for help here & troubleshoot.
I'll leave it as it is - just update Readme file for instructions.