-
Notifications
You must be signed in to change notification settings - Fork 4
/
example1.php
28 lines (21 loc) · 953 Bytes
/
example1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types = 1);
require("../vendor/autoload.php");
use \JanKnipper\FritzboxAHA\FritzboxAHA;
$aha = new FritzboxAHA();
$aha->login("fritz.box", "", "password");
echo "Session id: " . $aha->getSid() . "\n";
$devs = $aha->getAllDevices();
foreach ($devs as $dev) {
$ain = $dev["aid"];
echo "Current temperature on device " . $ain . ": " . $aha->getTemperature($ain) . "\n";
echo "Soll temperature for device " . $ain . ": " . $aha->getTemperatureSoll($ain) . "\n";
echo "Comfort temperature for device " . $ain . ": " . $aha->getTemperatureComfort($ain) . "\n";
echo "Low temperature for device " . $ain . ": " . $aha->getTemperatureLow($ain) . "\n";
}
$groups = $aha->getAllGroups();
foreach ($groups as $group) {
echo "Group found: " . $group["identifier"] . "\n";
$aha->setTemperature($group["identifier"], 18);
echo "Setting temperature to 18 degrees for group " . $group["identifier"] . "\n";
}