automower-connect-sdk
v1.1.0
Published
Husqvarna Automower Connect SDK
Maintainers
Readme
automower-connect-sdk (Unofficial)
This package provides a TypeScript/JavaScript SDK for the Husqvarna Automower Connect API.
⚠️ Disclaimer ⚠️ This SDK is not an official Husqvarna product. It is an open-source community project, built on top of the public API documented by Husqvarna. It's generated from the OpenAPI specification provided by Husqvarna with OpenAPI Generator.
Users of this SDK must :
- Create their own API key and OAuth2 credentials on the Husqvarna Developer Portal.
- Follow the official API Terms of Use.
Requirements
You need to install husqvarna-authentication-sdk for authentication and getting an access token.
Installation
To install the package, run one of the following commands in your project folder :
NPM :
npm install automower-connect-sdkPNPM :
pnpm add automower-connect-sdkYarn :
yarn add automower-connect-sdkUsage
Import the package in your TypeScript or JavaScript code :
import { Configuration, MowerApi } from 'automower-connect-sdk';
const apiAuth = new MowerApi();
const apiMower = new MowerApi(
new Configuration({
apiKey: <Your API Key>,
baseOptions: {
headers: {
'Authorization-Provider': 'husqvarna',
Authorization: `Bearer ${<Access Token generated with husqvarna-authentication-sdk package>}`
}
}
})
);
const mowers = await apiMower.mowersGet();
const mowerId = mowers.data?.data?.at(0)?.id;
console.info('Mower ID :', mowerId);
if (mowerId) {
const mower = await apiMower.mowersIdGet({
id: mowerId
});
console.info('State of the mower :', mower.data.data?.attributes?.mower.state);
}Documentation
The full API documentation is available on the Husqvarna Developer Portal.
Documentation for API Endpoints
All URIs are relative to https://api.amc.husqvarna.dev/v1
| Class | Method | HTTP request | Description | | ------------ | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------- | | ActionsApi | mowersIdActionsPost | POST /mowers/{id}/actions | Accepts actions to control a mower linked to a user. | | ActionsApi | mowersIdCalendarPost | POST /mowers/{id}/calendar | Update the calendar on the mower. | | ActionsApi | mowersIdErrorsConfirmPost | POST /mowers/{id}/errors/confirm | Confirm current error. | | ActionsApi | mowersIdSettingsPost | POST /mowers/{id}/settings | Update the settings on the mower. | | ActionsApi | mowersIdStatisticsResetCuttingBladeUsageTimePost | POST /mowers/{id}/statistics/resetCuttingBladeUsageTime | Reset the cutting blade usage time. | | ActionsApi | mowersIdStayOutZonesStayOutIdPatch | PATCH /mowers/{id}/stayOutZones/{stayOutId} | Enable or disable the stay-out zone. | | ActionsApi | mowersIdWorkAreasWorkAreaIdCalendarPost | POST /mowers/{id}/workAreas/{workAreaId}/calendar | Update the calendar for a work area on the mower. | | ActionsApi | mowersIdWorkAreasWorkAreaIdPatch | PATCH /mowers/{id}/workAreas/{workAreaId} | Update the the work area on the mower. | | MowerApi | mowersGet | GET /mowers | List data for all mowers linked to a user. | | MowerApi | mowersIdGet | GET /mowers/{id} | Get data for a mower linked to a user. | | MowerApi | mowersIdMessagesGet | GET /mowers/{id}/messages | Get last messages for a mower. | | MowerApi | mowersIdStayOutZonesGet | GET /mowers/{id}/stayOutZones | Get all stay out zones for a mower linked to a user. | | MowerApi | mowersIdWorkAreasGet | GET /mowers/{id}/workAreas | Get all detailed work areas for a mower linked to a user. | | MowerApi | mowersIdWorkAreasWorkAreaIdGet | GET /mowers/{id}/workAreas/{workAreaId} | Get detailed data for a work area for a mower linked to a user. |
Documentation For Models
- Battery
- Calendar
- CalendarTask
- CalendarTaskWorkArea
- CalendarWorkArea
- Capabilities
- CuttingHeight
- DurationAttributes
- Headlight
- HeadlightHeadlight
- JsonApiAction
- JsonApiData
- JsonApiDataCommandResult
- JsonApiDataDocument
- JsonApiDataDocumentCommandResult
- JsonApiDataDocumentListCommandResult
- JsonApiDataDocumentMessages
- JsonApiDataDocumentStayOutZones
- JsonApiDataDocumentWorkArea
- JsonApiDataListDocument
- JsonApiDataListDocumentWorkAreas
- JsonApiDataMessages
- JsonApiDataStayOutZones
- JsonApiDataWorkArea
- JsonApiError
- JsonApiErrorDocument
- Message
- Messages
- Metadata
- MowerApp
- MowerData
- MowersIdActionsPostRequest
- MowersIdActionsPostRequestData
- MowersIdCalendarPostRequest
- MowersIdCalendarPostRequestData
- MowersIdCalendarPostRequestDataAttributes
- MowersIdSettingsPostRequest
- MowersIdSettingsPostRequestData
- MowersIdSettingsPostRequestDataAttributes
- MowersIdStayOutZonesStayOutIdPatchRequest
- MowersIdStayOutZonesStayOutIdPatchRequestData
- MowersIdStayOutZonesStayOutIdPatchRequestDataAttributes
- MowersIdWorkAreasWorkAreaIdCalendarPostRequest
- MowersIdWorkAreasWorkAreaIdCalendarPostRequestData
- MowersIdWorkAreasWorkAreaIdCalendarPostRequestDataAttributes
- MowersIdWorkAreasWorkAreaIdPatchRequest
- MowersIdWorkAreasWorkAreaIdPatchRequestData
- MowersIdWorkAreasWorkAreaIdPatchRequestDataAttributes
- Park
- ParkUntilFurtherNotice
- ParkUntilNextSchedule
- Pause
- Planner
- PlannerOverride
- Position
- ResumeSchedule
- Settings
- Start
- StartInWorkArea
- Statistics
- StayOutZone
- StayOutZones
- System
- Timer
- WorkArea
- WorkAreaAttributes
- WorkAreaData
Documentation For Authorization
Authentication schemes defined for the API:
APIKeyHeader
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header
Token
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Provider
- Type: API key
- API key parameter name: Authorization-Provider
- Location: HTTP header
