PHPackages                             azurre/php-broadlink - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. azurre/php-broadlink

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

azurre/php-broadlink
====================

Broadlink device library

1.0.0(7y ago)027ISCPHP

Since Jul 30Pushed 7y ago2 watchersCompare

[ Source](https://github.com/azurre/php-broadlink)[ Packagist](https://packagist.org/packages/azurre/php-broadlink)[ RSS](/packages/azurre-php-broadlink/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

BroadLink devices communications library
========================================

[](#broadlink-devices-communications-library)

Based on [https://github.com/nick7zmail/MajorDoMo-dev\_broadlink](https://github.com/nick7zmail/MajorDoMo-dev_broadlink)

Supported devices:

- BroadLink SP3S (0x947a)

Usage
-----

[](#usage)

### Find devices in local network

[](#find-devices-in-local-network)

```
$loader = require_once __DIR__ . '/vendor/autoload.php';
echo '';
$devices = \Azurre\Component\SmartDevice\Broadlink\Transport::discover();
print_r($devices);
```

Output

```
Array
(
    [0] => Array
        (
            [ip] => 192.168.0.190
            [mac] => 17:5e:be:34:ec:14
            [type] => 38010
            [name] => SP3S(16A)
        )

)

```

Get authozitation data
----------------------

[](#get-authozitation-data)

```
$loader = require_once __DIR__ . '/vendor/autoload.php';
echo '';
$device = new \Azurre\Component\SmartDevice\Broadlink\Device\SP3S;
$response = $device
    ->setHost('192.168.0.190')
    ->setMac('17:5e:be:34:ec:14')
    ->auth();

print_r($response);
$storage->saveAuthData('mydevice', $response); // Save auth data
```

Output

```
Array
(
    [id] => Array
        (
            [0] => 1
            [1] => 0
            [2] => 0
            [3] => 0
        )

    [key] => Array
        (
            [0] => 25
            [1] => 243
            [2] => 107
            [3] => 167
            [4] => 53
            [5] => 201
            [6] => 71
            [7] => 251
            [8] => 17
            [9] => 63
            [10] => 37
            [11] => 245
            [12] => 195
            [13] => 89
            [14] => 177
            [15] => 55
        )

    [time] => 1532957735
)

```

Get power state
---------------

[](#get-power-state)

```
$loader = require_once __DIR__ . '/vendor/autoload.php';
echo '';
$device = new \Azurre\Component\SmartDevice\Broadlink\Device\SP3S;
list($id, $key, $time) = $storage->getAuthData('mydevice'); // Get auth data
$device
    ->setHost('192.168.0.190')
    ->setMac('17:5e:be:34:ec:14')
if (time() - $time >= \Azurre\Component\SmartDevice\Broadlink\Transport::AUTH_KEY_EXPIRE) {
    $device->auth();
    // Save auth data
} else {
    // Authorize using saved credentials
    $device->auth($id, $key);
}
print_r( $device->getPowerState() );
```

Output

```
Array
(
    [power_state] => 1
    [light_state] => 0
)

```

Get current power
-----------------

[](#get-current-power)

```
$loader = require_once __DIR__ . '/vendor/autoload.php';
echo '';
$device = new \Azurre\Component\SmartDevice\Broadlink\Device\SP3S;
list($id, $key, $time) = $storage->getAuthData('mydevice'); // Get auth data
$device
    ->setHost('192.168.0.190')
    ->setMac('17:5e:be:34:ec:14')
if (time() - $time >= \Azurre\Component\SmartDevice\Broadlink\Transport::AUTH_KEY_EXPIRE) {
    $device->auth();
    // Save auth data
} else {
    // Authorize using saved credentials
    $device->auth($id, $key);
}
var_dump( $device->getCurrentPower() )
```

Output

```
float(268.32)

```

Set power state
---------------

[](#set-power-state)

```
$loader = require_once __DIR__ . '/vendor/autoload.php';
echo '';
$device = new \Azurre\Component\SmartDevice\Broadlink\Device\SP3S;
list($id, $key, $time) = $storage->getAuthData('mydevice'); // Get auth data
$device
    ->setHost('192.168.0.190')
    ->setMac('17:5e:be:34:ec:14')
if (time() - $time >= \Azurre\Component\SmartDevice\Broadlink\Transport::AUTH_KEY_EXPIRE) {
    $device->auth();
    // Save auth data
} else {
    // Authorize using saved credentials
    $device->auth($id, $key);
}
$turnOn = true;
$device->setPowerState($turnOn);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Unknown

Total

1

Last Release

2844d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5bbeafb1d06ec9c1ba940980a19a3fd3902cef3499a446726677986be73b0ec?d=identicon)[a.milenin](/maintainers/a.milenin)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/azurre-php-broadlink/health.svg)

```
[![Health](https://phpackages.com/badges/azurre-php-broadlink/health.svg)](https://phpackages.com/packages/azurre-php-broadlink)
```

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[symfony/polyfill-php54

Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions

9630.8M5](/packages/symfony-polyfill-php54)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-widget-affix

A scrollspy and affixed enhanced navigation to highlight page sections (sub repo split from yii2-widgets)

153.8M3](/packages/kartik-v-yii2-widget-affix)[flow-php/array-dot

PHP ETL - Array Dot functions

14374.1k3](/packages/flow-php-array-dot)

PHPackages © 2026

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