This package is based on Dav Glass' doorbot package. However, instead of dealing with Ring's excellent line of video doorbells and spotlights, this package deals with Ring's alarm station.
npm install ring-alarm
const ring = RingAPI({
email: '[email protected]'
password: 'secret'
});
// get list of stations associated with the account
ring.stations((err, stations) => {
if (err) ...;
stations.forEach((station) => {
// get devices associated with each station
ring.getAlarmDevices(station, (err, station, message) => {
if (err) ...;
message.body.forEach((device) => {
// get properties associated with each device
...
});
});
// register for DataUpdate messages
ring.setAlarmCallback(station, 'DataUpdate', (err, station, message) => {
if (err) ...;
...
});
// set alarm mode
// panelId: `zid` property of security-panel device
// mode: 'all', 'some', 'none'
// bypassSensorIs: an array of `zid` properties of sensor.* devices
ring.setAlarmMode(station, panelId, mode, bypassSensorIds, (err, station, message) => {
if (err) ...;
...
});
// done getting information about station
ring.closeAlarmCollection(station);
});
});
Many thanks to davglass author of doorbot.
Many thanks (also) to joeyberkovitz who submitted a PR to the doorbot repository.