PHPackages                             webproject-xyz/ikea-tradfri-php-api - 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. webproject-xyz/ikea-tradfri-php-api

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

webproject-xyz/ikea-tradfri-php-api
===================================

PHP library to control ikea tradfri hub

4.3.1(2mo ago)10461[1 issues](https://github.com/WebProject-xyz/ikea-tradfri-php/issues)[2 PRs](https://github.com/WebProject-xyz/ikea-tradfri-php/pulls)MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Oct 24Pushed 3w ago1 watchersCompare

[ Source](https://github.com/WebProject-xyz/ikea-tradfri-php)[ Packagist](https://packagist.org/packages/webproject-xyz/ikea-tradfri-php-api)[ Docs](https://www.webproject.xyz)[ RSS](/packages/webproject-xyz-ikea-tradfri-php-api/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (59)Versions (53)Used By (0)

IKEA Tradfri PHP API
====================

[](#ikea-tradfri-php-api)

[![Codacy Badge](https://camo.githubusercontent.com/93f57f81e8845ea13aafd70436aded19b4394b6481aebe0c876d2e16f5ff8b2d/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6130343339353139306162643463623161613466613963376338303737383130)](https://www.codacy.com/gh/WebProject-xyz/ikea-tradfri-php/dashboard?utm_source=github.com&utm_medium=referral&utm_content=WebProject-xyz/ikea-tradfri-php&utm_campaign=Badge_Grade)[![QA](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/grump.yml/badge.svg)](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/grump.yml)[![Codacy Badge](https://camo.githubusercontent.com/a0baa13932dd9b08f93d964dd5500ea63ab1bdea92bf7ba08bfdedf739e96d17/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6130343339353139306162643463623161613466613963376338303737383130)](https://app.codacy.com/gh/WebProject-xyz/ikea-tradfri-php/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)[![codecov](https://camo.githubusercontent.com/cb33edc464c44e7f3d35665500b83e02c0fa6290f4b21ad8ef0dcf6b529cc094/68747470733a2f2f636f6465636f762e696f2f67682f57656250726f6a6563742d78797a2f696b65612d747261646672692d7068702f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/WebProject-xyz/ikea-tradfri-php)[![Release](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/release.yml/badge.svg)](https://github.com/WebProject-xyz/ikea-tradfri-php/actions/workflows/release.yml)[![PHP Version](https://camo.githubusercontent.com/4d779603a002e40b011868d2cfb46968eee239c1548c1d10a8d9321e6643c4fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77656270726f6a6563742d78797a2f696b65612d747261646672692d7068702d617069)](https://packagist.org/packages/webproject-xyz/ikea-tradfri-php-api)[![Latest Stable Version](https://camo.githubusercontent.com/a55a7675d3dccd6900a3c39d3822a1f0d16fe229d4ec93a9a7f91b6068c3c51e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77656270726f6a6563742d78797a2f696b65612d747261646672692d7068702d617069)](https://packagist.org/packages/webproject-xyz/ikea-tradfri-php-api)[![Total Downloads](https://camo.githubusercontent.com/9fa7c47408f4aaac79e2b47838080618080f3bd14e1cb1a08301781f2e31a735/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656270726f6a6563742d78797a2f696b65612d747261646672692d7068702d617069)](https://packagist.org/packages/webproject-xyz/ikea-tradfri-php-api)[![License](https://camo.githubusercontent.com/f97bf148bf96ab4322dc36c2661b533f1fd27acd8adc28e004bc38e379f6240d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77656270726f6a6563742d78797a2f696b65612d747261646672692d7068702d617069)](https://packagist.org/packages/webproject-xyz/ikea-tradfri-php-api)

A powerful PHP library to control IKEA Tradfri smart lights via the Gateway.

---

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Requirements

[](#1-requirements)

- PHP 8.4+
- `coap-client` (available via Docker)

### 2. Generate Security Key

[](#2-generate-security-key)

Use the [Docker Coap-Client](https://hub.docker.com/r/webproject/coap-client) to get your credentials:

```
docker run --rm webproject/coap-client
  -m post -u "Client_identity" -k ""
  -e '{"9090":"php-api-user"}'
  "coaps://:5684/15011/9063"
```

---

💻 Usage
-------

[](#-usage)

### Initialize API

[](#initialize-api)

```
use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
use IKEA\Tradfri\Factory\GatewayServiceFactory;

$api = (new GatewayServiceFactory(
    new CoapGatewayAuthConfigDto(
        username: 'php-api-user',
        apiKey: 'GENERATED_API_KEY',
        gatewayIp: '192.168.1.10',
        gatewaySecret: 'GATEWAY_SECRET'
    )
))();
```

### Control Devices

[](#control-devices)

```
// Switch on all lights and dim to 80%
foreach ($api->getLights() as $light) {
    $light->switchOn()->dim(80);
}

// Switch off a specific group
$api->getGroups()->first()?->switchOff();
```

---

📖 Documentation
---------------

[](#-documentation)

- [Requirements](requirements.md)
- [Examples](wiki/example)

🤝 Contributing
--------------

[](#-contributing)

Feel free to submit Pull Requests.

📄 License
---------

[](#-license)

MIT License.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 59.4% 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 ~44 days

Recently: every ~14 days

Total

46

Last Release

61d ago

Major Versions

0.3.13 → 1.0.02023-06-18

1.0.0 → 2.0.02024-01-21

2.6.x-dev → 3.0.02025-02-21

3.1.0 → 4.0.02025-04-02

PHP version history (9 changes)0.2.0PHP ^7.4

0.3.0PHP ^7.4 || ^8.0

0.3.12PHP ^7.4 || ^8.0 || ^8.1

1.0.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0

2.0.0PHP ~8.2.0 || ~8.3.0

2.6.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

3.0.0PHP ~8.3.0 || ~8.4.0

4.1.6PHP ~8.3.0 || ~8.4.0 || ~8.5.0

4.2.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8126644ebe55d4c9e7d6e496307e6ee2c6232e7af450b1b915de3b282bd44b2d?d=identicon)[Fahl-Design](/maintainers/Fahl-Design)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (933 commits)")[![Fahl-Design](https://avatars.githubusercontent.com/u/6690962?v=4)](https://github.com/Fahl-Design "Fahl-Design (443 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (101 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (47 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (29 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (14 commits)")[![Jared87](https://avatars.githubusercontent.com/u/6816946?v=4)](https://github.com/Jared87 "Jared87 (3 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

codeceptionikealight-controllerphpsmarthometradfri

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/webproject-xyz-ikea-tradfri-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/webproject-xyz-ikea-tradfri-php-api/health.svg)](https://phpackages.com/packages/webproject-xyz-ikea-tradfri-php-api)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k2](/packages/web-auth-webauthn-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M517](/packages/shopware-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M314](/packages/api-platform-core)

PHPackages © 2026

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