https://github.com/itskenny0/yeelight-php
Tiny, dynamic class to control Yeelight WiFi bulbs
https://github.com/itskenny0/yeelight-php
php smarthome xiaomi yeelight
Last synced: 4 days ago
JSON representation
Tiny, dynamic class to control Yeelight WiFi bulbs
- Host: GitHub
- URL: https://github.com/itskenny0/yeelight-php
- Owner: itskenny0
- License: unlicense
- Created: 2017-06-15T20:24:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-01T12:45:12.000Z (over 7 years ago)
- Last Synced: 2024-05-03T06:10:34.991Z (about 2 years ago)
- Topics: php, smarthome, xiaomi, yeelight
- Language: PHP
- Size: 1.95 KB
- Stars: 24
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: readme.txt
- License: LICENSE
Awesome Lists containing this project
README
-> Yeelight-PHP <-
This is a tiny class to facilitate controlling the Yeelight WiFi bulbs by Xiaomi in PHP.
Function names are dynamic and respond to the API endpoints found in the Xiaomi docs:
https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf
No Composer or other crap - keep it minimal.
This script has no external dependencies other than some PHP 5.x version and the sockets extension.
Usage:
set_power("on"); // power on
$yee->set_rgb(0xFF0000); // color to red
$yee->set_bright(50); // brightness to 50%
$yee->commit(); // changes are not sent to the bulb before commit() is called
sleep(10);
$yee->set_rgb(0x00FF00)->set_bright(100)->commit(); // calls return the object for fast chaining of commands
$status = $yee->get_prop("power")->commit(); // get current status
print_r($status);
$yee->disconnect();