https://github.com/giannisftaras/ge-api
PHP wrapper for the General Electric - SmartHQ API
https://github.com/giannisftaras/ge-api
api library php smarthq
Last synced: 5 months ago
JSON representation
PHP wrapper for the General Electric - SmartHQ API
- Host: GitHub
- URL: https://github.com/giannisftaras/ge-api
- Owner: giannisftaras
- License: apache-2.0
- Created: 2022-01-01T12:09:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-13T11:21:37.000Z (about 4 years ago)
- Last Synced: 2025-05-21T14:51:51.751Z (about 1 year ago)
- Topics: api, library, php, smarthq
- Language: PHP
- Homepage:
- Size: 377 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP - General Electric / SmartHQ API
This library is a simple PHP wrapper for the General Electric / SmartHQ API. At the moment the library utilizes only a single endpoint from the API since I don't have all the devices listed to test it with. If you want support for more devices you can implement your own calls & functions and create a pull request to merge it to the main branch.
Additional required libraries (included in the main package):
- [GuzzleHTTP](https://github.com/guzzle/guzzle): for the API calls
- [SimpleHTMLDOM](https://github.com/voku/simple_html_dom): for the login process
#### Supported devices:
- Split Air Conditioner
#### Installation:
You can install the library using `composer` or by simply downloading this repository and including it in your project.
Installation using `composer`:
composer require giannisftaras/ge-api
#### Usage:
Make sure you implement a storage object in order to store the Bearer / Access token generated during the login flow which will help in loading times and when quering the API in order to avoid logging in all the time.
```php
init();
# Store the returned token to a $_SESSION or setup your own storage object
$_SESSION['GE_token'] = $return_token;
# Initialize the GE\User object
$ge_user = new \GE\User();
# Get user appliances
$appl = $ge_user->get_appliances()[0];
# Run commands on the appliance
$appl->power_on();
$appl->set_temperature(25);
?>
```
You can view the AC class in `/src/geAPI/commands/ac_commands.php` for all available functions and commands.