PHP code example of beshkin / micloud-php

1. Go to this page and download the library: Download beshkin/micloud-php 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/ */

    

beshkin / micloud-php example snippets

$ composer 

$config = [
    'country' => 'de', // 'ru', 'us', 'tw', 'sg', 'cn', 'de'
    'login' => [your Mi app login],
    'password' => [your Mi app password],
]
$client = new MiCloudClient($config);
$client->login();
$result = $client->miioCall(
    [Device id],
    'set_power',
    Helper::withLightEffect('on', 5)
);