-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Thank you for the library. It works with my 151S AVR model.
I have never used php before so it took me a bit to set it up, my streamlined notes on a Ubuntu/Debian are below. My use case was to be able to use a script to turn the AVR off when I turn my Raspberry Pi off automatically. This accomplishes it:
- Install the composer dependency manager (for Debian/Ubuntu):
sudo apt install composer - Create a working directory somewhere:
mkdir my_avr_script ; cd my_avr_script - Create a composer.json file in your working directory with this content:
{
"require-dev": {
"karimgeiger/hkapi": "1.0.x-dev"
}
}
- Install the library with:
composer update ; composer install - Create an example script
turn_off.phpwith this content:
<?php require __DIR__ . '/vendor/autoload.php';
echo "Hello World!'\n";
$hk = new \HKAPI\API('192.168.2.206',10025, new \HKAPI\Devices\AVR());
sleep(3);
$hk->zone('Main Zone')->off();
?>
- Turn your AVR off with:
php turn_off.php
It should output:
Hello World!
PHP Notice: Undefined offset: 0 in /home/pi/skripty_na_AVR/vendor/karimgeiger/hkapi/lib/Zone.php on line 95
(the first confirms the script ran and the second is a PHP warning that can be safely ignored it seems)
and the AVR should turn off after three seconds.
Metadata
Metadata
Assignees
Labels
No labels