PHPackages                             yuzewang/aliyun-open-api-iot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. yuzewang/aliyun-open-api-iot

ActiveLibrary[API Development](/categories/api)

yuzewang/aliyun-open-api-iot
============================

The IOT SDK for Aliyun OpenAPI

v0.0.2(9y ago)122MITPHPPHP &gt;=5.3.0

Since Jul 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/yuzewang/php-aliyun-open-api-iot)[ Packagist](https://packagist.org/packages/yuzewang/aliyun-open-api-iot)[ Docs](https://github.com/yuzewang/aliyun-open-api-iot)[ RSS](/packages/yuzewang-aliyun-open-api-iot/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

The IOT SDK for Aliyun OpenAPI
==============================

[](#the-iot-sdk-for-aliyun-openapi)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d8697c1f9cf03645be7bc034a7ad99b5195f3d0adff7acb86e9c9231c61740ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79757a6577616e672f616c6979756e2d6f70656e2d6170692d696f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yuzewang/aliyun-open-api-iot)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c70da82eb6de2ef2afd84a9579e30478a9619084951232fabd69d96e22709504/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f79757a6577616e672f616c6979756e2d6f70656e2d6170692d696f742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/yuzewang/aliyun-open-api-iot)[![Coverage Status](https://camo.githubusercontent.com/74e6d6698e241fdbbf781a65cda57beb62dac88c2a32bbd0357ffc6a28fdf28c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f79757a6577616e672f616c6979756e2d6f70656e2d6170692d696f742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/yuzewang/aliyun-open-api-iot/code-structure)[![Quality Score](https://camo.githubusercontent.com/3d33ae2f94219ca6e0146b93bbf7c5c6fb4da9412a42b8507b0c3c4b9ecf2635/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f79757a6577616e672f616c6979756e2d6f70656e2d6170692d696f742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/yuzewang/aliyun-open-api-iot)[![Total Downloads](https://camo.githubusercontent.com/86722edebc0784234525e7a25be80ba0541e3b86b73714a7831d0e24886a74e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79757a6577616e672f616c6979756e2d6f70656e2d6170692d696f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yuzewang/aliyun-open-api-iot)

The IOT SDK for Aliyun OpenAPI

Install
-------

[](#install)

Via Composer

```
$composer require yuzewang/aliyun-open-api-iot
```

Usage
-----

[](#usage)

```
use Aliyun\Core\Regions\Endpoint;
use Aliyun\Core\Regions\EndpointConfig;
use Aliyun\Core\Regions\EndpointProvider;
use Aliyun\Core\Profile\DefaultProfile;
use Aliyun\IOT\Request\RegistDeviceRequest;
use Aliyun\Core\DefaultAcsClient;

/**
 * 访问信息
 */
$config = [
	'AccessKeyId'=>'',
	'AccessKeySecret'=>'',
	'ProductKey'=>'',
];

/**
 * 配置网关
 */
$endpoint = new Endpoint('cn-shanghai', EndpointConfig::getRegionIds(), EndpointConfig::getProductDomains());
EndpointProvider::setEndpoints([ $endpoint ]);

/**
 * 授权资料
 */
$profile = DefaultProfile::getProfile('cn-shanghai', $config['AccessKeyId'], $config['AccessKeySecret']);

/**
 * 发消息到指定的Topic
 */
$client  = new DefaultAcsClient($profile);
$request = new Iot\PubRequest();
$request->setAppKey($config['ProductKey']);

$request->setTopicFullName($appKey . "/deviceId/" . $deviceId);
print_r($request->getTopicFullName());
print_r("\r\n");
$request->setMessageContent(base64_encode("open"));
$response = $client->getAcsResponse($request);
print_r($response);
print_r("\r\n");
sleep(10);
$request->setMessageContent(base64_encode("close"));
$response = $client->getAcsResponse($request);
print_r($response);
print_r("\r\n");

[官方文档](https://help.aliyun.com/document_detail/30568.html?spm=5176.doc30594.6.134.zdfioe)

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Testing

``` bash
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [yuzewang](https://github.com/yuzewang)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

2

Last Release

3576d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0595205e660893bf75381b02f19444095da4b375c6e94c04962a33db3009e03?d=identicon)[yuze](/maintainers/yuze)

---

Top Contributors

[![yuzewang](https://avatars.githubusercontent.com/u/3657957?v=4)](https://github.com/yuzewang "yuzewang (5 commits)")

---

Tags

phpsdkaliyuniot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yuzewang-aliyun-open-api-iot/health.svg)

```
[![Health](https://phpackages.com/badges/yuzewang-aliyun-open-api-iot/health.svg)](https://phpackages.com/packages/yuzewang-aliyun-open-api-iot)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
