GithubHelp home page GithubHelp logo

aymkdn / tuyacloud-php Goto Github PK

View Code? Open in Web Editor NEW
29.0 4.0 9.0 24 KB

PHP Library to access to the SmartLife / Tuya objects using the Cloud of Home Assistant

License: MIT License

PHP 100.00%
php smartlife tuya tuya-api smartlife-api

tuyacloud-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tuyacloud-php's Issues

issue with colorSet

I open the issue here for you @RadioBon:

tried:
$tuya->setState([
"name" => "Kitchen Ceiling",
"command" => "colorSet",
"value" => [
"hue" => 40,
"saturation" => 255,
"brightness" => 255
]
]);

But still no change... :(
Any other ideas?

Problem with getting state of device

First of all thanks for your great work!

I just have one problem with getting the state of a device. The function getDevices uses the 'discovery' request and stores the state of the device. The problem is, that the 'discovery' request can be used only once with 1020 sec. (This time has been increased from 600 sec lately). This means, that it is only possible to get the REAL state of the device every 17 minutes. For my application I need to check the state in real-time (or at least every 5 seconds). Therefore I would need a function which really contacts the device and checks the state.

By the way: in your README, chapter 'usage' there is:

// to get the state of a device
echo "State Switch 1 => ".$tuya->setState([
"name" => "switch 1"
]);

I think this should be getState instead of setState. Calling setState without value alway turns off the device.

problem with state

Hi.
I have a problem with state of a switch. When i set state by Smart Life apk, everything is ok. State is retrieved correctly, but when I set the state with setState(), the state remains "" (empty). What is the problem?

accessToken

Hey mate! Congrats for the code!

How/where do I get the accessToken? Didn't get that. In tuya's cloud I just have access ID and access Secret. Tried to use both with no luck.

Thanks

Unable to Login.

Hi @Aymkdn Can you check why i'm getting this issue.
image
I'm trying with Country code 880 for Bangladesh and Region eu

Color Set

Hi Aymkdn,

Nice code in tuyacloud-php, and can set brightness, power for a bulb. How can I set a color though please? It is not documented?

Thanks,
Bon

No part of the devices

There are wifi switches present, but no devices added via smart IR (also lights controlled by IR). Is it possible to add this in any way?

No Output

Hello,

I hope you can help me. I try to find a solution for weeks :/

I m using Debian buster and there is no output, no matter which function I use.
There is no error in the error log and no information in the server logs.

I use the current Debian version and curl. All is up to date.

If I print_r the output of $tuya->getDevices() the Array is empty.

The general array for $tuya just shows my login data. The login data is correct.

TuyaCloud Object

 (
     [profile] => Array
         (
             [userName] => [email protected]
             [password] => XXXXXXXX
             [bizType] => smart_life
             [countryCode] => 49
             [region] => eu
             [from] => tuya
         )
 
     [uri] => https://px1.tuyaeu.com/homeassistant
     [accessToken] => XXXXXXXXXXXXXXXXXXXX
 )

Any idea what I can do that I can access my devices, linked with the tuya account and the tuya bridge?
All neccesary permissions are set in the tuya cloud.

Is there any debug mode for your script? Or is there any possibility to contact you somewhere? :)

Thank you very much :)

[tuyacloud] Unable to login

Hello,

wes trying to use your PHP Library to access to the SmartLife / Tuya objects, but I'm getting this error all the time:

PHP Fatal error: Uncaught Exception: [tuyacloud] Unable to login: {"responseStatus":"error","errorMsg":"you cannot auth exceed once in 60 seconds"}

Can you help me figuring out what's happening?

Best,
JAC

Reset Bulb to white

Hi again Aymkdn,

Sorry man, I'm just playing with colorSet, works great, thank you!

I wonder though, is there a quick shortcut to reset the bulb to standard white? In the Tuya app you can select all colors, as the api lets us, but you can also set the bulb back to a standard "white". Is there a quick way to do that in TuyaCloud? I think in the app it just disables the color LED's and uses the white ones only?

Thanks,

Ian

set brightness on dimmer

Hello,
I've a problem to set brigtness on my dimmer. On/Off works fine. But "colorset" doesn't.

$tuya->setState([ "name" => "PV Dimmer", "command" => "colorSet", "value" => [ "brightness" => 10 ] ]);

Originally posted by @hochland123 in #5 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.