0.0.11 • Published 1 year ago

gardena-smart-system v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Gardena

npm

A nodejs package which allows communicating with the Gardena smart system API. Currently only supports mowers, but can easily be expanded to support others.

Install

npm i --save gardena-smart-system

Basic static example

Get a list of all devices including a snapshot of their state. Note: Make sure you don't do this too often because these calls are rate limited.

import GardenaConnection from 'gardena-smart-system';

const gardena = new GardenaConnection({ clientId: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const devices = await gardena.getDevices();

Realtime status of devices

import GardenaConnection from 'gardena-smart-system';

const gardena = new GardenaConnection({ clientId: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const devices = await gardena.getDevices();
const mower = devices[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 gardena.activateRealtimeUpdates();

Commanding a device

import GardenaConnection from 'gardena-smart-system';

const gardena = new GardenaConnection({ clientId: 'YOUR_APP_KEY', clientSecret:'YOUR_APP_SECRET' });
const devices = await gardena.getDevices();
const mower = devices[0];

await mower.resumeSchedule();
await mower.parkUntilFurtherNotice();
await mower.parkUntilNextTask();
await mower.startMowing(60); // 60 minutes
0.0.11

1 year ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago