2.0.6 • Published 3 years ago

wyze-node v2.0.6

Weekly downloads
62
License
ISC
Repository
-
Last release
3 years ago

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 cameraas, 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

username=first.last@email.om 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)
2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago