aymkdn / tuyacloud-php Goto Github PK
View Code? Open in Web Editor NEWPHP Library to access to the SmartLife / Tuya objects using the Cloud of Home Assistant
License: MIT License
PHP Library to access to the SmartLife / Tuya objects using the Cloud of Home Assistant
License: MIT License
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?
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.
@Aymkdn How to set a color for a light bulb? Can i give an example.
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?
Is there a way to get the energy reading in a smart switch meter?
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
hi my friend
How I Can Read Temp & Humidity Values From Temp Sensor ??
i can't read it
and i can't found zigbee devices ?
help me please
Hi @Aymkdn Can you check why i'm getting this issue.
I'm trying with Country code 880 for Bangladesh and Region eu
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
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?
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 :)
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
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
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.