-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtadoapitest.php
49 lines (45 loc) · 1.85 KB
/
tadoapitest.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Author: Dino Ciuffetti - <[email protected]>
* Release date: 2023-08-04
* License: MIT
* NOTE: TadoApi is an unofficial TADO (tm) SDK implementation for PHP (only read only methods). It's a cool way to export metrics from your thermostats.
*
* TADO (tm) does not support its public api in no way. I get the api methods from a tado knowledgebase public post.
* Also, thank to this post: https://shkspr.mobi/blog/2019/02/tado-api-guide-updated-for-2019/
* It's working for me, may be this is also ok for you. Like any other open source software, the author cannot assume any warranty.
*/
declare(strict_types=1);
use dAm2K\TadoApi;
require "vendor/autoload.php";
$tadoconf = [
// Tado client ID and secret from https://my.tado.com/webapp/env.js
'tado.clientId' => 'tado-web-app',
'tado.clientSecret' => 'taG9tXxzGrIFWixUT1nZnzIjlovENGe0KNAB51ADKZQjSlNBvhs0xbT6tC4jIUaC',
'tado.username' => '[email protected]',
'tado.password' => 'yourtadopassporcoziochenotiziamacomelhamessadentroguarda',
'tado.homeid' => '36389',
// your home's ID.
'statefile' => '/tmp/dam2ktado_aeSh8aem.txt' // we put access token here. When the AT expires a new one get collected and saved here
];
$tado = new TadoApi($tadoconf);
//$o=$tado->getMe();
//$o=$tado->getHome();
//$o=$tado->getWeather();
//$o=$tado->getInstallations();
//$o=$tado->getUsers();
//$o=$tado->getMobiles();
//$o=$tado->getMobileSettings("", "7044858");
//$o=$tado->getZones();
//$o=$tado->getZoneState("", "7");
//$o=$tado->getZoneStates("");
//$o=$tado->getZoneCapabilities("", "7");
//$o=$tado->getZoneEarlyStart("", "7");
//$o=$tado->getZoneOverlay("", "7");
//$o=$tado->getZoneScheduleActiveTimetable("", "7");
//$o=$tado->getZoneScheduleAway("", "7");
//$o=$tado->getHomeState();
//$o=$tado->isAnyoneAtHome();
//$tado->identifyDevice("RU0123456789");
$o = $tado->getHomeMetrics();
print_r(json_encode($o));