Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ptz0n/node-verisure
A module for reading and changing status of Verisure devices.
https://github.com/ptz0n/node-verisure
node verisure
Last synced: 2 months ago
JSON representation
A module for reading and changing status of Verisure devices.
- Host: GitHub
- URL: https://github.com/ptz0n/node-verisure
- Owner: ptz0n
- License: mit
- Created: 2016-12-10T13:13:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T18:11:49.000Z (12 months ago)
- Last Synced: 2024-10-16T09:34:01.413Z (2 months ago)
- Topics: node, verisure
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/verisure
- Size: 187 KB
- Stars: 24
- Watchers: 7
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# node-verisure
[![](https://badges.greenkeeper.io/ptz0n/node-verisure.svg)](https://greenkeeper.io/)
[![GitHub Actions badge](https://github.com/ptz0n/node-verisure/workflows/Test/badge.svg)](https://github.com/ptz0n/node-verisure/actions?query=workflow%3ATest)
A module for reading and changing status of Verisure devices.
### Legal Disclaimer
This software is not affiliated with Verisure Holding AB and the developers take no legal responsibility for the functionality or security of your alarms and devices.
### Installation
```bash
$ npm install verisure --save
```### Usage
```javascript
const Verisure = require('verisure');const verisure = new Verisure('[email protected]', 'mysecretpassword');
verisure.getToken()
.then(() => verisure.getInstallations())
.then((installations) => installations[0].client({
operationName: 'Broadband',
query: `query Broadband($giid: String!) {
installation(giid: $giid) {
broadband {
testDate
isBroadbandConnected
__typename
}
__typename
}
}`,
}))
.then((broadband) => {
console.log('BROADBAND:', broadband);
})
.catch((error) => {
console.error(error);
});
```### Multi-factor authentication
For users with MFA enabled, you need to invoke `getToken` twice. First without arguments, second with the one-time code.
```javascript
const verisure = new Verisure(email, password);await verisure.getToken();
console.log('One-time code sent.');
await verisure.getToken(code);
console.log(verisure.cookies);
```Once you retrieve the cookies, these can be used to make authenticated requests.
```javascript
const verisure = new Verisure('[email protected]', null, [
'vid=myTopSecretToken',
'vs-access=myAccessToken',
'vs-refresh=myRefreshToken'
]);const installations = await verisure.getInstallations();
```