Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

homebridge-risco-platform

gawindx19ISC1.2.7

RiscoAlarm Plugin Platform for Homebridge

homebridge-plugin, homebridge-platform, platform, risco, alarm, homekit, homebridge, riscoCloud

readme

homebridge-risco-platform

Donate

This is plugin that integrate Homebridge with Risco Cloud Alarm Security System.

Integration works only when proper Ethernet module is added to your Risco Unit and you are able to arm & disarm your system via https://www.riscocloud.com/ELAS/WebUI.

When Polling option is enabled, Alarm state is refreshed in background, that means when you open HomeApp - there is no delay to display RiscoAlarm status. It's retreived from cached value.

Note:

From version 1.1.0, homebridge-risco-platform is a dynamic platform.

This change means that:

- The accessories created are cached to be reused after each restart of Homebridge

- A recharged accessory retains all its characteristics and remains associated with its scene or automation, so it is no longer necessary to reconfigure its automation as it was before

- When modifying the platform configuration, the accessories are modified accordingly (modification of type or deletion if no longer used)

- A deleted accessory must therefore be re-associated with its automations because it will have been deleted from the Homebridge accessories cache

Note:

Since version 1.1.3, you can Exclude (or bypass) a detector directly from HomeKit.

It can happen that the request takes a little too long to execute and, in this case, you may see an information appear in the Homebridge logs indicating that the accessory is taking too long to respond. Example:

The write handler for the characteristic 'On' on the accessory 'X' was slow to respond!*

This is not an issue but quite normal behavior.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-risco-platform
  3. Update your configuration file. See sample config.json snippet below.

Configuration

Configuration sample:

    "platforms": [
        {
            "platform": "RiscoAlarm",
            "name": "Home Alarm",
            "polling": true|false,
            "pollInterval": 10000,
            "riscoCloudDomainURL": "",
            "riscoUsername": "",                
            "riscoPassword": "",
            "riscoSiteId": 12345,
            "riscoPIN": "",
            "logRCResponse": true|false,
            "OccupancyPreventArming": true|false,
            "armCommand": "armed|partially|disarmed",
            "partialCommand": "armed|partially|disarmed",
            "homeCommand": "armed|partially|disarmed",
            "disarmCommand": "armed|partially|disarmed",
            "Partition": "all|none|system|0,1,2,....",
            "Groups": "all|none|0,1,2,....",
            "Outputs": "all|none|0,1,2,....",
            "Detectors": "all|none|0,1,2,....",
            "Custom": {
                "Door": "all|0,1,2,....",
                "Window": "all|0,1,2,....",
                "Contact Sensor": "all|0,1,2,...."
            },
            "Combined": {
                "Door": [
                    {"In": "X", "Out": "Y"}
                ],
                "Window": [
                    {"In": "X", "Out": "Y"}
                ],
                "GarageDoor": [
                    {"In": "X", "Out": "Y"}
                ]
            }
        }
    ]

Fields:

  • "platform" => Mandatory: Must always be "RiscoAlarm" (required)
  • "name" => Mandatory: Can be anything (used in logs)
  • "riscoUsername", "riscoPassword" => Mandatory: UserName and Password for you Web interface to RiscoCloud
  • "riscoSiteId" => Mandatory: This is your siteId to login.
  • "riscoPIN" => Mandatory: PIN Code used for arm/disarm
  • "OccupancyPreventArming" => Optional: true|false - if set to true, Full or Partial Arming cannot be done if Occupancy is detected (default to true),
  • "polling" => Optional: true|false - poll for latest RiscoCloud status (Default to false)
  • "pollInterval" => Optional: time in ms for polling (Default to 10000)

    The cumulative communication times between Homekit/RiscoCloud/Panel can go up to several seconds and a too short polling time can cause the appearance of spurious notifications during an arming / disarming request (phenomena not observed for other actions ). Therefore, it is not recommended to use a delay of less than 5 seconds. See issue relating to this phenomenon

  • "riscoCloudDomainURL" => Optional : (experimental) URL of the RiscoCloud used to connect. In some countries, this url is not www.riscolcoud.com (eg in China).

  • "logRCResponse"=> optional: true|false - This option adds the responses from RiscoCloud to the Homebridge logs. In the event of a processing error, activating this option provides more information for understanding the malfunction.

  • "armCommand": Override default value for arming (default to "armed"). Accept any of this value :

    • "armed" : set Partition/System to "armed"
    • "partially" : set Partition/System to "partially armed" (for example when you stay at home)
    • "disarmed" : set Partition/System to "disarmed" See Notes 1 and 2 below
  • "partialCommand": Override default value for arming (default to "armed"). Accepts the same values as for "armCommand".

  • "homeCommand": Override default value for arming (default to "armed"). Accepts the same values as for "armCommand".

  • "disarmCommand": Override default value for arming (default to "armed"). Accepts the same values as for "armCommand"

  • "Partition" => optional: accept the following options

    • "none": will not generate an accessory for partitions
    • "all": will generate an accessory for each partition
    • "system": will generate an accessory for global system
    • "0,1,...": will generate an accessory for each listed partition. Accepts a comma-separated list of string where each member is the id of a partition
  • "Groups" => optional: accept the following options

    • "none": will not generate an accessory for Groups
    • "all": will generate an accessory for each Group
    • "0,1,...": will generate an accessory for each listed Groups. Accepts a comma-separated list of string where each member is the id of a Group
  • "Outputs" => optional: accept the following options

    • "none": will not generate an accessory for Outputs
    • "all": will generate an accessory for each Output
    • "0,1,...": will generate an accessory for each listed Outputs. Accepts a comma-separated list of string where each member is the id of a Output
  • "Detectors" => optional: accept the following options

    • "none": will not generate an accessory for Detectors
    • "all": will generate an accessory for each Detector
    • "0,1,...": will generate an accessory for each listed Detectors. Accepts a comma-separated list of string where each member is the id of a Detector
  • "Custom" => optional: Addition of Custom function. accept the following options Allows you to modify the type of detector (no distinction between motion detector and another type of detector at the RiscoCloud interface)

    • "Door"=> optional: accept the following options
      • "all": will modify all Detector to Door Contact
      • "0,1,...": will modify a list of Detector to Door Contact. Accepts a comma-separated list of string where each member is the id of a Detector
    • "Window"=> optional: accept the following options
      • "all": will modify all Detector to Windows
      • "0,1,...": will modify a list of Detector to Windows. Accepts a comma-separated list of string where each member is the id of a Detector
    • "Contact Sensor"=> optional: accept the following options
      • "all": will modify all Detector to Contact Sensors.
      • "0,1,...": will modify a list of Detector to Contact Sensors. Accepts a comma-separated list of string where each member is the id of a Detector
    • "Vibrate Sensor"=> optional: accept the following options
      • "all": will modify all Detector to Vibrate Sensors.
      • "0,1,...": will modify a list of Detector to Vibrate Sensors. Accepts a comma-separated list of string where each member is the id of a Detector
  • "Combined" => optional: Addition of Combined Accessory. A combined accessory combines both an input and an output (for example, a magnetic contact on a garage door which can be opened / closed via an output of the Control Panel).

    It is important to note that if an input or an output is defined to be part of a Combined Accessory, they will be automatically removed from any other configuration and their old accessories will no longer be usable alone. For reasons of consistency, a bad configuration on a combined element will prevent it from being created.

    A Combined accessory accept the following options

    • "Door"=> Accepts an object list separated by commas chacuns containing an inlet and an outlet
    • "Window"=> Accepts an object list separated by commas chacuns containing an inlet and an outlet
    • "GarageDoor"=> Accepts an object list separated by commas chacuns containing an inlet and an outlet

      For each type of Combined Accessory, it is possible to define several accessories to be created. Exemple : "Door": [ {"In": "X1", "Out": "Y1"}, {"In": "X2", "Out": "Y2"}, {"In": "X3", "Out": "Y3"} ] Where X1, X2 and X3 are each different detector ID numbers and Y1, Y2 and Y3 are each different output ID numbers

Notes 1 :

Since groups can only have 2 states, whether armed or disarmed, the options "armCommand", "nightCommand" ,"homeCommand" and "disarmCommand" only apply to Partitions and system mode.

*Notes 2 : *

Given that the platform allows you to choose the partition(s) managed by HomeKit, the possibility of managing arming/night/home/disarming commands linked to a specific partition has not been implemented because this would be nonsense (specific command of the type: "1:armed "or" 1:disarmed ")

For the moment (v1.1.5), it is only possible to indicate if the real type of the detector is:

  • Door contact
  • Window contact
  • Contact Sensor
  • Vibrate Sensor (The Risco equipment only reports the alarm state of the vibration contact, the sensor is therefore managed as a movement sensor and its integration does not allow the recovery of additional information such as an accelerometer.)

If no accessory is generated, the system mode operation will be set by default.

How to Identify the ID of a Detector

Method 1 : You know the configuration of your system

In this case it is very simple. Just take the zone number and remove 1.

Example:

Zone 1 at Id 0
Zone 10 Id 9
Zone 32 at Id 31
etc ...

Method 2 : You do not know the configuration of your system.

In this case, you just have to restart homebridge and you will have access to this information. When the plugin is launched, the information is disseminated and can be read directly in the logs (in real time or via the web interface).

Locate the lines resembling these to directly obtain the Id to use in the config.json file:

Add Accessory => Add Detectors
Add Accessory => Configuration for Detectors Id : 0 and labeled "Batiment"
Add Accessory => Configuration for Detectors Id : 1 and labeled "Pte Garage"

How to get your riscoSiteId

To get your riscoSiteId, login to riscocloud via ChromeBrowser (first login screen), and before providing your PIN (second login page), display source of the page and find string: <div class="site-name" ... it will look like:

<div class="site-name" id="site_12345_div">

In that case "12345" is your siteId which should be placed in new config file.

TODO:

  • Add Cameras (Partially done but may not be usable)
  • Add the ability to define custom detector types - Partially made with the support of "Custom" detectors (water / fire / gas / CO2 / temperature threshold detector) as the risco hardware supports. This information does not go back in the REST API iRisco, it requires a manual addition (Also requires that the hardware configuration of the entry be considered as a detection area, otherwise the entry will not be accessible via the Risco APIs)

Donation

If you want to support this project or reward the work done, you can do so here:

paypal

changelog

Change Log

All notable changes to this project will be documented in this file.

1.2.7 (2021-21-03)

  • Added a new option to log RiscoCloud responses to improve resolution of response processing issues. This option is disabled by default. Warning: certain sensitive data can be displayed in these logs (IP address and password of cameras in particular).

1.2.6 (2021-20-03)

  • Addition of the possibility to define the url of the RiscoCloud (Experimental function and not assuming the version of the RiscoCloud available behind the given URL)

1.2.5 (2021-20-03)

  • Fixed a bad error code in the processing of responses to the second step of connecting to RiscoCloud
  • Added warning about too short polling time in README.md (Avoid using a polling time of less than 5 seconds).

1.2.4 (2021-14-03)

  • Fix axios version depedency (CVE-2020-28168)
  • Inversion of the state of the exclude switch to report only the state of exclusion and no longer the reverse (suggested by andyblac #38)
  • Fixed a bug preventing switching to 'system' mode when no accessory information is defined
  • Addition of specific information in the case of error 422 (bad site ID - related to issue #35)

1.2.3 (2020-06-12)

  • Fix an error on the occupancy sensor which generates an initialization error when no Detector is defined (#30 and #31)
  • Added a function to prevent Circular JSON definition error (#31). This error seems to be present when using a version of Homebridge = 1.1.6
  • Code improvement for handling network errors
  • Changed minimum values for homebridge and node.js in the npm definition

1.2.2 (2020-02-12)

  • Modifying _addOrConfigure function to avoid issue #30
  • Improvement of the Risco Cloud connection procedure in the event of a persistent network error

1.2.1 (2020-29-11)

  • Fix an error occured when no Detectors was configured

1.2.0 (2020-28-11)

  • Abandonment of the RiscoCloud web interface in favor of the iRisco REST API for the connection and recovery of system information. Benefits brought by this change:
    • Faster data processing.
    • Less data consumption.
    • Faster system status update (not always true for detector status).
    • The information necessary for future camera support is provided by the iRisco REST API
  • The code concerning the functionalities linked to the occupancy sensor has been revised and it is also possible to deactivate its operation via a new configuration option (OccupancyPreventArming). This option is enabled by default.
  • Additional information in the case of missing credentials preventing the initialization of the connection to RiscoCloud.
  • Additional information in the event of a connection error caused by the wrong identifier for connecting to RiscoCloud.
  • Correction of an error causing the appearance / disappearance of the 'Security System' accessory in System Partitions mode from one boot to another
  • Added functionality for combined elements (Door, Window and Garage Door are supported)
  • Improved management and error detection during http requests to RiscoCloud and the appearance of a 500 error.

  • Known issues:

    • The state of an accessory can sometimes take a second or two to set its final state (for example, in the case of arming a partition, the state can revert to 'deactivate' for a second or two before to take the final armed state. This problem does not prevent operation and will be corrected in a future version.
    • When you change the type of a combined accessory, it can sometimes happen that the icon becomes that of a switch. This problem is due to the fact that the exclusion function becomes the main Service. This problem does not affect the correct operation and a solution will be provided on a future update.

1.1.11 (2020-11-01)

  • Correction of an error during an alarm, the state of the system was sometimes incorrectly reported (system seen as disarmed) and could require an arming before being able to disarm (#1)
  • The json type debugs are now logged with an easily readable formatting (implementation of an indentation)
  • Following improved ES6 syntax support, correction of syntax error causing:
    • impossible to use outputs

1.1.10 (2020-10-31)

  • Following improved ES6 syntax support, correction of syntax error causing:
    • non-detection of groups
    • non-detection of outputs
    • the inability to arm or disarm the Partitions / Groups

1.1.9 (2020-10-30)

  • Correction of a problem related to the occupancy sensor in the case of not defining the detectors

1.1.8 (2020-10-30)

  • code cleaning
  • code improvements to ES6
  • Correction of a possible error when not defining a partition, groups, outputs or detector

1.1.7 (2020-10-24)

  • improvements and bugfixes
  • Fix Error in getPartsStates (#20 and #21)

1.1.6 (2020-10-20)

  • Fixed an error when restoring accessory (this error is caused by adding services to existing props created with an earlier version that did not include these features).

1.1.5 (2020-10-19)

  • Add smoke Sensor type
  • Add Vibrate Sensor
  • better management of adding / restoring accessories

1.1.4 (2020-10-18)

Not published

  • Addition of an occupancy sensor linked to the partitions / system to see at a glance if all the sensors are at rest.
  • Fixed an error when arming groups
  • Fixed an error when disarming a group.

1.1.3 (2020-10-16)

Not published

  • Improves error handling with Axios
  • Added the possibility to define custom commands for "home", "night", "absent" and "deactivated" mode.
  • Fixed incompatibility with Homebridge 1.3

1.1.0 (2020-08-14)

  • Migration of the plugin from a static platform to a dynamic platform.
  • Known errors:
    • when changing the type of detector (eg: movement sensor to door contact), the old service is not deleted but added.
    • the next time you load homebridge, it causes an error
    • some development log outputs will have to be deleted

1.0.8 (2020-06-28)

1.0.7 (2020-06-27)

1.0.6 (2020-06-26)

1.0.5 (2020-06-26)

1.0.4 (2020-06-25)

1.0.3 (2020-06-25)

1.0.2 (2020-06-24)

1.0.1 (2020-06-03)

1.0.0 (2020-06-03)

First Release