Skip to content

jochamsa/automower-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automower-Connect

npm

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published