Noah's Pairwise Manifest

    homebridge-zipabox-accessory

    0.13.65 • Public • Published

    This is a Plugin for Homebridge link to the ZipaBox. It is just published to test on local access to a ZipaBox (Zipato TM) through the API possibilities.

    It's based on many different plugin example that you can find by searching "homebridge-plugin" in all Git repository

    The approach is to add multiple accessory and get the base information and action through API request.

    The plugin will be adapted to a Platform after programming all the accessory separately (see development route below).

    The plugin didn't use the Zipato API Node.js Implementation (no success after a few try) like the homebridge-zipato plugin. The actual plugin is an alternative with direct connection to Zipato API.

    I didn't work with javascript since a few years, so please be comprehensive.

    Development route

    1. NPM diffusion
      • create structure of package - DONE
      • diffuse, pack and clear the command - DONE
      • install using homebridge-Congig UI X from oznu - DONE
      • prepare the test environnement - DONE
      • validate the Readme.md
    2. index.js - Accessory - Baseline
      • prepare the structure of index.js for accessory
      • test and validate structure of index.js
      • try to connect with Node.js library for the official Zipato REST API
      • add connection to local API of Zipabox
      • code the simple Switch function for power manager > Version 0.1.x
      • validate code of version 0.1.x
      • Manage missing online
    3. index.js - Accessory - Light >> Version 0.2.x
      • Add config for Accessory Type + light (default is switch)
      • Try to transform the switch with a lamp
      • have two accessory connected
      • Add force refresh function
    4. index.js - Accessory - Outlet >> Version 0.3.x
      • Transform to just add Characteristic
    5. index.js - Accessory - Temperature > Version 0.4.x
      • First Sensor implementation
      • StatusLowBattery
    6. index.js - Accessory - Luminance = Light Sensor > Version 0.5.x
      • Add Light Sensor
    7. index.js - Accessory - Motion > Version 0.6.x
      • Add Motion Sensor
      • Add reverse parameter
      • Add noStatus parameter
      • Adapt timePolling method to other sensor
    8. index.js - Accessory - Contact Sensor > Version 0.7.x
      • Add Contact sensor
    9. index.js - Accessory - Window > Version 0.8.x
      • Add Window State value > in fact that a sensor with a window logo...
    10. index.js - Accessory - Door > Version 0.9.x
      • Add Door based on the window implementation
      • Auto get status if put (like window)
    11. index.js - Accessory - Leak > Version 0.10.x
      • Add leak sensor and test with testValue
    12. index.js - Accessory - Battery > Version 0.11.x
      • Implemented the battery option
      • Add a double service on one accessory
    13. index.js - Accessory - CO Sensor > Version 0.12.x
      • Add CO SENSOR
    14. index.js - Accessory - Alarm = Security System > Version 0.13.x
      • Clear the API request to have status > /alarm/partitions/{partition}/attributes
      • Find the API Put to change Alarm state > ???
      • Add the method to secure Init and Login for Alarm
      • Test the connection method without Status check > force with test Value
      • Add Async method to connect on Security system
      • Add resync if missing connection > need test
      • Add Async method to get System status
      • Add method to set the mode
      • Manage return if No connection successfull > StatusFault
      • Add (or no) the SecuritySystemAlarmType > no need for it
      • Add possibility to select Night mode in place of Away mode > Zipato = silent alarm
      • Check first status at startup
    15. index.js - Adapt to platform ? >> Version 1.x

    Further To-do List

    • Add Table to parameter of plugin
    • Complete table of parameter
    • Add a DEBUG mode
    • Check if needed to @ in %40 > no need
    • Replace the Request with Fetch (use of Promise)
    • Handle reconnection after auto disconnection
    • Change the refresh rate for each Accessory
    • Explain how to find the UUID
    • Change the name of the package
    • Correction about "success" if not after connection retry
    • Add a fake switch to reboot the box ?
    • Force an online method with the use of StatusFault
    • Rewrite the parameter order to have something more clear and logic (sub division?)
    • Make a function with reconnect method
    • Bind with a graph viewer (like fakegato)
    • Config to force a device UUID (need ?)
    • Status active for sensor ?
    • Check lux scale if correct
    • Defense prog if batteryLevel requested without battery available ?
    • Get name with name device ? > first test no concluded > do we need ?
    • Adapt to non local access > if requested
    • Adapt from accessory to platform > check if need (actual multiple connection)
    • Implementation of Outlet In Use Status > if needed
    • Add Smoke Sensor > if needed
    • Manage possibility to have night mode with an alarm

    Not Implemented Accessory (cause I'm not using them)

    • Doorbell
    • Dioxide Sensor
    • Smoke Sensor

    Config Examples

    Simple example

    "accessories": [
            {
              "accessory": "ZipaAccessory",
              "type": "switch",
              "name": "MyZipaSwitch",
              "USERNAME": "yourUserName",
              "PASSWORD": "yourPassword",
              "server_ip": "192.168.0.0",
              "uuid": "123456789",
              "refresh": 10
            }
    ]

    Full example

    "accessories": [
            {
              "accessory": "ZipaAccessory",
              "type": "switch",
              "name": "MyZipaSwitch",
              "USERNAME": "yourUserName",
              "PASSWORD": "yourPassword",
              "server_ip": "192.168.0.0",
              "uuid": "123456789",
              "uuidB": "001256",
              "manufacturer": "mySwitchManufacturer",
              "model": "mySwitchModel",
              "serial": "mySwitchSerial",
              "debug": true,
              "refresh": 5,
              "noStatus": true,
              "reverse": true,
              "batteryLimit": 15
            }
    ]

    Parameters information

    Parameter Remarks
    accessory MUST be ZipaAccessory, will say at Homebridge to use the good plugin
    type Select the Accessory Type. switch (default) -others see below-
    name Name of your plugin, will be displayed in HomeKit (muss be unique)
    USERNAME Username use to connect to my.zipato.com
    PASSWORD Password use to connect to my.zipato.com > never publish your Config
    with this infos
    server_ip Local ip of your Box : format 192.168.0.1 - do not add http or port
    uuid uuid of your devices Switch (see Below)
    uuidB (Optional) Specify a second uuid for a service with two implemented
    Characteristic - see below -
    manufacturer Manufacturer of your device. No more use than info in HomeKit
    model Model of your device. No more use than info in HomeKit
    serial Serial number of your device. No more use than info in HomeKit
    debug (Optional) If true the console will display tests informations
    refresh (Optional) Time for forced refresh of the status (in seconds)
    (see Remarks)
    batteryLimit (Optional) Level (in percent 1 to 100) to launch the BatteryLow
    Status - 0 in default (inactive)
    noStatus (Optional) = true if no Status (is connected) option is available for
    the device - false in default - see below-
    reverse (Optional) = true if the boolean signal of the sensor need to be
    reversed - see below
    pin (Optional) : your Pin in Zipato Board to arm or disarm alarm.
    nightMode (Optional) : Select Home or Night for Security system

    List of implemented function

    Device type Methods
    Switch (default) switch Get Status - Set On - Set Off - Unavailable
    Light Bulb light Get Status - Set On - Set Off - Unavailable
    Outlet outlet Get Status - Set On - Set Off - Unavailable
    Temperature Sensor temperature Get Value - Battery Low Status - Unavailable
    Light Sensor ambient Get Value - Battery Low Status - Unavailable
    Motion Sensor motion Get Value - Battery Low Status - Unavailable
    Contact Sensor contact Get Value - Battery Low Status - Unavailable
    Window window Current Position (0 or 100 %) - Unavailable
    Door door Current Position (0 or 100 %) - Unavailable
    Leak Sensor leak Get Value - Battery Low Status - Unavailable
    Battery battery Battery Level - Status - Unavailable
    Carbon Monoxide co Carbon Detected - Battery Low Status - Unavailable
    Security System alarm Get Value - Set Value - Not ready - Night or Home

    Remarks

    UUID of Accessory

    The UUID need to be the "STATE" UUID of your Zwave Device (the lowest structure level). To be sure you can try with the Zipato API to use this UUID as parameter for attributes request. The Device UUID is find automatically by the plugin if noStatus is not specified.

    Window and Doors

    The plugin only get the status open or closed for door and window. It's like a contact sensor but with an other icon. If the user click on the button in HomeKit, the plugin will force the get position method.

    uuidB - Second Characteristic for implemented Services

    For some Accessory, two UUID are necessary to get all the needed Information.

    Accessory uuid uuidB
    Battery BatteryLevel ChargingStage

    Reverse a value

    Some sensor work inverted as HomeKit expect. Example : a motion sensor return true if no motion are detected. If you can't change your sensor return value in his configuration or Zipato configuration, you can add the "reverse = true" parameter to reverse the returned value. Work for all "get" for attributes. This option if fixed to false by the plugin for an alarm type.

    Device Status Unavailable

    In case of unavailable device status you can add the parameter "noStatus": true to ask the plugin to not check the availability of the device. This can happen for wired device to the box (security module). It can help if your Status UUID have no Parent device with a "status" option. This option is fixed to true by the plugin for an alarm type.

    Refresh Rate

    HomeKit update the status of your device when you reopen the Home APP. If you want to force a refresh you can use the optional parameter "refresh". You do not need this to keep the connection to the Box. The plugin will reconnect if need after a long time without connection.

    Alarm - Security system

    Alarm configuration

    To configure an alarm, you must specify the UUID of the partition that you want to follow (not the device or sensor). Also the pin of the user logged in ist necessary to permit access to change the alarm (see next point).

    Pin missing for Alarm

    In case of missing PIN parameter for a Alarm accessory, the plugin send a log warning, change the type to "switch" and add an info in the name.

    Select night or home status

    Homekit can return "Night" status or "Home" status for an "Perimeter only alarm". Zipato can only have one of the both. To choose if the homebridge should return Night or Home, the user has to select nightMode = true if the system has to return Night. Home mode is selected has default.

    Install

    npm i homebridge-zipabox-accessory

    DownloadsWeekly Downloads

    3

    Version

    0.13.65

    License

    MIT

    Unpacked Size

    65.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • gusmuche