Download the PHP package mapo-89/laravel-homeassistant-api without Composer
On this page you can find all versions of the php package mapo-89/laravel-homeassistant-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mapo-89/laravel-homeassistant-api
More information about mapo-89/laravel-homeassistant-api
Files in mapo-89/laravel-homeassistant-api
Package laravel-homeassistant-api
Short Description Laravel package to interact with Home Assistant REST API.
License MIT
Homepage https://github.com/mapo-89/laravel-homeassistant-api
Informations about the package laravel-homeassistant-api
🚀 Laravel Homeassistant API
A simple Laravel integration for the Homeassistant API. This package provides a clean interface to interact with the API.
📖 This README is also available in 🇩🇪 German.
📦 Installation
Install the package via Composer:
Add your API token to your .env file:
⚡️ Dynamic configuration (URL & token at runtime)
In addition to static configuration via config/homeassistant.php, this package also supports dynamic configurations at runtime. This is useful, for example, if each user has their own Home Assistant token or if the instance URL is to be set dynamically.
Optionally, you can publish the config file:
⚙️ Usage
📚 The complete API documentation can be found here: home-assistant.io
Initialization
🔄 System API
🔄 Config API
🔄 States API
🧩 Template API
More information about templating
🔔 Events API
Interaction with the Home Assistant event system.
Supported endpoints
GET /api/eventsPOST /api/events/{event_type}
🕒 History API
Access historical state changes of entities.
Flat output (ideal for charts & analytics)
Supported endpoints
GET /api/history/periodPOST /api/history/period/{timestamp}
📒 Logbook API
Access the Home Assistant logbook – ideal for user activities, automations, and system events.
⚠️ The logbook API requires at least one
entityId.
Supported endpoint
GET /api/logbook
Query Builder API (States)
Home Assistant does not support server-side filtering of states. This package therefore provides a query builder-like API that can be used to filter states on the client side – inspired by Laravel Eloquent.
✨ Example
🧱 Available query methods
whereDomain(string $domain)
Filters by the domain of an entity (e.g., light, sensor, switch).
whereState(string $state)
Filters by the state of an entity (e.g., on, off, unavailable).
whereEntityIds(array $entityIds)
Filters by a list of specific entity IDs.
whereAttribute(string $key, mixed $value)
Filters by attributes of an entity.
get()
Returns all filtered states as an array of State DTOs.
first()
Returns the first matching state or null.
Artisan Command
The following Artisan commands always use the static configuration from .env or config/homeassistant.php:
📒 Changelog
Please see CHANGELOG for recent changes.
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
🔐 Security
If you discover any security issues, please do not use the issue tracker. Instead, email us directly at [email protected].
👥 Credits
- Manuel Postler
- All Contributors
📄 License
The MIT License (MIT). Please see the License File for more information.
🛠️ Laravel Package Boilerplate
Generated using the Laravel Package Boilerplate.