automower-connect
v0.0.6
Published
A nodejs package which allows communicating with the Automower Connect API
Downloads
34
Maintainers
Readme
Automower-Connect
A nodejs package which allows communicating with the Automower Connect API.
Install
npm i --save automower-connect
Basic static example
Get a list of all mowers including a snapshot of their state. Note: Make sure you don't do this too often because these calls are rate limited.
import AutoMowerConnection from 'automower-connect';
const automower = new AutoMowerConnection({ apiKey: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const mowers = await automower.getMowers();
Realtime status of mowers
import AutoMowerConnection from 'automower-connect';
const automower = new AutoMowerConnection({ apiKey: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const mowers = await automower.getMowers();
const mower = mowers[0];
mower.onStartRealtimeUpdates(()=> {
console.log(`Websocket opened listening for updates for this device.`);
});
mower.onUpdate((updatedFields)=> {
console.log(`Received updates for these fields on this device: ${updatedFields}`);
});
await mower.activateRealtimeUpdates();
Commanding a device
import AutoMowerConnection from 'automower-connect';
const automower = new AutoMowerConnection({ apiKey: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const mowers = await automower.getMowers();
const mower = mowers[0];
await mower.pauseMower();
await mower.parkUntilFurtherNotice();
await mower.parkUntilNextSchedule();
await.mower.parkForDurationOfTime(30); // 30 minutes
await mower.resumeSchedule();
await mower.startMowing(60); // 60 minutes