PHPackages                             skydiablo/shelly - 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. skydiablo/shelly

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

skydiablo/shelly
================

PHP library for Shelly Gen2+ devices (JSON-RPC over HTTP and AMQP/MQTT RPC)

034PHP

Since Jun 19Pushed 1mo agoCompare

[ Source](https://github.com/skydiablo/shelly)[ Packagist](https://packagist.org/packages/skydiablo/shelly)[ RSS](/packages/skydiablo-shelly/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SkyDiablo Shelly PHP Library
============================

[](#skydiablo-shelly-php-library)

A PHP library for controlling and managing **Shelly Gen2+ devices** (Plus, Pro, Gen3, Gen4) via the official JSON-RPC API.

Supported devices
-----------------

[](#supported-devices)

This library targets Shelly devices that expose the **Gen2+ JSON-RPC API** (HTTP `POST /rpc`, optional MQTT/AMQP RPC on `{topic_prefix}/{device_id}/rpc`).

SupportedNot supportedShelly Plus seriesShelly Gen1 (original ESP8266 devices)Shelly Pro seriesREST-only firmware without `/rpc`Shelly Gen3 / Gen4Gen1 devices use a different protocol: path-based HTTP REST (`/relay/0?turn=on`), HTTP Basic authentication, and classic MQTT topics under `shellies/`. They are **out of scope** for this library.

**API reference:** [Shelly Gen2+ documentation](https://shelly-api-docs.shelly.cloud/gen2/)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4
- react/http ^3

Installation
------------

[](#installation)

```
composer require skydiablo/shelly
```

Features
--------

[](#features)

- HTTP and AMQP client support for Shelly Gen2+ RPC
- Component wrappers for the Gen2+ API:
    - System configuration and management
    - WiFi configuration
    - MQTT configuration
    - Switch control
    - Cloud settings
    - KVS (Key-Value Store)
    - Executer
- Device models for Gen2 devices (Generic, Pro1PM)
- Digest authentication (Shelly Gen2+ HTTP)
- Asynchronous operations using ReactPHP promises

Usage
-----

[](#usage)

```
use PhpExtended\Ip\Ipv4AddressParser;
use PhpExtended\Mac\MacAddress48Parser;
use SkyDiablo\Shelly\Model\Factory;
use SkyDiablo\Shelly\Model\Shelly;

// Create factory with MAC address parser
$factory = new Factory(new MacAddress48Parser());
$ip = (new Ipv4AddressParser())->parse('192.168.0.10');

// Create a Shelly device instance from IP address (requires a Gen2+ device at that IP)
$factory->shelly($ip)->then(function (Shelly $shelly) {
    // Use the Shelly device instance
    // The factory calls Shelly.GetDeviceInfo via RPC to obtain MAC address and device id
})->otherwise(function ($error) {
    // Handle error (e.g. Gen1 device or unreachable host)
});
```

License
-------

[](#license)

MIT License — see [LICENSE](LICENSE) file for details.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance61

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/956423?v=4)[Volker](/maintainers/skydiablo)[@skydiablo](https://github.com/skydiablo)

---

Top Contributors

[![skydiablo](https://avatars.githubusercontent.com/u/956423?v=4)](https://github.com/skydiablo "skydiablo (15 commits)")

### Embed Badge

![Health badge](/badges/skydiablo-shelly/health.svg)

```
[![Health](https://phpackages.com/badges/skydiablo-shelly/health.svg)](https://phpackages.com/packages/skydiablo-shelly)
```

###  Alternatives

[dive-be/php-enum-utils

Those utilities you always need when dealing with native enumerations.

31303.1k1](/packages/dive-be-php-enum-utils)

PHPackages © 2026

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