Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 785 Bytes

README.md

File metadata and controls

39 lines (29 loc) · 785 Bytes

tuya-connect-php

Sample connect Tuya cloud

Get started

Tuya IoT Development Platform : Quick start

usage

new obj

require_once 'ConnectTuya.php';

$tuya_obj = new ConnectTuya();

get access token

$response_token = $tuya_obj->get_token();
print_r($resonse_token);

Set command

$commands_off = array(
    array(
        "code" => "switch_1",
        "value" => false
    )
);
# tắt ổ điện
$result_switch_off = $tuya_obj->send_commands($device_id, $commands_off, $access_token);
print_r($result_switch_off);

More function at:

Cloud Services API Reference