PHPackages                             guym4c/kasa-plug-client - 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. guym4c/kasa-plug-client

ActiveLibrary[API Development](/categories/api)

guym4c/kasa-plug-client
=======================

TP-Link Kasa API client

v1.0(6y ago)081MITPHP

Since Jul 21Pushed 6y agoCompare

[ Source](https://github.com/guym4c/kasa-plug-client)[ Packagist](https://packagist.org/packages/guym4c/kasa-plug-client)[ Docs](https://github.com/guym4c/kasa-plug-client)[ RSS](/packages/guym4c-kasa-plug-client/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

`kasa-plug-client`
==================

[](#kasa-plug-client)

A simple client for the TP-Link Kasa smart plugs.

Install
=======

[](#install)

Via Composer:

```
composer install guym4c/kasa-plug-client
```

Usage
=====

[](#usage)

Get yourself an instance of the client, using your TP-Link Cloud login details (which you use to log in to the app).

```
$kasa = new \Guym4c\Kasa\Client(/* username */, /* password */);
```

As tokens for the unofficial Kasa API expire quite fast, the package takes your credentials and obtains a new token for you on every instantiation.

What you're here for
--------------------

[](#what-youre-here-for)

Turning plugs on and off is simple - you can retrieve a `Plug` using the `$kasa->getPlug()` method. Pass this method a string of the plug alias or plug ID (you can see the alias in the Kasa app, or get a list of your plugs using `getPlugs()`).

Then just call `$plug->setState(bool)` with `true` for *on*, and `false` for *off*. (You can get the current state of the plug's relay using the `status` property of each `Plug`).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

2536d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2103489?v=4)[Guy Mac](/maintainers/guym4c)[@guym4c](https://github.com/guym4c)

---

Top Contributors

[![guym4c](https://avatars.githubusercontent.com/u/2103489?v=4)](https://github.com/guym4c "guym4c (8 commits)")

---

Tags

apiclienttp-linkkasa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guym4c-kasa-plug-client/health.svg)

```
[![Health](https://phpackages.com/badges/guym4c-kasa-plug-client/health.svg)](https://phpackages.com/packages/guym4c-kasa-plug-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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