npm install --save node-risco-client
Create a file config.json in your project directory.
{
"username": "YOUR_RISCO_EMAIL",
"password": "YOUR_RISCO_PASSWORD",
"pin": "YOUR_CENTRAL_PIN_CODE",
"languageId": "YOUR_LANGUAGE_ID" // example: en, it, de etc ...
}
Following are super simple examples to use riscoClient.
const riscoClient = require('node-risco-client')
const config = require('./config.json')
const main = async () => {
const client = riscoClient(config)
let partitions = await client.getPartitions()
console.log(partitions) // Print the partitions
}
main()
const riscoClient = require('node-risco-client')
const config = require('./config.json')
const main = async () => {
const client = riscoClient(config)
let zones = await client.getZones()
console.log(zones) // print the zones
}
main()
const riscoClient = require('node-risco-client')
const moment = require('moment');
const config = require('./config.json')
moment.locale(config.languageId);
const main = async () => {
const threeDaysAgo = moment().subtract(3, 'd')
let events = await client.getEvents(threeDaysAgo, 100)
console.log(events)
}
main()
const riscoClient = require('node-risco-client')
const config = require('./config.json')
const main = async () => {
const client = riscoClient(config)
let result = await client.arm()
console.log(result) // Print zones and partitions
}
main()
const riscoClient = require('node-risco-client')
const config = require('./config.json')
const main = async () => {
const client = riscoClient(config)
let result = await client.partiallyArm()
console.log(result) // Print zones and partitions
}
main()
const riscoClient = require('node-risco-client')
const config = require('./config.json')
const main = async () => {
const client = riscoClient(config)
let result = await client.disarm()
console.log(result) // Print zones and partitions
}
main()