@chrisns/visonic_v8

[![Coverage Status](https://coveralls.io/repos/github/chrisns/visonic_v8/badge.svg?branch=master)](https://coveralls.io/github/chrisns/visonic_v8?branch=master) ![ci](https://github.com/chrisns/visonic_v8/workflows/ci/badge.svg) [![MIT Licence](https://ba

Usage no npm install needed!

<script type="module">
  import chrisnsVisonicV8 from 'https://cdn.skypack.dev/@chrisns/visonic_v8';
</script>

README

Visonic powermanage v8.0 API compatible client

Coverage Status ci MIT Licence Total alerts Language grade: JavaScript

The v8 api is noticeably different in that it requires email/password auth in addition to the user's pin

Written in typescript for your development pleasure :)

Supported features

  • authentication
  • get status of panel
  • get current alarms
  • get current troubles
  • get current alerts
  • get panel info
  • get event history
  • get wake up sms string
  • get devices
  • get status on a process change
  • get all locations
  • set the state (disarm/home/away)

Nice to have features

If you'd like to raise a PR? :)

  • trigger cameras to take pictures
  • collect pictures from cameras
  • user management

Example Usage

index.ts

import * as alarm from '@chrisns/visonic_v8'
const { hostname, app_id, user_code, panel_id, email, password } = process.env

const run = async () => {
  const authenticatedAxios = await alarm.getAuthenticatedAxios({
    hostname,
    app_id,
    user_code,
    user_token: null,
    panel_id,
    email,
    password
  })
  const status = await alarm.getStatus(authenticatedAxios)
  console.log(status)
}
try {
  run()
} catch (error) {
  console.error(error)
}

Shell

npm i --save @chrisns/visonic_v8 typescript
ts-node index.ts

Response

{
  connected: false,
  connected_status: {
    bba: {
      is_connected: false,
      state: 'online'
    },
    gprs: {
      is_connected: false,
      state: 'online'
    }
  },
  discovery: {
    completed: true,
    stages: 10,
    in_queue: 0,
    triggered: null
  },
  partitions: [ {
    id: -1,
    state: 'DISARM',
    status: '',
    ready: true,
    options: []
  } ],
  rssi: {
    level: 'ok',
    network: 'Unknown'
  }
}

References