https://github.com/ptz0n/node-daikin-onecta
Daikin ONECTA API module for Node.js
https://github.com/ptz0n/node-daikin-onecta
daikin heatpump onecta
Last synced: 4 months ago
JSON representation
Daikin ONECTA API module for Node.js
- Host: GitHub
- URL: https://github.com/ptz0n/node-daikin-onecta
- Owner: ptz0n
- Created: 2024-09-28T05:39:12.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-19T09:13:00.000Z (6 months ago)
- Last Synced: 2024-12-06T17:48:12.000Z (5 months ago)
- Topics: daikin, heatpump, onecta
- Language: JavaScript
- Homepage: https://daikin.erikeng.se
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# daikin-onecta
This zero-dependency Node.js module integrates with the Daikin Onecta API for controlling internet-connected heat pumps. It handles OAuth2 authentication, token refreshing, and provides access to key API features like retrieving user info, managing sites, and controlling gateway devices, with automatic token refresh for seamless API access.
Official docs: https://developer.cloud.daikineurope.com/
## Legal Disclaimer
This software is not affiliated with Daikin Europe N.V. and the developers take no legal responsibility for the functionality or security of your devices.
## Installation
```bash
$ npm install daikin-onecta --save
```## Usage
```javascript
import { getToken } from 'daikin-onecta';const secrets = {
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
redirect_uri: 'YOUR_REDIRECT_URI',
};const token = await getToken({ secrets, code: 'GENERATED_AUTH_CODE' });
const { data, refreshedToken } = await getGatewayDevices({ secrets, token });
console.log(data);
``````json
[
{
"_id": "c07294f3-1202-41dd-a139-f5a466e6264e",
"deviceModel": "Altherma",
"embeddedId": "29300444-4258-4938-84aa-0296c100e13f",
"id": "c07294f3-1202-41dd-a139-f5a466e6264e",
"type": "heating",
"isCloudConnectionUp": {
"value": true,
"settable": false
},
"timestamp": "2024-10-13T20:20:39.000Z",
"managementPoints": […]
}
]
```