Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
Florian Mollin edited this page Dec 10, 2017 · 5 revisions

Introduction

The goal of this documentation is to show a global overview of the API usage. For more details, please consult the javadoc.

To use this API, your device must be in "development mode" (use the Yeelight application for that).

Yapi is based on Yeelight Inter-Operation Specification.

Usage

Constructor

First of all, you need to instantiate your device with the following parameters:

  • Device IP
  • Device port (default is 55443)
  • Effect between two commands
    • Effect type (SMOOTH or SUDDEN, default is SUDDEN)
    • Effect duration in milliseconds (default is 0)

Here is an example:

String ip = "192.168.1.47";
int port = 55443;
YeelightEffect effectType = YeelightEffect.SMOOTH;
int effectDuration = 500;
// Constructor call
YeelightDevice device = new YeelightDevice(ip, port, effectType, effectDuration);

Commands

Here is an example of some command calls:

YeelightDevice device = new YeelightDevice("192.168.1.47");
// Get map of all device properties (YeelightProperty -> String)
device.getProperties();
// Change the device color temperature
device.setColorTemperature(4200);
// Change the device color
device.setRGB(255, 126, 0);
// Change hue and sat of the device
device.setHSV(200, 50);
// Change the device brightness
device.setBrightness(75);
// Switch the device power
device.setPower(true);
// Toggle the device power
device.toggle();
// Save current state of the device as 'default'
device.setDefault();
// Start a flow
device.startFlow(myFlow);
// Stop a flow
device.stopFlow();
// Start a power off device timer
device.addCron(2);
// Retrieve delay of current power off timer
device.getCronDelay();
// Remove/stop current power off timer
device.deleteCron();
// Adjust a property
device.setAdjust(YeelightAdjustProperty.BRIGHTNESS, YeelightAdjustAction.INCREASE);
// Name the device
device.setName("MyYeelightDevice");

Flows

In progress...

Exceptions

In progress...

External libraries

In progress...

Clone this wiki locally