Skip to content

beshkin/micloud-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mi Cloud client library

Current PHP library helps to manage Mi devices through cloud access.

Installation

$ composer require beshkin/micloud-php

Usage

Power On device

$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)
);

Get device data

I use this method in order to get sensor data (temperature, humidity etc)

$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->request('/home/device_list', ['dids' => [your device id]]);

Special thanks

Basically this library is a translation from node-mihome library cloud client (https://github.com/samueljansem/node-mihome) Thanks Samuel Jansem for inspiration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published