Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noelportugal/wyze-node
An un-official API wrapper for Wyze products
https://github.com/noelportugal/wyze-node
api javascript node sense sensors wyze wyzeapi wyzecam
Last synced: 8 days ago
JSON representation
An un-official API wrapper for Wyze products
- Host: GitHub
- URL: https://github.com/noelportugal/wyze-node
- Owner: noelportugal
- Created: 2019-05-20T01:58:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-04T13:00:14.000Z (9 months ago)
- Last Synced: 2024-10-02T11:46:50.655Z (about 1 month ago)
- Topics: api, javascript, node, sense, sensors, wyze, wyzeapi, wyzecam
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 173
- Watchers: 21
- Forks: 22
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - noelportugal/wyze-node - An un-official API wrapper for Wyze products (JavaScript)
README
# wyze-node
This is an unofficial Wyze API. This library uses the internal APIs from the Wyze mobile app. A list of all Wyze devices can be retrieved to check the status of Wyze Cameras, Wyze Sense, Wyze Bulbs, Wyze Plugs and possibly Wyze locks (untested). This API can turn on and off cameras, lightbulbs and smart plugs.## Setup
`npm install wyze-node --save`## Example
```
const Wyze = require('wyze-node')const options = {
username: process.env.username,
password: process.env.password
}
const wyze = new Wyze(options); (async () => {
let device, state, result// Get all Wyze devices
const devices = await wyze.getDeviceList()
console.log(devices)// Get a Wyze Bulb by name and turn it off.
device = await wyze.getDeviceByName('Porch Light')
result = await wyze.turnOff(device)
console.log(result)// Get the state of a Wyze Sense contact sensor
device = await wyze.getDeviceByName('Front Door')
state = await wyze.getDeviceState(device)
console.log(`${device.nickname} is ${state}`)})()
```## Run
`[email protected] password=123456 node index.js`## Helper methods
Use this helper methods to interact with wyze-node.
- wyze.getDeviceList()
- wyze.getDeviceByName(nickname)
- wyze.getDeviceByMac(mac)
- wyze.getDevicesByType(type)
- wyze.getDevicesByModel(model)
- wyze.getDeviceGroupsList()
- wyze.getDeviceSortList()
- wyze.turnOn(device)
- wyze.turnOff(device)
- wyze.getDeviceStatus(device)
- wyze.getDeviceState(device)## Internal methods
- wyze.login()
- wyze.getRefreshToken()
- wyze.getObjectList()
- wyze.runAction(instanceId, providerKey, actionKey)
- wyze.getDeviceInfo(deviceMac, deviceModel)
- wyze.getPropertyList(deviceMac, deviceModel)
- wyze.setProperty(deviceMac, deviceModel, propertyId, propertyValue)