szlaskidaniel/homebridge-risco-alarm

Night Mode

allemattio opened this issue · 17 comments

Hi,
I was reading about homekit support for three states for alarm systems:

  • home
  • night
  • away

This plugin supports only away mode and home, right?
I'm a software developer and I have a Risco alarm, maybe I can help developing the night mode if it's not supported yet.

In my Risco app I have 3 states, disarmed, armed and "partial". It would be nice for the night command to enable the partial mode

possiamo sentirci su whastapp? poi finito possiamo rendere pubblico il lavoro.
mia email info@dvd24h.it

Ciao ragazzi, è possibile inserire una zona (da tastiera a muro ho le zone A, B, C, D). Come posso fare? Mi aiutate?

infatti... per me il night mode è solo la zona x...

Are you planning to do it ?

I have the same configuration 1 zone and a partial arming ...

It seems that the keyword is partially for risco, I can help if you need to !

I have already submitted a pull request to use the partially command for the night mode

Awesome,

While reading the code i saw the STAY_ARM state. It seems the the code arm the alarm when in that state. Is this correct ?

Thanks a lot !

Hi @allemattio , I've merged your changes into 1.26 v

Great!
Thank you so much

@szlaskidaniel I forgot to add the partialCommand to the readme, my bad!
Also in the readme it's not clear the instruction on how to retrieve the site ID, i found the soluzion by viewing the readme.rd as RAW, otherwise it's not clear

sorry but I really don't know how to config. I send you my iphone screenshot and my configuration
img_23b1ebc4a063-1

my config:

"accessories": [
{
"accessory": "RiscoAlarm",
"name": "RiscoAlarm",
"polling": true,
"pollInterval": 30000,
"riscoUsername": "XXX",
"riscoPassword": "XXX",
"riscoSiteId": XXXXX,
"riscoPIN": "XXX",
"armCommand": "armed",
"partialCommand": "partially",
"disarmCommand": "disarmed"
}
],

I want to set:
In casa: =DISARMED
Fuori casa: ARMED
Notte: PARTITION 1
Non attivo: DISARMED

ok I found a config that work partially

        "armCommand": "armed",
        "partialCommand": "0:armed",
        "disarmCommand": "disarmed"

but in my homekit app happeds:

at home -> [2018-10-15 23:17:39] [RiscoAlarm] Setting state to STAY_ARM
[2018-10-15 23:17:45] [RiscoAlarm] New Risco state set.
??????? it must disarm!! I am at home..... :)

Out home: disarm ok

NIGHT MODE: it arm only partition 1 ok.... but...
if it comes from away state.... ARMED.... it don't work...

NOT ACTIVE : DISARM

Hi, this is how change state from HomeKit works now:

switch (state) {
            case Characteristic.SecuritySystemTargetState.STAY_ARM:
                // stayArm = 0
                riscoArm = true;
                cmd = self.armCmd;
                break;
            case Characteristic.SecuritySystemTargetState.NIGHT_ARM:
                // stayArm = 2
                riscoArm = true;
                cmd = self.partialCommand;
                break;
            case Characteristic.SecuritySystemTargetState.AWAY_ARM:
                // stayArm = 1
                riscoArm = true;
                cmd = self.armCmd;
                break;
            case Characteristic.SecuritySystemTargetState.DISARM:
                // stayArm = 3
                riscoArm = false
                cmd = self.disarmCmd;
                break;
 };

As you can see, when you set STAY_ARM - it uses now FULL ARM command (armCommand).
Let me know how do you see above logic - that should work the most universal for everyone.
Like: STAY_ARM should do PartialArm command ? Or new config command ?

for me th first state (at home) must be DISARM... if I am at home I need to have alarm off... or I lose something?

True, but there will be no difference compared to "Disarmed". It is just un-usable with Risco configuration for me.
I'll publish new v 1.2.4 with above change. Maybe someone will use it in different associations.

YOU have some reasons, because apple homekit consider AT HOME as ARMED.
AND THIS IS A BUG FOR ME.

I think that for Apple "At Home" means to activate only some partitions.
i.e:

  • at home -> activate only outdoor sensors
  • away -> activate everything
  • night -> activate outdoor sensors and some indoor sensor
  • deactivated -> deactivate everything

Clearly this is not possible with this plugin as it uses Risco Web API and they don't easily allow that.
My edit allows to activate the partial command offered by Risco Web API for the Apple "Night" mode, maybe it's possible to modify the plugin to activate the partial command also in "At home" mode.

It's clear that for Apple "At Home" means "Activate Something" while the state in which the security system is off is "Deactivated"
So to me it's not wrong that this plugin activate the alarm when setting "At Home", to deactivate the security system just trigger the deactivated mode.

YOU HAVE reason 100%
and maybe this is the right configuration.