Jump to content

huseyinergen

New Members
  • Posts

    8
  • Joined

  • Last visited

huseyinergen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I didn't find a typo in your post I was trying all possibilities.
  2. i was try. Codes here; Results; Where is the problem in my codes
  3. Hello. Thank you for response. This Codes controlling or getting status of tuya devices(wifi smart switch). When i sending "get_status" command, i got stdclass results (please look first message) get status command ($sonuc line). I want to get switch_1 status from $sonuc results...
  4. All Codes are below. Please help me. I can not find any solution.. <?php $config = [ "secretKey" => "xxxxxxxx" , "accessKey" => "xxxxxxxx" , 'baseUrl' => 'https://openapi.tuyaeu.com' , ]; require( 'TuyaApi.php' ); $device_id = 'xxxxxx'; $tuya = new \tuyapiphp\TuyaApi( $config ); $token = $tuya->token->get_new( )->result->access_token; $tuya->devices( $token )->get_app_list( $app_id ); // Get device status $sonuc = $tuya->devices( $token )->get_status($device_id); echo "<pre>"; //$object = (object) $sonuc; var_dump($sonuc); echo "</pre>"; echo "<br>"; ?>
  5. Resuit is; i got an error. Thank you for your response Warning: array_reduce() expects parameter 1 to be array, null given in /volume1/web/tuya/sadece/get.php on line 76
  6. Hello everyone. i have this problem like this. Can anybody help me? Result of var_dump command below and i want to get value "switch_1". object(stdClass)#12 (4) { ["result"]=> array(6) { [0]=> object(stdClass)#3 (2) { ["code"]=> string(9) "work_mode" ["value"]=> string(6) "colour" } [1]=> object(stdClass)#5 (2) { ["code"]=> string(12) "bright_value" ["value"]=> int(255) } [2]=> object(stdClass)#8 (2) { ["code"]=> string(10) "temp_value" ["value"]=> int(255) } [3]=> object(stdClass)#9 (2) { ["code"]=> string(11) "colour_data" ["value"]=> string(28) "{"h":0.0,"s":255.0,"v":25.0}" } [4]=> object(stdClass)#10 (2) { ["code"]=> string(10) "switch_led" ["value"]=> bool(false) } [5]=> object(stdClass)#11 (2) { ["code"]=> string(8) "switch_1" ["value"]=> bool(true) } } ["success"]=> bool(true) ["t"]=> int(1697436125386) ["tid"]=> string(32) "884a243f6be911eeab9046acc027565a" }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.