shadowroot2/gree_ac
最新稳定版本:1.0
Composer 安装命令:
composer require shadowroot2/gree_ac
包简介
API for control Gree AC with WiFi module
README 文档
README
API to control Gree AC with WiFi by network
To make it work you should initialize connection to Gree+ with getting secret-key witch generating every time when you reset WiFi on Gree AC.
- Press Mode + WiFi button on remote of Gree AC (AC must beep once) and wait 2 minutes (AC will go to WiFi access point mode).
- Search Wifi AP with name like: f4211ede6d31 and connect your PC to it (WiFi password is: 12345678)
- Write simple script like finder.php:
<?php require_once 'vendor/autoload.php'; $gree = new \Gree\GreeAC(); $gree->setDebug(true); // If you want to see all print_r($gree->scan()); ?>
- Run from console "php finder.php" you will see response:
Array ( [t] => dev [cid] => f4211ede6d31 [bc] => gree [brand] => gree [catalog] => gree [mac] => f4211ede6d31 [mid] => 10002 [model] => gree [name] => 1ede6d31 [series] => gree [vender] => 1 [ver] => V1.1.13 [lock] => 0 )
- Copy cid to somewhere
- To get bind key (secure key) write script like bind.php:
<?php require_once 'vendor/autoload.php'; $gree = new \Gree\GreeAC(); $gree->setDebug(true); // If you want to see all $gree->setCID('f4211ede6d31'); // Replace to your own cid $key = $gree->getBindKey(); echo 'Secure key is: '.$key; ?>
- Run from console "php bind.php" you will see response: Secure key is: Lz5Op8Rs2Uv4Xy5A
- Save this key to somewhere
- Add AC to Gree+ app (it will add it to your WiFi router)
- Get IP address of AC from your WiFi router (for example it 192.168.10.3)
- Write simple script like test.php:
<?php require_once 'vendor/autoload.php'; $gree = new \Gree\GreeAC('192.168.10.3', 'f4211ede6d31', 'Lz5Op8Rs2Uv4Xy5A'); // Replace values to yours $gree->setDebug(true); // If you want to see all print_r($gree->status()); // Will show current settings print_r($gree->on()); // Switch on AC sleep(3); print_r($gree->off()); // Switch off AC // ...etc ?>
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-11-27