PHPackages                             llm-agents/agent-smart-home-control - 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. llm-agents/agent-smart-home-control

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

llm-agents/agent-smart-home-control
===================================

Simple agent to control smart home devices

1.1.0(1y ago)177MITPHPPHP ^8.3

Since Sep 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/llm-agents-php/agent-smart-home-control)[ Packagist](https://packagist.org/packages/llm-agents/agent-smart-home-control)[ RSS](/packages/llm-agents-agent-smart-home-control/feed)WikiDiscussions main Synced 1mo ago

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

Smart Home control system with LLM Agents
=========================================

[](#smart-home-control-system-with-llm-agents)

[![PHP](https://camo.githubusercontent.com/8ebe335eed7e9e15989ecd42c67030c699acc5ead9e1fa0764318c77d7ed9501/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c6c6d2d6167656e74732f6167656e742d736d6172742d686f6d652d636f6e74726f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/agent-smart-home-control)[![Latest Version on Packagist](https://camo.githubusercontent.com/19fd80024bbd6685d0337a3aad9e35b359c802ae4b8ce2d4c4529dd9393d8729/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6d2d6167656e74732f6167656e742d736d6172742d686f6d652d636f6e74726f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/agent-smart-home-control)[![Total Downloads](https://camo.githubusercontent.com/4b6249330dd8204eafa8ba2da59ec80b938edaf729118779c6f7248688a7de6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6d2d6167656e74732f6167656e742d736d6172742d686f6d652d636f6e74726f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/agent-smart-home-control)

This nifty tool lets you boss around your smart home devices using plain old English. No more fumbling with apps or remembering device names!

🚀 What's This All About?
------------------------

[](#-whats-this-all-about)

Imagine telling your house, "I'm cold" and having it crank up the heat. Or saying, "Movie night!" and watching your living room transform into a mini-cinema. That's what we're doing here! We've got an AI agent that understands what you want and makes it happen.

> You can read an article about Smart Home control system with LLM Agents on [Medium](https://butschster.medium.com/a-php-devs-dream-an-ai-home-that-really-gets-you-dd97ae2ca0b0).

[![image](https://private-user-images.githubusercontent.com/773481/364027287-405275f8-a180-4134-806d-bc7287e779dc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI0OTUsIm5iZiI6MTc3NTEwMjE5NSwicGF0aCI6Ii83NzM0ODEvMzY0MDI3Mjg3LTQwNTI3NWY4LWExODAtNDEzNC04MDZkLWJjNzI4N2U3NzlkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMlQwMzU2MzVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NTRmY2U1ZTBhNGQ5MTBkNGEwNjNjMTg4NTE2MzRlODdjYjM0NzIxMWFhYTMzMTQ2ZTMzMzM5NTQ3YWU1NWRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ER6b5h44yPLszMVtiKsiST_QoLra0bsvMTgCoQAVOTg)](https://private-user-images.githubusercontent.com/773481/364027287-405275f8-a180-4134-806d-bc7287e779dc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI0OTUsIm5iZiI6MTc3NTEwMjE5NSwicGF0aCI6Ii83NzM0ODEvMzY0MDI3Mjg3LTQwNTI3NWY4LWExODAtNDEzNC04MDZkLWJjNzI4N2U3NzlkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMlQwMzU2MzVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NTRmY2U1ZTBhNGQ5MTBkNGEwNjNjMTg4NTE2MzRlODdjYjM0NzIxMWFhYTMzMTQ2ZTMzMzM5NTQ3YWU1NWRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ER6b5h44yPLszMVtiKsiST_QoLra0bsvMTgCoQAVOTg)

🛠 What You'll Need
------------------

[](#-what-youll-need)

- PHP 8.3 or later (we're using some fancy new features!)
- An LLM service (like OpenAI's GPT-4)

Let's get started! 🚀
--------------------

[](#lets-get-started-)

### Installation

[](#installation)

First things first, let's get this package installed:

```
composer require llm-agents/agent-smart-home-control
```

### Setup in Spiral Framework

[](#setup-in-spiral-framework)

To get the Site Status Checker Agent up and running in your Spiral Framework project, you need to register its bootloader.

**Here's how:**

1. Open up your `app/src/Application/Kernel.php` file.
2. Add the bootloader like this:

```
public function defineBootloaders(): array
{
    return [
        // ... other bootloaders ...
        \LLM\Agents\Agent\SmartHomeControl\Integrations\Spiral\SmartHomeControlBootloader::class,
    ];
}
```

And that's it! Your Spiral app is now ready to use the agent.

🏗 Class Diagram
---------------

[](#-class-diagram)

Here's a quick look at how everything fits together:

 ```
classDiagram
    class SmartHomeControlAgent {
        +execute(prompt: string): string
    }
    class SmartHomeSystem {
        +getDevices(): array
        +controlDevice(deviceId: string, action: string): bool
    }
    class Device {
        +id: string
        +name: string
        +type: string
        +room: string
        +getState(): array
        +setState(state: array): bool
    }
    class Light {
        +turnOn()
        +turnOff()
        +setBrightness(level: int)
    }
    class Thermostat {
        +setTemperature(temp: float)
    }
    class TV {
        +turnOn()
        +turnOff()
        +setChannel(channel: string)
    }
    SmartHomeControlAgent --> SmartHomeSystem: uses
    SmartHomeSystem --> Device: manages
    Device
