Restado
PHP and Laravel library for managing Tado system, (*1)
, (*2)
This package provides a simple interface towards the public Tado Thermostat System API. It wraps the web methods available for authenticating users and retrieve information from the local devices., (*3)
The package is also integrated within Laravel., (*4)
Since the API is currently officially undocumented, if you are aware of methods missing in this library, please inform me!, (*5)
- Installation
- Updating
- Configuration
- Usage
- Supported Methods
-
Issues, Questions and Pull Requests, (*6)
1. Installation
-
Require the package using composer:, (*7)
composer require robertogallea/restado
, (*8)
- Add the service provider to the
providers
in config/app.php
:
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider, (*9)
Robertogallea\Restado\RestadoServiceProvider::class,
- Add the alias to the
aliases
in config/app.php
:
'Restado' => Robertogallea\Restado\Facades\Restado::class,
- Add the following variables to your .env file
TADO_CLIENT_ID=<TADO_APP_ID> // defaults to 1bb50063-6b0c-4d11-bd99-387f4a91cc46
2. Updating
-
To update this package, update the composer package:, (*10)
composer update robertogallea/restado
3. Configuration
- To use Restado, no further configuration is required. However, if you wish to tweak with config, publish the relative
configuration file using the command
php artisan vendor:publish --provider="Robertogallea\Restado\RestadoServiceProvider" --tag=config
4. Usage
To use this package you should use the method of the Restado facade., (*11)
-
Get the verification Data according to RFC8628 (device_code):, (*12)
$verificationData = Restado::getVerificationUrl();
-
Call the verification_uri_complete URL from $verificationData with a browser any complete the verfication process., (*13)
-
Obtain a valid token for your session with device_code given in $verificationData in Step 1:, (*14)
$access_token = Restado::authorize(['device_code' => $verificationData['device_code']]);
-
Use a method to get the related information, for example:, (*15)
$me = Restado::me($access_token);
each method returns an object containing the data from the server. Currently the API is not officially documented, the only reference I found is at this page: http://blog.scphillips.com/posts/2017/01/the-tado-api-v2/, (*16)
5. Supported Methods
Currently these methods are supported:, (*17)
Authorisation
- authorize();
- me($access_token);
Home and device data
- getHome($access_token);
- setHome($access_token, $settings);
- getHomeWeather($access_token);
- getHomeDevices($access_token);
- getHomeInstallations($access_token);
- getHomeUsers($access_token);
- setDazzle($access_token, $zone_id, $setting);
Mobile devices
- getHomeMobileDevices($access_token);
- deleteHomeMobileDevice(token, $mobile_device_id);
- getHomeMobileDeviceSettings($access_token, $mobile_device_id);
- setHomeMobileDeviceSettings($access_token, $mobile_device_id, $settings);
- identifyDevice($access_token, $device_id);
- getAppUsersRelativePositions($access_token);
Home zones
- getHomeZones($access_token);
- getHomeZoneState($access_token, $zone_id);
- getHomeZoneStates($access_token, $home_id);
- getHomeZoneDayReport($access_token, $zone_id, $date);
- getHomeZoneCapabilities($access_token, $zone_id);
- getHomeZoneEarlyStart($access_token, $zone_id);
- setHomeZoneEarlyStart($access_token, $zone_id, $settings);
- getHomeZoneOverlay($access_token, $zone_id);
- setHomeZoneOverlay($access_token, $zone_id, $settings);
- deleteHomeZoneOverlay($access_token, $zone_id);
- getHomeZoneScheduleActiveTimetable($access_token, $zone_id);
- setHomeZoneScheduleActiveTimetable($access_token, $zone_id, $settings);
- getHomeZoneScheduleAway($access_token, $zone_id);
- setHomeZoneScheduleAway($access_token, $zone_id, $settings);
- getHomeZoneScheduleTimetableBlocks($access_token, $zone_id, $timetable_id, $pattern=null);
- setHomeZoneScheduleTimetableBlocks($access_token, $zone_id, $timetable_id, $pattern, $settings);
Temperature offset
- getTemperatureOffset($access_token, $device_id);
- setTemperatureOffset($access_token, $device_id, $settings);
Open window detection
- setOpenWindowDetection($access_token, $zone_id, $settings);
Presence detection
- isAnyoneAtHome($access_token);
- getPresenceLock($access_token);
- setPresenceLock($access_token, $settings);
Energy IQ & savings reports
- deleteEnergyIQMeterReading($access_token, $reading_id);
- addEnergyIQMeterReading($access_token, $settings);
- updateEnergyIQTariff($access_token, $settings);
- getEnergyIQMeterReadings($access_token);
- getEnergyIQTariff($access_token);
- getEnergyIQ($access_token);
- getEnergySavingsReport($access_token, $year, $month, $country_code);
> To request an energy savings report via getEnergySavingsReport, you're required to pass a three-letter country code in accordance with ISO 3166-1 alpha-3
6. Issues, Questions and Pull Requests
You can report issues and ask questions in the issues section. Please start your issue with ISSUE:
and your question with QUESTION:
, (*18)
If you have a question, check the closed issues first., (*19)
To submit a Pull Request, please fork this repository, create a new branch and commit your new/updated code in there. Then open a Pull Request from your new branch. Refer to this guide for more info., (*20)