PHP code example of tenth / my-total-comfort

1. Go to this page and download the library: Download tenth/my-total-comfort library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tenth / my-total-comfort example snippets




$tcc = new \Tenth\MyTotalComfort("[email protected]", "password");



$tcc = new \Tenth\MyTotalComfort("[email protected]", "password");

$locationId = 1234567;

echo "<table>";
echo "<tr>
    <td>id</td>
    <td>name</td>
    <td>heatSet</td>
    <td>dispTemp</td>
    <td>coolSet</td>
</tr>";

foreach ($tcc->getZonesByLocation($locationId) as $zi => $zone) {
    echo "<tr>
        <td>{$zone->id}</td>
        <td><a href='https://www.mytotalconnectcomfort.com/portal/Device/Control/{$zone->id}'>{$zone->name}</a></td>
        <td>{$zone->heatSetpoint}</td>
        <td>{$zone->dispTemperature}</td>
        <td>{$zone->coolSetpoint}</td>
    </tr>";
}

echo "</table>";



$tcc = new \Tenth\MyTotalComfort("[email protected]", "password");

$zoneId = 1234567;

$z = $tcc->getZone($zoneId);

$z->heatSetpoint = 70;
$z->coolSetpoint = 74;